KontactInterface::UniqueAppWatcher Class

class KontactInterface::UniqueAppWatcher
Header: #include <KontactInterface/UniqueAppHandler>
CMake: find_package(KPim6KontactInterface REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::KontactInterface)
Inherits: QObject

Public Functions

UniqueAppWatcher(KontactInterface::UniqueAppHandlerFactoryBase *factory, KontactInterface::Plugin *plugin)
bool isRunningStandalone() const

Private Slots

void slotApplicationRemoved(const QString &name, const QString &oldOwner, const QString &newOwner)

Detailed Description

If the standalone application is running by itself, we need to watch for when the user closes it, and activate the uniqueapphandler then. This prevents, on purpose, that the standalone app can be restarted. Kontact takes over from there.

Member Function Documentation

UniqueAppWatcher::UniqueAppWatcher(KontactInterface::UniqueAppHandlerFactoryBase *factory, KontactInterface::Plugin *plugin)

Create an instance of UniqueAppWatcher, which does everything necessary for the "unique application" behavior: create the UniqueAppHandler as soon as possible, i.e. either right now or when the standalone app is closed.

factory templatized factory to create the handler. Example: ... Note that the watcher takes ownership of the factory. plugin is the plugin application

bool UniqueAppWatcher::isRunningStandalone() const

Returns true if the standalone application is running.

[private slot] void UniqueAppWatcher::slotApplicationRemoved(const QString &name, const QString &oldOwner, const QString &newOwner)