KDEUI
kapplication.cpp
Go to the documentation of this file.
298 if( w->isTopLevel() && !( w->windowFlags() & Qt::X11BypassWindowManagerHint ) && w->windowType() != Qt::Popup && !event->spontaneous())
329 #error QT_NO_SESSIONMANAGER was set, this will not compile. Reconfigure Qt with Session management support.
334 return QString(QLatin1String("session/%1_%2_%3")).arg(q->applicationName()).arg(q->sessionId()).arg(sessKey);
345 : QApplication((KApplicationPrivate::preqapplicationhack(),KCmdLineArgs::qtArgc()), KCmdLineArgs::qtArgv(), GUIenabled),
357 : QApplication((KApplicationPrivate::preqapplicationhack(),dpy), KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv(), visual, colormap),
367 KApplication::KApplication(Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, const KComponentData &cData)
368 : QApplication((KApplicationPrivate::preqapplicationhack(),dpy), KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv(), visual, colormap),
380 : QApplication((KApplicationPrivate::preqapplicationhack(),KCmdLineArgs::qtArgc()), KCmdLineArgs::qtArgv(), GUIenabled),
391 KApplication::KApplication(Display *display, int& argc, char** argv, const QByteArray& rAppName,
405 // this function is called in KApplication ctors while evaluating arguments to QApplication ctor,
515 if (!QDBusConnection::sessionBus().isConnected() || !(bus = QDBusConnection::sessionBus().interface())) {
523 if ( bus && !s_kuniqueapplication_startCalled ) // don't register again if KUniqueApplication did so already
538 kError(240) << "Couldn't register name '" << serviceName << "' with DBUS - another process owns it already!" << endl;
709 if( dpy != NULL && XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "KDE_SESSION_VERSION", False ),
720 if( getenv( "KDE_SESSION_VERSION" ) != NULL && atoi( getenv( "KDE_SESSION_VERSION" )) == KDE_VERSION_MAJOR )
724 QString wrapper = KStandardDirs::findExe( "kde" NUM_TO_STRING( KDE_VERSION_MAJOR ) ); // "kde4", etc.
858 // Always set the app name, can be usefuls for apps that call setEmergencySaveFunction or enable AutoRestart
867 (void) q->desktop(); // trigger desktop creation, we need PropertyNotify events for the root window
944 Window w = XCreateSimpleWindow( QX11Info::display(), QX11Info::appRootWindow(), 0, 0, 1, 1, 0, 0, 0 );
1131 void KApplicationPrivate::_k_slot_KToolInvocation_hook(QStringList& envs,QByteArray& startup_id)
static void resetStartupEnv()
Unsets the startup notification environment variable.
Definition: kstartupinfo.cpp:1101
QString caption()
QString i18n(const char *text)
bool kde_kdebug_enable_dbus_interface
Controls and provides information to all KDE applications.
Definition: kapplication.h:82
static QString tempSaveName(const QString &pFilename)
Get a file name in order to make a temporary copy of your document.
Definition: kapplication.cpp:985
QString & append(QChar ch)
bool isHidden() const
void cancel()
#define NUM_TO_STRING(num)
static void installSigpipeHandler()
Installs a handler for the SIGPIPE signal.
Definition: kapplication.cpp:243
static int kde_x_errhandler(Display *dpy, XErrorEvent *err)
Definition: kapplication.cpp:129
QByteArray toLower() const
virtual bool saveState(QSessionManager &sm)
See QApplication::saveState() for documentation.
Definition: ksessionmanager.cpp:35
static QString checkRecoverFile(const QString &pFilename, bool &bRecover)
Check whether an auto-save file exists for the document you want to open.
Definition: kapplication.cpp:1017
static void setReverseSynchronizing(bool enable)
Configures KClipboardSynchronizer to copy the Clipboard buffer to the Selection buffer whenever the C...
Definition: kclipboard.cpp:171
static void handleAutoAppStartedSending()
Definition: kstartupinfo.cpp:637
int timeout
Qt::HANDLE appRootWindow(int screen)
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
void setStartupId(const QByteArray &startup_id)
Definition: kapplication.cpp:1080
QString & prepend(QChar ch)
Display * display()
QStringList restartCommand() const
static KToolInvocation * self()
bool isNull() const
KStandardDirs * dirs()
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
bool contains(const QString &str, Qt::CaseSensitivity cs) const
Q_SCRIPTABLE void updateUserTimestamp(int time=0)
Updates the last user action timestamp to the given time, or to the current time, if 0 is given...
Definition: kapplication.cpp:939
bool isEmpty() const
void setApplicationName(const QString &name)
Sets the application name which should be passed to DrKonqi, our nice crash display application...
Definition: kcrash.cpp:187
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KApplication(bool GUIenabled=true)
This constructor is the one you should use.
Definition: kapplication.cpp:344
T * data() const
bool isTopLevel() const
Class representing an identification of application startup notification.
Definition: kstartupinfo.h:368
QDBusConnection sessionBus()
static QList< KSessionManager * > & sessionClients()
Definition: ksessionmanager.cpp:45
void setOrganizationDomain(const QString &orgDomain)
void disableSessionManagement()
Disables session management for this application.
Definition: kapplication.cpp:625
virtual bool x11Event(XEvent *event)
void iceIOErrorHandler(_IceConn *conn)
Definition: kapplication.cpp:445
bool exists() const
static KGlobalSettings * self()
Return the KGlobalSettings singleton.
Definition: kglobalsettings.cpp:188
void enableSessionManagement()
Enables session management for this application, formerly disabled by calling disableSessionManagemen...
Definition: kapplication.cpp:629
void setAppTime(unsigned long time)
QString homePath()
static KApplication * kApplication()
Returns the current application object.
Definition: kapplication.cpp:603
QDBusMessage call(const QString &method, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8)
bool isSet(const QByteArray &option) const
KSharedConfigPtr config()
static void setWindowStartupId(WId window, const QByteArray &id)
Sets the startup notification window property on the given window.
Definition: kstartupinfo.cpp:874
unsigned long appTime()
void setDesktopSettingsAware(bool on)
void exit(int returnCode)
static int timestampCompare(unsigned long time1, unsigned long time2)
Compares two X timestamps, taking into account wrapping and 64bit architectures.
Definition: netwm.cpp:4735
QStringList keys()
void kDebugCleanup()
QString number(int n, int base)
Provides highlevel access to session management on a per-object base.
Definition: ksessionmanager.h:45
bool exists() const
void append(const T &value)
bool isAccepted() const
Q_SCRIPTABLE void reparseConfiguration()
Definition: kapplication.cpp:615
void setMessageHandler(KMessageHandler *handler)
static void checkRestartVersion(QSessionManager &sm)
Definition: kapplication.cpp:702
void setApplicationPath(const QString &path)
Sets the application path which should be passed to DrKonqi, our nice crash display application...
Definition: kcrash.cpp:161
QClipboard * clipboard()
QByteArray startupId() const
Returns the app startup notification identifier for this running application.
Definition: kapplication.cpp:1075
bool inherits(const char *className) const
static QString appName()
void saveYourself()
Session management asks you to save the state of your application.
unsigned long appUserTime()
bool isEmpty() const
QString absoluteFilePath() const
bool isEmpty() const
bool sendEvent(QObject *receiver, QEvent *event)
void commitData(QSessionManager &sm)
Reimplemented for internal purposes, mainly the highlevel handling of session management with KSessio...
Definition: kapplication.cpp:652
void setTopWidget(QWidget *topWidget)
Sets the top widget of the application.
Definition: kapplication.cpp:1059
void setRestartHint(RestartHint hint)
WId winId() const
typedef HANDLE
bool allowsInteraction()
void quit()
static void setSynchronizing(bool sync)
Configures KClipboardSynchronizer to synchronize the Selection to Clipboard whenever it changes...
Definition: kclipboard.cpp:160
void KApplication_init_windows()
MS Windows-related actions for KApplication startup.
Definition: kapplication_win.cpp:43
void setRestartCommand(const QStringList &command)
virtual bool commitData(QSessionManager &sm)
See QApplication::commitData() for documentation.
Definition: ksessionmanager.cpp:40
QString toLower() const
void saveState(QSessionManager &sm)
Reimplemented for internal purposes, mainly the highlevel handling of session management with KSessio...
Definition: kapplication.cpp:735
Qt::WindowType windowType() const
void removeX11EventFilter(const QWidget *filter)
Removes global X11 event filter previously installed by installX11EventFilter().
Definition: kapplication.cpp:269
bool contains(QChar ch, Qt::CaseSensitivity cs) const
bool isRelativePath(const QString &path)
KLocale * locale()
void updateRemoteUserTimestamp(const QString &service, int time=0)
Updates the last user action timestamp in the application registered to DBUS with id service to the g...
Definition: kapplication.cpp:971
QString & replace(int position, int n, QChar after)
bool sessionSaving() const
Returns true if the application is currently saving its session data (most probably before KDE logout...
Definition: kapplication.cpp:814
windowFlags
static KStartupInfoId currentStartupIdEnv()
Returns the current startup notification identification for the current startup notification environm...
Definition: kstartupinfo.cpp:1090
static QByteArray createNewStartupId()
Creates and returns new startup id.
Definition: kstartupinfo.cpp:1012
QString absolutePath() const
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
bool s_kuniqueapplication_startCalled
Definition: kuniqueapplication.cpp:75
bool mkdir(const QString &dirName) const
unsigned int version()
void reparseConfiguration()
void setSynchronizeClipboard(bool synchronize)
Sets how the primary and clipboard selections are synchronized in an X11 environment.
Definition: kapplication.cpp:1151
void setWindowTitle(const QString &)
static QString findExe(const QString &appname, const QString &pathstr=QString(), SearchOptions options=NoSearchOptions)
static KClipboardSynchronizer * self()
Returns the KClipboardSynchronizer singleton object.
Definition: kclipboard.cpp:71
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
char * data()
#define KDE_VERSION_MAJOR
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void setDrKonqiEnabled(bool enabled)
Enables or disables launching DrKonqi from the crash handler.
Definition: kcrash.cpp:204
bool isSystemTrayAvailable()
bool authorize(const QString &genericAction)
QString getOption(const QByteArray &option) const
void prepend(const T &value)
KConfig * sessionConfig()
Returns the application session config object.
Definition: kapplication.cpp:608
static void initiateIfNeeded(QObject *parent)
Creates a KCheckAccelerators instance for the given object if this feature is enabled in kdeglobals...
Definition: kcheckaccelerators.cpp:56
QDBusReply< QDBusConnectionInterface::RegisterServiceReply > registerService(const QString &serviceName, ServiceQueueOptions qoption, ServiceReplacementOptions roption)
void activate()
Makes all globally applicable settings take effect and starts listening for changes to these settings...
Definition: kglobalsettings.cpp:204
This is a convience KMessageHandler that use KMessageBox.
Definition: kmessageboxmessagehandler.h:34
unsigned long userTimestamp() const
Returns the last user action timestamp or 0 if no user activity has taken place yet.
Definition: kapplication.cpp:962
void setDiscardCommand(const QStringList &list)
bool isWidgetType() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString applicationDirPath()
virtual bool notify(QObject *receiver, QEvent *e)
void mac_initialize_dbus()
void initId(const QByteArray &id="")
Initializes this object with the given identification ( which may be also "0" for no notification )...
Definition: kstartupinfo.cpp:1058
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
static QDebug kFatal(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void installX11EventFilter(QWidget *filter)
Installs widget filter as global X11 event filter.
Definition: kapplication.cpp:254
void setAppUserTime(unsigned long time)
void destroyed(QObject *obj)
QWidgetList topLevelWidgets()
void setPath(const QString &path)
void setIcon(const QIcon &icon)
bool isConfigWritable(bool warnUser)
void setApplicationName(const QString &application)
void aboutToQuit()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:58 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:23:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.