generic: enable session management for most applications

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-09 09:34:22 +03:00
parent 865ddb65a8
commit c3f3bff65e
6 changed files with 6 additions and 0 deletions

View file

@ -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()) {

View file

@ -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();

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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())