~ubuntu-branches/ubuntu/raring/vino/raring-proposed

« back to all changes in this revision

Viewing changes to .pc/12_app-indicators-only.patch/server/vino-server.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-08-21 17:07:41 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20120821170741-zj374mk9p2ij8jvr
Tags: 3.5.90-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <sys/poll.h>
40
40
#include <gtk/gtk.h>
41
41
 
42
 
#ifdef VINO_HAVE_GNOME_KEYRING
43
 
#include <gnome-keyring.h>
 
42
#ifdef VINO_HAVE_SECRET
 
43
#include <libsecret/secret.h>
44
44
#endif
45
45
 
46
46
G_DEFINE_TYPE (VinoServer, vino_server, G_TYPE_OBJECT);
686
686
static char *
687
687
vino_server_get_password_from_keyring (VinoServer *server)
688
688
{
689
 
#ifdef VINO_HAVE_GNOME_KEYRING
690
 
  GnomeKeyringNetworkPasswordData *found_item;
691
 
  GnomeKeyringResult               result;
692
 
  GList                           *matches;
693
 
  char                            *password;
694
 
  
695
 
  matches = NULL;
696
 
 
697
 
  result = gnome_keyring_find_network_password_sync (
698
 
                NULL,           /* user     */
699
 
                NULL,           /* domain   */
700
 
                "vino.local",   /* server   */
701
 
                NULL,           /* object   */
702
 
                "rfb",          /* protocol */
703
 
                "vnc-password", /* authtype */
704
 
                5900,           /* port     */
705
 
                &matches);
706
 
 
707
 
  if (result != GNOME_KEYRING_RESULT_OK || matches == NULL || matches->data == NULL)
708
 
    return NULL;
709
 
 
710
 
 
711
 
  found_item = (GnomeKeyringNetworkPasswordData *) matches->data;
712
 
 
713
 
  password = g_strdup (found_item->password);
714
 
 
715
 
  gnome_keyring_network_password_list_free (matches);
716
 
 
717
 
  return password;
 
689
#ifdef VINO_HAVE_SECRET
 
690
  return secret_password_lookup_sync (SECRET_SCHEMA_COMPAT_NETWORK,
 
691
                                      NULL, NULL,
 
692
                                      "server", "vino.local",
 
693
                                      "protocol", "rfb",
 
694
                                      "authtype", "vnc-password",
 
695
                                      "port", 5900,
 
696
                                      NULL);
718
697
#else
719
698
  return NULL;
720
699
#endif