class KUniqueApplication


Module kdeui
Namespace
Class KUniqueApplication
Inherits KApplication
Maintains only a single instance of a running application at a time. Please note that this supports only one instance per KDE session. If your application can only be opened once per user or once per host, you need to ensure this independently of KUniqueApplication.

If another instance is started, it will determine (via DBUS) whether it is the first instance or a second instance. If it is a second instance, it will forward on the information to the first instance and then quit.

The .desktop file for the application should state X-DBUS-StartupType=Unique, see ktoolinvocation.h

If your application is used to open files, it should also support the --tempfile option (see KCmdLineArgs.addTempFileOption()), to delete tempfiles after use. Add X-KDE-HasTempFileOption=true to the .desktop file to indicate this.

See also KApplication Author Preston Brown



methods