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
#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
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
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
void setStartupId(const QByteArray &startup_id)
Definition: kapplication.cpp:1080
static KToolInvocation * self()
KStandardDirs * dirs()
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
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
Class representing an identification of application startup notification.
Definition: kstartupinfo.h:368
static QList< KSessionManager * > & sessionClients()
Definition: ksessionmanager.cpp:45
void disableSessionManagement()
Disables session management for this application.
Definition: kapplication.cpp:625
void iceIOErrorHandler(_IceConn *conn)
Definition: kapplication.cpp:445
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
static KApplication * kApplication()
Returns the current application object.
Definition: kapplication.cpp:603
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
static int timestampCompare(unsigned long time1, unsigned long time2)
Compares two X timestamps, taking into account wrapping and 64bit architectures.
Definition: netwm.cpp:4735
void kDebugCleanup()
Provides highlevel access to session management on a per-object base.
Definition: ksessionmanager.h:45
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
QByteArray startupId() const
Returns the app startup notification identifier for this running application.
Definition: kapplication.cpp:1075
static QString appName()
void saveYourself()
Session management asks you to save the state of your application.
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
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
virtual bool commitData(QSessionManager &sm)
See QApplication::commitData() for documentation.
Definition: ksessionmanager.cpp:40
void saveState(QSessionManager &sm)
Reimplemented for internal purposes, mainly the highlevel handling of session management with KSessio...
Definition: kapplication.cpp:735
void removeX11EventFilter(const QWidget *filter)
Removes global X11 event filter previously installed by installX11EventFilter().
Definition: kapplication.cpp:269
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
bool sessionSaving() const
Returns true if the application is currently saving its session data (most probably before KDE logout...
Definition: kapplication.cpp:814
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
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
bool s_kuniqueapplication_startCalled
Definition: kuniqueapplication.cpp:75
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
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
#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 authorize(const QString &genericAction)
QString getOption(const QByteArray &option) const
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
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
KAction * quit(const QObject *recvr, const char *slot, QObject *parent)
Quit the program.
Definition: kstandardaction.cpp:279
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 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
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
bool isConfigWritable(bool warnUser)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.