mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: move KToolInvocation to kdeui
to get rid of the KApplication signal which is a hack really Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
32a3def809
commit
899f789b07
11 changed files with 40 additions and 57 deletions
|
@ -73,7 +73,6 @@ set(kdecore_LIB_SRCS
|
|||
kernel/kglobal.cpp
|
||||
kernel/kcomponentdata.cpp
|
||||
kernel/kstandarddirs.cpp
|
||||
kernel/ktoolinvocation.cpp
|
||||
services/kmimetypefactory.cpp
|
||||
services/kmimemagicrule.cpp
|
||||
services/kmimetypetrader.cpp
|
||||
|
@ -121,7 +120,6 @@ set(kdecore_LIB_SRCS
|
|||
util/kunitconversion.cpp
|
||||
util/qtest_kde.cpp
|
||||
|
||||
kernel/ktoolinvocation_x11.cpp
|
||||
kernel/kstandarddirs_unix.cpp
|
||||
io/klockfile_unix.cpp
|
||||
util/kshell_unix.cpp
|
||||
|
@ -222,7 +220,6 @@ install(
|
|||
kernel/kglobal.h
|
||||
kernel/kcomponentdata.h
|
||||
kernel/kstandarddirs.h
|
||||
kernel/ktoolinvocation.h
|
||||
services/kmimetype.h
|
||||
services/kmimetypetrader.h
|
||||
services/kservice.h
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <kstandarddirs.h>
|
||||
#include <kurl.h>
|
||||
#include <kcomponentdata.h>
|
||||
#include <ktoolinvocation.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kshell.h>
|
||||
#include <kdebug.h>
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "ksycoca_p.h"
|
||||
#include "ksycocatype.h"
|
||||
#include "ksycocafactory.h"
|
||||
#include "ktoolinvocation.h"
|
||||
#include "kglobal.h"
|
||||
#include "kde_file.h"
|
||||
#include "kconfiggroup.h"
|
||||
|
|
|
@ -153,6 +153,8 @@ set(kdeui_LIB_SRCS
|
|||
kernel/kstartupinfo.cpp
|
||||
kernel/kglobalsettings.cpp
|
||||
kernel/ksystemeventfilter.cpp
|
||||
kernel/ktoolinvocation.cpp
|
||||
kernel/ktoolinvocation_x11.cpp
|
||||
notifications/knotification.cpp
|
||||
notifications/knotificationmanager.cpp
|
||||
notifications/knotificationrestrictions.cpp
|
||||
|
@ -304,6 +306,8 @@ set_source_files_properties(
|
|||
${CMAKE_SOURCE_DIR}/kdeui/kernel/kapplication.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/kernel/kglobalsettings.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/kernel/kuniqueapplication.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/kernel/ktoolinvocation.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/kernel/ktoolinvocation_x11.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/notifications/knotificationrestrictions.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/util/kcrash.cpp
|
||||
${CMAKE_SOURCE_DIR}/kdeui/util/kcursor.cpp
|
||||
|
@ -464,6 +468,7 @@ install(
|
|||
kernel/kstartupinfo.h
|
||||
kernel/kglobalsettings.h
|
||||
kernel/ksystemeventfilter.h
|
||||
kernel/ktoolinvocation.h
|
||||
notifications/kstatusnotifieritem.h
|
||||
notifications/ksystemtrayicon.h
|
||||
notifications/knotification.h
|
||||
|
|
|
@ -16,16 +16,14 @@
|
|||
*/
|
||||
|
||||
#include "kaboutapplicationpersonlistdelegate_p.h"
|
||||
|
||||
#include "kaboutapplicationpersonmodel_p.h"
|
||||
#include "kaboutapplicationpersonlistview_p.h"
|
||||
#include "kdeui/widgets/ktoolbar.h"
|
||||
#include "kdeui/actions/kaction.h"
|
||||
#include "kdeui/icons/kicon.h"
|
||||
|
||||
#include <kdecore/io/kdebug.h>
|
||||
#include <kdecore/kernel/kstandarddirs.h>
|
||||
#include <kdecore/kernel/ktoolinvocation.h>
|
||||
#include "ktoolbar.h"
|
||||
#include "kaction.h"
|
||||
#include "kicon.h"
|
||||
#include "kdebug.h"
|
||||
#include "kstandarddirs.h"
|
||||
#include "ktoolinvocation.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#include <QtGui/QSessionManager>
|
||||
#include <QtGui/QStyleFactory>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/QX11Info>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QtDBus/QDBusConnectionInterface>
|
||||
|
||||
|
@ -49,7 +50,6 @@
|
|||
#include "ksessionmanager.h"
|
||||
#include "kstandarddirs.h"
|
||||
#include "kstandardshortcut.h"
|
||||
#include "ktoolinvocation.h"
|
||||
#include "kurl.h"
|
||||
#include "kmessage.h"
|
||||
#include "kmessageboxmessagehandler.h"
|
||||
|
@ -73,8 +73,6 @@
|
|||
# include <X11/Xatom.h>
|
||||
# include <X11/SM/SMlib.h>
|
||||
# include <fixx11h.h>
|
||||
|
||||
#include <QtGui/qx11info_x11.h>
|
||||
#endif
|
||||
|
||||
KApplication* KApplication::KApp = 0L;
|
||||
|
@ -168,7 +166,6 @@ public:
|
|||
|
||||
void _k_x11FilterDestroyed();
|
||||
void _k_checkAppStartedSlot();
|
||||
void _k_KToolInvocation_hook(QStringList&, QByteArray&);
|
||||
void _k_disableAutorestartSlot();
|
||||
|
||||
QString sessionConfigName() const;
|
||||
|
@ -470,15 +467,6 @@ void KApplicationPrivate::init()
|
|||
KMessage::setMessageHandler( new KMessageBoxMessageHandler(0) );
|
||||
|
||||
KCheckAccelerators::initiateIfNeeded(q);
|
||||
|
||||
// HACK: KLauncher creates KApplication instance and KToolInvocation creates KLauncher instance
|
||||
// (i.e recursion)
|
||||
if (QCoreApplication::applicationName() != QLatin1String("klauncher")) {
|
||||
q->connect(
|
||||
KToolInvocation::self(), SIGNAL(kapplication_hook(QStringList&,QByteArray&)),
|
||||
q, SLOT(_k_KToolInvocation_hook(QStringList&,QByteArray&))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// too late to restart if the application is about to quit (e.g. if QApplication::quit() was
|
||||
|
@ -921,27 +909,6 @@ void KApplicationPrivate::read_app_startup_id()
|
|||
#endif
|
||||
}
|
||||
|
||||
// Hook called by KToolInvocation
|
||||
void KApplicationPrivate::_k_KToolInvocation_hook(QStringList& envs,QByteArray& startup_id)
|
||||
{
|
||||
#ifdef Q_WS_X11
|
||||
if (QX11Info::display()) {
|
||||
QByteArray dpystring(XDisplayString(QX11Info::display()));
|
||||
envs << QLatin1String("DISPLAY=") + dpystring;
|
||||
} else {
|
||||
const QByteArray dpystring( qgetenv( "DISPLAY" ));
|
||||
if(!dpystring.isEmpty())
|
||||
envs << QLatin1String("DISPLAY=") + dpystring;
|
||||
}
|
||||
|
||||
if(startup_id.isEmpty())
|
||||
startup_id = KStartupInfo::createNewStartupId();
|
||||
#else
|
||||
Q_UNUSED(envs);
|
||||
Q_UNUSED(startup_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
void KApplicationPrivate::_k_disableAutorestartSlot()
|
||||
{
|
||||
KCrash::setFlags(KCrash::flags() & ~KCrash::AutoRestart);
|
||||
|
|
|
@ -311,7 +311,6 @@ private:
|
|||
|
||||
Q_PRIVATE_SLOT(d, void _k_x11FilterDestroyed())
|
||||
Q_PRIVATE_SLOT(d, void _k_checkAppStartedSlot())
|
||||
Q_PRIVATE_SLOT(d, void _k_KToolInvocation_hook(QStringList&, QByteArray&))
|
||||
Q_PRIVATE_SLOT(d, void _k_disableAutorestartSlot())
|
||||
};
|
||||
|
||||
|
|
|
@ -28,12 +28,19 @@
|
|||
#include "kservice.h"
|
||||
#include "klocale.h"
|
||||
#include "kglobalsettings.h"
|
||||
#include "kstartupinfo.h"
|
||||
|
||||
#include <QtCore/QThread>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QtDBus/QDBusConnectionInterface>
|
||||
#include <QtGui/QX11Info>
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
# include <X11/Xlib.h>
|
||||
# include <fixx11h.h>
|
||||
#endif
|
||||
|
||||
#define KTOOLINVOCATION_TIMEOUT 250
|
||||
#define KTOOLINVOCATION_SLEEPTIME 50
|
||||
|
@ -109,7 +116,19 @@ int KToolInvocation::startServiceInternal(const char *_function,
|
|||
// make sure there is id, so that user timestamp exists
|
||||
QStringList envs;
|
||||
QByteArray asn = startup_id;
|
||||
emit kapplication_hook(envs, asn);
|
||||
if (QX11Info::display()) {
|
||||
const QString dpystring = QString::fromLatin1(XDisplayString(QX11Info::display()));
|
||||
envs << QLatin1String("DISPLAY=") + dpystring;
|
||||
} else {
|
||||
const QString dpystring = QString::fromLocal8Bit(qgetenv("DISPLAY"));
|
||||
if (!dpystring.isEmpty()) {
|
||||
envs << QLatin1String("DISPLAY=") + dpystring;
|
||||
}
|
||||
}
|
||||
|
||||
if (asn.isEmpty()) {
|
||||
asn = KStartupInfo::createNewStartupId();
|
||||
}
|
||||
|
||||
QDBusPendingReply<int> reply;
|
||||
if (qstrcmp(_function, "kdeinit_exec_with_workdir") == 0) {
|
|
@ -6,7 +6,7 @@ include_directories(BEFORE ${CMAKE_SOURCE_DIR}/kio)
|
|||
|
||||
add_executable(kmailservice kmailservice.cpp)
|
||||
|
||||
target_link_libraries(kmailservice kdecore)
|
||||
target_link_libraries(kmailservice kdecore kdeui)
|
||||
|
||||
install(
|
||||
TARGETS kmailservice
|
||||
|
|
Loading…
Add table
Reference in a new issue