|
0 |
From: Liu Zhe <cruise.pas@gmail.com>
|
|
1 |
Date: Tue, 10 Mar 2015 11:58:51 +0000
|
|
2 |
Subject: Register with dbus to wake up KRun, and unregister then
|
|
3 |
X-Git-Tag: v15.03.90
|
|
4 |
X-Git-Url: http://quickgit.kde.org/?p=kate.git&a=commitdiff&h=5207e49a84145e21060f3b5beff302a437cfeccd
|
|
5 |
---
|
|
6 |
Register with dbus to wake up KRun, and unregister then
|
|
7 |
|
|
8 |
This fixes the "KDEInit could not launch Kate" error
|
|
9 |
when opening second file with Kate
|
|
10 |
|
|
11 |
REVIEW: 122498
|
|
12 |
BUG: 343673
|
|
13 |
BUG: 339094
|
|
14 |
---
|
|
15 |
|
|
16 |
|
|
17 |
--- a/kate/src/kateapp.cpp
|
|
18 |
+++ b/kate/src/kateapp.cpp
|
|
19 |
@@ -151,10 +151,8 @@
|
|
20 |
} else if (!m_args.isSet(QStringLiteral("stdin")) && (m_args.positionalArguments().count() == 0)) { // only start session if no files specified
|
|
21 |
// let the user choose session if possible
|
|
22 |
if (!sessionManager()->chooseSession()) {
|
|
23 |
-#ifdef Q_WS_X11
|
|
24 |
// we will exit kate now, notify the rest of the world we are done
|
|
25 |
- KStartupInfo::appStarted(startupId());
|
|
26 |
-#endif
|
|
27 |
+ KStartupInfo::appStarted(KStartupInfo::startupId());
|
|
28 |
return false;
|
|
29 |
}
|
|
30 |
} else {
|
|
31 |
@@ -167,9 +165,7 @@
|
|
32 |
}
|
|
33 |
|
|
34 |
// notify about start
|
|
35 |
-#ifdef Q_WS_X11
|
|
36 |
- KStartupInfo::setNewStartupId(activeKateMainWindow(), startupId());
|
|
37 |
-#endif
|
|
38 |
+ KStartupInfo::setNewStartupId(activeKateMainWindow(), KStartupInfo::startupId());
|
|
39 |
|
|
40 |
QTextCodec *codec = m_args.isSet(QStringLiteral("encoding")) ? QTextCodec::codecForName(m_args.value(QStringLiteral("encoding")).toUtf8()) : 0;
|
|
41 |
bool tempfileSet = m_args.isSet(QStringLiteral("tempfile"));
|
|
42 |
|
|
43 |
--- a/kate/src/main.cpp
|
|
44 |
+++ b/kate/src/main.cpp
|
|
45 |
@@ -25,6 +25,7 @@
|
|
46 |
|
|
47 |
#include <KAboutData>
|
|
48 |
#include <KLocalizedString>
|
|
49 |
+#include <KStartupInfo>
|
|
50 |
#include <kdbusservice.h>
|
|
51 |
|
|
52 |
#include <QByteArray>
|
|
53 |
@@ -395,10 +396,12 @@
|
|
54 |
QDBusConnection::sessionBus().connect(serviceName, QStringLiteral("/MainApplication"), QStringLiteral("org.kde.Kate.Application"), QStringLiteral("documentClosed"), waiter, SLOT(documentClosed(QString)));
|
|
55 |
}
|
|
56 |
|
|
57 |
- #ifdef Q_WS_X11
|
|
58 |
+ // KToolInvocation (and KRun) will wait until we register on dbus
|
|
59 |
+ KDBusService dbusService(KDBusService::Multiple);
|
|
60 |
+ dbusService.unregister();
|
|
61 |
+
|
|
62 |
// make the world happy, we are started, kind of...
|
|
63 |
KStartupInfo::appStarted();
|
|
64 |
- #endif
|
|
65 |
|
|
66 |
// this will wait until exiting is emitted by the used instance, if wanted...
|
|
67 |
return needToBlock ? app.exec() : 0;
|
|
68 |
|