KDEUI
kuniqueapplication.cpp
Go to the documentation of this file.
102 kError() << "KUniqueApplication: Cannot find the D-Bus session server: " << sessionBus.lastError().message() << endl;
129 const QStringList parts = KCmdLineArgs::aboutData()->organizationDomain().split(QLatin1Char('.'), QString::SkipEmptyParts);
156 bool registered = dbusService->registerService(appName) == QDBusConnectionInterface::ServiceRegistered;
291 QDBusMessage msg = QDBusMessage::createMethodCall(appName, "/MainApplication", "org.kde.KUniqueApplication",
299 kError() << "Communication problem with " << KCmdLineArgs::aboutData()->appName() << ", it probably crashed." << endl
431 const int index = parent()->metaObject()->indexOfMethod("loadCommandLineOptionsForNewInstance");
Controls and provides information to all KDE applications.
Definition: kapplication.h:82
static void setNewStartupId(QWidget *window, const QByteArray &startup_id)
Use this function if the application got a request with startup notification from outside (for exampl...
Definition: kstartupinfo.cpp:643
static void addCmdLineOptions(const KCmdLineOptions &options, const KLocalizedString &name=KLocalizedString(), const QByteArray &id=QByteArray(), const QByteArray &afterId=QByteArray())
QString & append(QChar ch)
QString organizationDomain() const
QString appName() const
KCmdLineOptions & add(const QByteArray &name, const KLocalizedString &description=KLocalizedString(), const QByteArray &defaultValue=QByteArray())
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode, int timeout) const
static const KAboutData * aboutData()
static void handleAutoAppStartedSending()
Definition: kstartupinfo.cpp:637
KLocalizedString ki18n(const char *msg)
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
QString & prepend(QChar ch)
QDBusConnectionInterface * interface() const
QString name() const
bool isEmpty() const
QString message() const
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isValid() const
Class representing an identification of application startup notification.
Definition: kstartupinfo.h:368
QDBusConnection sessionBus()
static void setHandleAutoStarted()
Definition: kuniqueapplication.cpp:418
friend class KUniqueApplicationAdaptor
Definition: kuniqueapplication.h:223
static void forceActiveWindow(WId win, long time=0)
Sets window win to be the active window.
Definition: kwindowsystem_mac.cpp:366
QDBusReply< bool > isServiceRegistered(const QString &serviceName) const
void mac_fork_and_reexec_self()
void KApplication_activateWindowForProcess(const QString &executableName)
Definition: kapplication_win.cpp:242
bool isSet(const QByteArray &option) const
static void loadAppArgs(QDataStream &)
void exit(int returnCode)
QString number(int n, int base)
bool restoringSession()
Returns whether newInstance() is being called while session restoration is in progress.
Definition: kuniqueapplication.cpp:385
static QDBusConnectionInterface * tryToInitDBusConnection()
Definition: kuniqueapplication.cpp:95
Class representing data about an application startup notification.
Definition: kstartupinfo.h:439
QByteArray startupId() const
Returns the app startup notification identifier for this running application.
Definition: kapplication.cpp:1075
bool isEmpty() const
virtual int newInstance()
Creates a new "instance" of the application.
Definition: kuniqueapplication.cpp:390
WId winId() const
T & first()
typedef HANDLE
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
static void addCmdLineOptions()
Adds command line options specific for KUniqueApplication.
Definition: kuniqueapplication.cpp:85
static void saveAppArgs(QDataStream &)
static KStartupInfoId currentStartupIdEnv()
Returns the current startup notification identification for the current startup notification environm...
Definition: kstartupinfo.cpp:1090
bool isConnected() const
bool isSessionRestored() const
Create a new instance of the application in a new process and do not attempt to re-use an existing pr...
Definition: kuniqueapplication.h:119
bool s_kuniqueapplication_startCalled
Definition: kuniqueapplication.cpp:75
static bool sendChangeX(Display *dpy, const KStartupInfoId &id, const KStartupInfoData &data)
Like sendChange , uses dpy instead of qt_x11display() for sending the info.
Definition: kstartupinfo.cpp:510
KUniqueApplication(bool GUIenabled=true, bool configUnique=false)
Constructor.
Definition: kuniqueapplication.cpp:312
QDBusReply< QDBusConnectionInterface::RegisterServiceReply > registerService(const QString &serviceName, ServiceQueueOptions qoption, ServiceReplacementOptions roption)
void show()
QDBusError lastError() const
void mac_initialize_dbus()
const QDBusError & error()
void initId(const QByteArray &id="")
Initializes this object with the given identification ( which may be also "0" for no notification )...
Definition: kstartupinfo.cpp:1058
T readEntry(const QString &key, const T &aDefault) const
void addPid(pid_t pid)
Adds a PID to the list of processes that belong to the startup notification.
Definition: kstartupinfo.cpp:1446
QDBusMessage createMethodCall(const QString &service, const QString &path, const QString &interface, const QString &method)
KAction * close(const QObject *recvr, const char *slot, QObject *parent)
Close the current document.
Definition: kstandardaction.cpp:269
static QList< KMainWindow * > memberList()
List of members of KMainWindow class.
Definition: kmainwindow.cpp:1218
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.