FACT++  1.0
int SkypeClient::EvalOptions ( Configuration conf)
inline

Definition at line 663 of file skypeclient.cc.

References Error(), Configuration::Get(), and NotifyHandler().

664  {
665  fUser = conf.Get<string>("user");
666  fAllowRaw = conf.Get<bool>("allow-raw");
667 
668  // Get a connection to the session bus.
669  DBusError error;
670  dbus_error_init(&error);
671 
672  fBus = dbus_bus_get(DBUS_BUS_SESSION, &error);
673  if (!fBus)
674  {
675  Error("dbus_bus_get failed: "+string(error.message));
676  dbus_error_free(&error);
677  return 1;
678  }
679 
680  // Set up this connection to work in a GLib event loop.
681  dbus_connection_setup_with_g_main(fBus, NULL);
682 
683  // Install notify handler to process Skype's notifications.
684  // The Skype-to-client method call.
685  DBusObjectPathVTable vtable;
686  vtable.message_function = SkypeClient::NotifyHandler;
687 
688  // We will process messages with the object path "/com/Skype/Client".
689  const dbus_bool_t check =
690  dbus_connection_register_object_path(fBus, "/com/Skype/Client",
691  &vtable, this);
692  if (!check)
693  {
694  Error("dbus_connection_register_object_path failed.");
695  return 2;
696  }
697 
698  return -1;
699  }
T Get(const std::string &var)
bool fAllowRaw
Definition: skypeclient.cc:33
int Error(const std::string &str)
Definition: MessageImp.h:49
string fUser
Definition: skypeclient.cc:31
DBusConnection * fBus
Definition: skypeclient.cc:26
static DBusHandlerResult NotifyHandler(DBusConnection *, DBusMessage *dbus_msg, void *user_data)
Definition: skypeclient.cc:54

+ Here is the call graph for this function: