Importing svn2cl as it is used from script that makes release archives.

Making code DBus optional; all DBus related code is wrapped inside EDELIB_HAVE_DBUS.
This commit is contained in:
Sanel Zukan
2012-09-18 17:49:48 +00:00
parent 0ad6617df4
commit c26b526dcd
12 changed files with 1004 additions and 50 deletions

View File

@@ -224,7 +224,10 @@ Desktop::~Desktop() {
delete gisett;
delete selbox;
#ifdef EDELIB_HAVE_DBUS
delete dbus;
#endif
DirWatch::shutdown();
foreign_callback_remove(settings_changed_cb);
@@ -244,12 +247,14 @@ void Desktop::init_internals(void) {
wallpaper = new Wallpaper(0, 0, w(), h());
end();
#ifdef EDELIB_HAVE_DBUS
dbus = new edelib::EdbusConnection();
if(!dbus->connect(edelib::EDBUS_SESSION)) {
E_WARNING(E_STRLOC ": Unable to connect to session bus. Disabling dbus interface...\n");
delete dbus;
dbus = NULL;
}
#endif
/* read main config */
read_config();
@@ -820,6 +825,7 @@ void Desktop::notify_desktop_changed(void) {
return;
}
#ifdef EDELIB_HAVE_DBUS
if(dbus) {
edelib::EdbusMessage msg;
/* send org.equinoxproject.Desktop.DesktopChanged(int32, string) signal */
@@ -827,6 +833,7 @@ void Desktop::notify_desktop_changed(void) {
msg << num << names[num];
dbus->send(msg);
}
#endif
XFreeStringList(names);
}

View File

@@ -27,9 +27,12 @@
#include <edelib/String.h>
#include <edelib/Resource.h>
#include <edelib/List.h>
#include <edelib/EdbusConnection.h>
#include <edelib/MenuButton.h>
#ifdef EDELIB_HAVE_DBUS
# include <edelib/EdbusConnection.h>
#endif
#define EDAMAGE_CHILD_LABEL 0x10
#define EDAMAGE_OVERLAY 0x20
@@ -109,7 +112,10 @@ private:
edelib::MenuButton* dmenu;
Wallpaper* wallpaper;
#ifdef EDELIB_HAVE_DBUS
edelib::EdbusConnection* dbus;
#endif
DesktopIconList icons;
DesktopIconList selectionbuf;