mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +00:00
generic: enable session management for most applications
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
865ddb65a8
commit
c3f3bff65e
6 changed files with 6 additions and 0 deletions
|
@ -115,6 +115,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
KApplication application;
|
KApplication application;
|
||||||
application.setQuitOnLastWindowClosed(false);
|
application.setQuitOnLastWindowClosed(false);
|
||||||
|
application.enableSessionManagement();
|
||||||
|
|
||||||
//session restoring
|
//session restoring
|
||||||
if (application.isSessionRestored()) {
|
if (application.isSessionRestored()) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ int main(int argc, char *argv[])
|
||||||
KCmdLineArgs::addCmdLineOptions(options);
|
KCmdLineArgs::addCmdLineOptions(options);
|
||||||
|
|
||||||
KApplication app;
|
KApplication app;
|
||||||
|
app.enableSessionManagement();
|
||||||
|
|
||||||
if (!app.isSessionRestored()) {
|
if (!app.isSessionRestored()) {
|
||||||
MainWindow *mw = new MainWindow();
|
MainWindow *mw = new MainWindow();
|
||||||
|
|
|
@ -126,6 +126,7 @@ int main(int argc, char *argv[])
|
||||||
KCmdLineArgs::addCmdLineOptions(options);
|
KCmdLineArgs::addCmdLineOptions(options);
|
||||||
|
|
||||||
KApplication app;
|
KApplication app;
|
||||||
|
app.enableSessionManagement();
|
||||||
|
|
||||||
// startHelper must live for the whole life of the application
|
// startHelper must live for the whole life of the application
|
||||||
StartHelper startHelper;
|
StartHelper startHelper;
|
||||||
|
|
|
@ -34,6 +34,7 @@ int main(int argc, char** argv)
|
||||||
aboutData.setProgramIconName(QLatin1String("applications-engineering"));
|
aboutData.setProgramIconName(QLatin1String("applications-engineering"));
|
||||||
KCmdLineArgs::init(argc, argv, &aboutData);
|
KCmdLineArgs::init(argc, argv, &aboutData);
|
||||||
KUniqueApplication *kemuapp = new KUniqueApplication();
|
KUniqueApplication *kemuapp = new KUniqueApplication();
|
||||||
|
kemuapp->enableSessionManagement();
|
||||||
KEmuMainWindow *kemuwindow = new KEmuMainWindow();
|
KEmuMainWindow *kemuwindow = new KEmuMainWindow();
|
||||||
kemuwindow->show();
|
kemuwindow->show();
|
||||||
return kemuapp->exec();
|
return kemuapp->exec();
|
||||||
|
|
|
@ -52,6 +52,7 @@ int main(int argc, char **argv)
|
||||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||||
|
|
||||||
KApplication app;
|
KApplication app;
|
||||||
|
app.enableSessionManagement();
|
||||||
|
|
||||||
// Create top level window
|
// Create top level window
|
||||||
KSnapshot *toplevel;
|
KSnapshot *toplevel;
|
||||||
|
|
|
@ -45,6 +45,7 @@ int main(int argc, char** argv)
|
||||||
options.add("+[URL]", ki18n("Document to open. Specify '-' to read from stdin."));
|
options.add("+[URL]", ki18n("Document to open. Specify '-' to read from stdin."));
|
||||||
KCmdLineArgs::addCmdLineOptions( options );
|
KCmdLineArgs::addCmdLineOptions( options );
|
||||||
KApplication app;
|
KApplication app;
|
||||||
|
app.enableSessionManagement();
|
||||||
|
|
||||||
// see if we are starting with session management
|
// see if we are starting with session management
|
||||||
if (app.isSessionRestored())
|
if (app.isSessionRestored())
|
||||||
|
|
Loading…
Add table
Reference in a new issue