Lines 39-45
Link Here
|
39 |
#include "Plugins.h" |
39 |
#include "Plugins.h" |
40 |
#include "Global.h" |
40 |
#include "Global.h" |
41 |
#ifndef Q_OS_MAC |
41 |
#ifndef Q_OS_MAC |
42 |
#include "DBus.h" |
|
|
43 |
#endif |
42 |
#endif |
44 |
#include "VersionCheck.h" |
43 |
#include "VersionCheck.h" |
45 |
#include "NetworkConfig.h" |
44 |
#include "NetworkConfig.h" |
Lines 73-95
Link Here
|
73 |
|
72 |
|
74 |
Global::g_global_struct = new Global(); |
73 |
Global::g_global_struct = new Global(); |
75 |
|
74 |
|
76 |
#ifndef Q_OS_MAC |
|
|
77 |
#ifdef Q_OS_WIN |
78 |
// By default, windbus expects the path to dbus-daemon to be in PATH, and the path |
79 |
// should contain bin\\, and the path to the config is hardcoded as ..\etc |
80 |
_putenv(qPrintable(QString::fromLatin1("PATH=%1\\bin;%1;%2").arg(QDir::toNativeSeparators(a.applicationDirPath())).arg(QLatin1String(getenv("PATH"))))); |
81 |
#endif |
82 |
|
83 |
QDBusInterface qdbi(QLatin1String("net.sourceforge.mumble.mumble"), QLatin1String("/")); |
84 |
QDBusMessage reply=qdbi.call(QLatin1String("focus")); |
85 |
if (reply.type() == QDBusMessage::ReplyMessage) { |
86 |
if (a.arguments().count() > 1) { |
87 |
qdbi.call(QLatin1String("openUrl"), a.arguments().last()); |
88 |
} |
89 |
return 0; |
90 |
} |
91 |
#endif |
92 |
|
93 |
QFile inifile(QString::fromLatin1("%1/mumble.ini").arg(a.applicationDirPath())); |
75 |
QFile inifile(QString::fromLatin1("%1/mumble.ini").arg(a.applicationDirPath())); |
94 |
if (inifile.exists() && inifile.permissions().testFlag(QFile::WriteUser)) |
76 |
if (inifile.exists() && inifile.permissions().testFlag(QFile::WriteUser)) |
95 |
g.qs = new QSettings(inifile.fileName(), QSettings::IniFormat); |
77 |
g.qs = new QSettings(inifile.fileName(), QSettings::IniFormat); |
Lines 166-177
Link Here
|
166 |
g.mw=new MainWindow(NULL); |
148 |
g.mw=new MainWindow(NULL); |
167 |
g.mw->show(); |
149 |
g.mw->show(); |
168 |
|
150 |
|
169 |
#ifndef Q_OS_MAC |
|
|
170 |
new MumbleDBus(g.mw); |
171 |
QDBusConnection::sessionBus().registerObject("/", g.mw); |
172 |
QDBusConnection::sessionBus().registerService("net.sourceforge.mumble.mumble"); |
173 |
#endif |
174 |
|
175 |
g.l->log(Log::Information, MainWindow::tr("Welcome to Mumble.")); |
151 |
g.l->log(Log::Information, MainWindow::tr("Welcome to Mumble.")); |
176 |
|
152 |
|
177 |
// Plugins |
153 |
// Plugins |