Require KDSingleApplication 1.1.0

This commit is contained in:
Jonas Kvinge
2023-12-26 20:47:11 +01:00
parent 22169bda0d
commit a35fa5b158
5 changed files with 9 additions and 17 deletions

View File

@@ -156,11 +156,7 @@ int main(int argc, char *argv[]) {
// Only start a core application now, so we can check if there's another instance without requiring an X server.
// This MUST be done before parsing the commandline options so QTextCodec gets the right system locale for filenames.
QCoreApplication core_app(argc, argv);
#ifdef HAVE_KDSINGLEAPPLICATION_OPTIONS
KDSingleApplication single_app(QCoreApplication::applicationName(), KDSingleApplication::Option::IncludeUsernameInSocketName);
#else
KDSingleApplication single_app(QCoreApplication::applicationName());
#endif
// Parse commandline options - need to do this before starting the full QApplication, so it works without an X server
if (!options.Parse()) return 1;
logging::SetLevels(options.log_levels());
@@ -197,11 +193,7 @@ int main(int argc, char *argv[]) {
QGuiApplication::setQuitOnLastWindowClosed(false);
QApplication a(argc, argv);
#ifdef HAVE_KDSINGLEAPPLICATION_OPTIONS
KDSingleApplication single_app(QCoreApplication::applicationName(), KDSingleApplication::Option::IncludeUsernameInSocketName);
#else
KDSingleApplication single_app(QCoreApplication::applicationName());
#endif
if (!single_app.isPrimaryInstance()) {
if (options.is_empty()) {
qLog(Info) << "Strawberry is already running - activating existing window (2)";