mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
KUniqueApplication::newInstance() already takes care about DBus (thanks to David for the hint).
svn path=/trunk/KDE/kdebase/apps/; revision=645447
This commit is contained in:
parent
75f4f45c98
commit
e74cc60fef
20
src/main.cpp
20
src/main.cpp
|
@ -19,13 +19,10 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "dolphinapplication.h"
|
#include "dolphinapplication.h"
|
||||||
#include "dolphinmainwindow.h"
|
|
||||||
#include <kaboutdata.h>
|
#include <kaboutdata.h>
|
||||||
#include <kcmdlineargs.h>
|
#include <kcmdlineargs.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <krun.h>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
#include <QDBusReply>
|
|
||||||
|
|
||||||
static KCmdLineOptions options[] =
|
static KCmdLineOptions options[] =
|
||||||
{
|
{
|
||||||
|
@ -56,10 +53,11 @@ int main(int argc, char **argv)
|
||||||
KCmdLineArgs::init(argc, argv, &about);
|
KCmdLineArgs::init(argc, argv, &about);
|
||||||
KCmdLineArgs::addCmdLineOptions(options);
|
KCmdLineArgs::addCmdLineOptions(options);
|
||||||
|
|
||||||
DolphinApplication* app = 0;
|
if (!DolphinApplication::start()) {
|
||||||
if (DolphinApplication::start()) {
|
return 0;
|
||||||
app = new DolphinApplication();
|
}
|
||||||
|
|
||||||
|
DolphinApplication app;
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#warning TODO, SessionManagement
|
#warning TODO, SessionManagement
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,11 +70,5 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
return app->exec();
|
return app.exec();
|
||||||
}
|
|
||||||
|
|
||||||
static QDBusInterface dbusIface("org.kde.dolphin", "/dolphin/Application", "",
|
|
||||||
QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session_bus"));
|
|
||||||
dbusIface.call("openWindow");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue