Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Change define to determine use of DBUS to USE_DBUS, to prevent overla…
Browse files Browse the repository at this point in the history
…p with Qt-defined QT_DBUS
  • Loading branch information
laanwj committed Sep 24, 2011
1 parent 99cec89 commit 010c4fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bitcoin-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ count(USE_UPNP, 1) {
# use: qmake "USE_DBUS=1"
count(USE_DBUS, 1) {
message(Building with DBUS (Freedesktop notifications) support)
DEFINES += QT_DBUS
DEFINES += USE_DBUS
QT += dbus
}

Expand Down
12 changes: 6 additions & 6 deletions src/qt/notificator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <QSystemTrayIcon>
#include <QMessageBox>

#ifdef QT_DBUS
#ifdef USE_DBUS
#include <QtDBus/QtDBus>
#include <stdint.h>
#endif
Expand All @@ -23,15 +23,15 @@ Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon,
programName(programName),
mode(None),
trayIcon(trayicon)
#ifdef QT_DBUS
#ifdef USE_DBUS
,interface(0)
#endif
{
if(trayicon && trayicon->supportsMessages())
{
mode = QSystemTray;
}
#ifdef QT_DBUS
#ifdef USE_DBUS
interface = new QDBusInterface("org.freedesktop.Notifications",
"/org/freedesktop/Notifications", "org.freedesktop.Notifications");
if(interface->isValid())
Expand All @@ -43,12 +43,12 @@ Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon,

Notificator::~Notificator()
{
#ifdef QT_DBUS
#ifdef USE_DBUS
delete interface;
#endif
}

#ifdef QT_DBUS
#ifdef USE_DBUS

// Loosely based on http://www.qtcentre.org/archive/index.php/t-25879.html
class FreedesktopImage
Expand Down Expand Up @@ -205,7 +205,7 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c
{
switch(mode)
{
#ifdef QT_DBUS
#ifdef USE_DBUS
case Freedesktop:
notifyDBus(cls, title, text, icon, millisTimeout);
break;
Expand Down
4 changes: 2 additions & 2 deletions src/qt/notificator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

QT_BEGIN_NAMESPACE
class QSystemTrayIcon;
#ifdef QT_DBUS
#ifdef USE_DBUS
class QDBusInterface;
#endif
QT_END_NAMESPACE
Expand Down Expand Up @@ -52,7 +52,7 @@ public slots:
QString programName;
Mode mode;
QSystemTrayIcon *trayIcon;
#ifdef QT_DBUS
#ifdef USE_DBUS
QDBusInterface *interface;

void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);
Expand Down

0 comments on commit 010c4fc

Please sign in to comment.