2018-02-27 18:06:05 +01:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
|
|
|
* This file was part of Clementine.
|
|
|
|
* Copyright 2010, David Sansome <me@davidsansome.com>
|
2021-03-20 21:14:47 +01:00
|
|
|
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
|
2018-02-27 18:06:05 +01:00
|
|
|
*
|
|
|
|
* Strawberry is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Strawberry is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
2018-08-09 18:39:44 +02:00
|
|
|
*
|
2018-02-27 18:06:05 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
2018-04-02 18:35:58 +02:00
|
|
|
#include "version.h"
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-07-03 17:51:52 +02:00
|
|
|
#include <QtGlobal>
|
|
|
|
|
2020-06-14 23:54:18 +02:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <ctime>
|
2023-07-21 05:55:24 +02:00
|
|
|
#include <memory>
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-06-07 02:04:26 +02:00
|
|
|
#ifdef Q_OS_UNIX
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2018-07-01 22:26:46 +02:00
|
|
|
#ifdef Q_OS_MACOS
|
2018-06-07 02:04:26 +02:00
|
|
|
# include <sys/resource.h>
|
|
|
|
# include <sys/sysctl.h>
|
2018-02-27 18:06:05 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef Q_OS_WIN32
|
2022-03-22 21:09:05 +01:00
|
|
|
# include <windows.h>
|
|
|
|
# include <iostream>
|
2018-02-27 18:06:05 +01:00
|
|
|
#endif // Q_OS_WIN32
|
|
|
|
|
2023-07-21 05:55:24 +02:00
|
|
|
#include <glib.h>
|
|
|
|
|
2018-07-03 17:51:52 +02:00
|
|
|
#include <QObject>
|
2019-01-07 01:00:58 +01:00
|
|
|
#include <QApplication>
|
2019-01-11 01:04:13 +01:00
|
|
|
#include <QCoreApplication>
|
2019-07-26 19:24:16 +02:00
|
|
|
#include <QSysInfo>
|
2018-07-03 17:51:52 +02:00
|
|
|
#include <QStandardPaths>
|
2019-02-22 20:24:38 +01:00
|
|
|
#include <QLibraryInfo>
|
2018-07-03 17:51:52 +02:00
|
|
|
#include <QFileDevice>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QNetworkProxy>
|
|
|
|
#include <QFile>
|
2019-02-22 20:24:38 +01:00
|
|
|
#include <QDir>
|
2018-07-03 17:51:52 +02:00
|
|
|
#include <QString>
|
|
|
|
#include <QSettings>
|
2018-10-20 22:13:51 +02:00
|
|
|
#include <QLoggingCategory>
|
2019-02-22 20:24:38 +01:00
|
|
|
#ifdef HAVE_TRANSLATIONS
|
|
|
|
# include <QTranslator>
|
|
|
|
#endif
|
2018-07-03 17:51:52 +02:00
|
|
|
|
2018-06-28 01:15:32 +02:00
|
|
|
#include "main.h"
|
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
#include "core/logging.h"
|
|
|
|
|
2023-07-21 05:55:24 +02:00
|
|
|
#include "core/scoped_ptr.h"
|
|
|
|
#include "core/shared_ptr.h"
|
|
|
|
|
2023-05-03 23:05:21 +02:00
|
|
|
#include <kdsingleapplication.h>
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-08-01 03:37:16 +02:00
|
|
|
#ifdef HAVE_QTSPARKLE
|
2020-08-01 03:41:48 +02:00
|
|
|
# if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
|
|
|
# include <qtsparkle-qt6/Updater>
|
|
|
|
# else
|
|
|
|
# include <qtsparkle-qt5/Updater>
|
|
|
|
# endif
|
|
|
|
#endif // HAVE_QTSPARKLE
|
2020-08-01 03:37:16 +02:00
|
|
|
|
2022-12-28 03:12:00 +01:00
|
|
|
#ifdef Q_OS_MACOS
|
|
|
|
# include "utilities/macosutils.h"
|
|
|
|
# include "core/mac_startup.h"
|
|
|
|
#endif
|
|
|
|
|
2018-03-18 18:39:30 +01:00
|
|
|
#ifdef HAVE_DBUS
|
2021-06-30 16:26:07 +02:00
|
|
|
# include "core/mpris2.h"
|
2018-03-18 18:39:30 +01:00
|
|
|
#endif
|
2019-01-01 21:48:50 +01:00
|
|
|
#include "core/metatypes.h"
|
|
|
|
#include "core/iconloader.h"
|
|
|
|
#include "core/mainwindow.h"
|
|
|
|
#include "core/commandlineoptions.h"
|
|
|
|
#include "core/application.h"
|
|
|
|
#include "core/networkproxyfactory.h"
|
2021-05-20 21:40:08 +02:00
|
|
|
#ifdef Q_OS_MACOS
|
|
|
|
# include "core/macsystemtrayicon.h"
|
|
|
|
#else
|
|
|
|
# include "core/qtsystemtrayicon.h"
|
|
|
|
#endif
|
2019-02-22 20:24:38 +01:00
|
|
|
#ifdef HAVE_TRANSLATIONS
|
2019-07-22 20:53:05 +02:00
|
|
|
# include "core/translations.h"
|
2019-02-22 20:24:38 +01:00
|
|
|
#endif
|
|
|
|
#include "settings/behavioursettingspage.h"
|
2020-11-08 02:04:24 +01:00
|
|
|
#include "settings/appearancesettingspage.h"
|
2018-04-02 18:35:58 +02:00
|
|
|
|
2020-12-23 20:25:23 +01:00
|
|
|
#if defined(Q_OS_MACOS)
|
2020-08-09 01:37:00 +02:00
|
|
|
# include "osd/osdmac.h"
|
2020-12-23 20:25:23 +01:00
|
|
|
#elif defined(HAVE_DBUS)
|
|
|
|
# include "osd/osddbus.h"
|
2020-08-09 01:37:00 +02:00
|
|
|
#else
|
|
|
|
# include "osd/osdbase.h"
|
|
|
|
#endif
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2023-07-21 05:55:24 +02:00
|
|
|
using std::make_shared;
|
|
|
|
|
2021-06-12 20:53:23 +02:00
|
|
|
int main(int argc, char *argv[]) {
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-07-01 22:26:46 +02:00
|
|
|
#ifdef Q_OS_MACOS
|
2018-02-27 18:06:05 +01:00
|
|
|
// Do Mac specific startup to get media keys working.
|
2020-10-17 17:29:09 +02:00
|
|
|
// This must go before QApplication initialization.
|
2018-02-27 18:06:05 +01:00
|
|
|
mac::MacMain();
|
|
|
|
#endif
|
|
|
|
|
2018-07-01 22:26:46 +02:00
|
|
|
#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS)
|
2018-02-27 18:06:05 +01:00
|
|
|
QCoreApplication::setApplicationName("Strawberry");
|
|
|
|
QCoreApplication::setOrganizationName("Strawberry");
|
|
|
|
#else
|
|
|
|
QCoreApplication::setApplicationName("strawberry");
|
|
|
|
QCoreApplication::setOrganizationName("strawberry");
|
|
|
|
#endif
|
|
|
|
QCoreApplication::setApplicationVersion(STRAWBERRY_VERSION_DISPLAY);
|
2019-09-24 00:06:37 +02:00
|
|
|
QCoreApplication::setOrganizationDomain("strawberrymusicplayer.org");
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-08-29 19:18:56 +02:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
2020-03-08 18:36:48 +01:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
2020-09-01 21:05:07 +02:00
|
|
|
#endif
|
2020-03-08 18:36:48 +01:00
|
|
|
|
2019-11-06 21:53:27 +01:00
|
|
|
// This makes us show up nicely in gnome-volume-control
|
2022-11-16 23:53:53 +01:00
|
|
|
g_set_application_name("Strawberry");
|
2022-11-17 00:57:10 +01:00
|
|
|
g_setenv("PULSE_PROP_application.icon_name", "strawberry", TRUE);
|
2022-11-17 00:59:22 +01:00
|
|
|
g_setenv("PULSE_PROP_media.role", "music", TRUE);
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
RegisterMetaTypes();
|
|
|
|
|
2020-10-17 17:29:09 +02:00
|
|
|
// Initialize logging. Log levels are set after the commandline options are parsed below.
|
2018-02-27 18:06:05 +01:00
|
|
|
logging::Init();
|
|
|
|
g_log_set_default_handler(reinterpret_cast<GLogFunc>(&logging::GLog), nullptr);
|
|
|
|
|
|
|
|
CommandlineOptions options(argc, argv);
|
|
|
|
{
|
2022-08-28 02:44:37 +02:00
|
|
|
// Only start a core application now, so we can check if there's another instance without requiring an X server.
|
2018-03-18 18:39:30 +01:00
|
|
|
// This MUST be done before parsing the commandline options so QTextCodec gets the right system locale for filenames.
|
2023-05-03 23:05:21 +02:00
|
|
|
QCoreApplication core_app(argc, argv);
|
|
|
|
KDSingleApplication single_app(QCoreApplication::applicationName());
|
2022-08-28 02:44:37 +02:00
|
|
|
// Parse commandline options - need to do this before starting the full QApplication, so it works without an X server
|
2018-02-27 18:06:05 +01:00
|
|
|
if (!options.Parse()) return 1;
|
|
|
|
logging::SetLevels(options.log_levels());
|
2023-05-03 23:05:21 +02:00
|
|
|
if (!single_app.isPrimaryInstance()) {
|
2019-01-13 14:46:22 +01:00
|
|
|
if (options.is_empty()) {
|
|
|
|
qLog(Info) << "Strawberry is already running - activating existing window (1)";
|
|
|
|
}
|
2023-05-03 23:05:21 +02:00
|
|
|
if (!single_app.sendMessage(options.Serialize())) {
|
2020-10-05 22:04:58 +02:00
|
|
|
qLog(Error) << "Could not send message to primary instance.";
|
|
|
|
}
|
2019-05-20 18:41:12 +02:00
|
|
|
return 0;
|
2019-01-13 14:46:22 +01:00
|
|
|
}
|
2018-02-27 18:06:05 +01:00
|
|
|
}
|
|
|
|
|
2018-07-01 22:26:46 +02:00
|
|
|
#ifdef Q_OS_MACOS
|
2018-02-27 18:06:05 +01:00
|
|
|
// Must happen after QCoreApplication::setOrganizationName().
|
2018-04-06 22:13:11 +02:00
|
|
|
setenv("XDG_CONFIG_HOME", QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation).toLocal8Bit().constData(), 1);
|
2018-02-27 18:06:05 +01:00
|
|
|
#endif
|
|
|
|
|
2018-03-18 18:39:30 +01:00
|
|
|
// Output the version, so when people attach log output to bug reports they don't have to tell us which version they're using.
|
2022-01-08 21:33:14 +01:00
|
|
|
qLog(Info) << "Strawberry" << STRAWBERRY_VERSION_DISPLAY << "Qt" << QLibraryInfo::version().toString();
|
2021-03-21 04:47:11 +01:00
|
|
|
qLog(Info) << QString("%1 %2 - (%3 %4) [%5]").arg(QSysInfo::prettyProductName(), QSysInfo::productVersion(), QSysInfo::kernelType(), QSysInfo::kernelVersion(), QSysInfo::currentCpuArchitecture());
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
// Seed the random number generators.
|
|
|
|
time_t t = time(nullptr);
|
|
|
|
srand(t);
|
|
|
|
|
2022-12-28 03:12:00 +01:00
|
|
|
#ifdef Q_OS_MACOS
|
2018-02-27 18:06:05 +01:00
|
|
|
Utilities::IncreaseFDLimit();
|
2022-12-28 03:12:00 +01:00
|
|
|
#endif
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2023-08-02 14:25:40 +02:00
|
|
|
QGuiApplication::setApplicationDisplayName("Strawberry Music Player");
|
2023-08-02 14:37:24 +02:00
|
|
|
QGuiApplication::setDesktopFileName("org.strawberrymusicplayer.strawberry");
|
2022-05-21 19:09:09 +02:00
|
|
|
QGuiApplication::setQuitOnLastWindowClosed(false);
|
|
|
|
|
2023-05-03 23:05:21 +02:00
|
|
|
QApplication a(argc, argv);
|
|
|
|
KDSingleApplication single_app(QCoreApplication::applicationName());
|
|
|
|
if (!single_app.isPrimaryInstance()) {
|
2019-01-11 20:07:59 +01:00
|
|
|
if (options.is_empty()) {
|
2019-01-13 14:46:22 +01:00
|
|
|
qLog(Info) << "Strawberry is already running - activating existing window (2)";
|
2019-01-11 20:07:59 +01:00
|
|
|
}
|
2023-05-03 23:05:21 +02:00
|
|
|
if (!single_app.sendMessage(options.Serialize())) {
|
2020-10-05 22:04:58 +02:00
|
|
|
qLog(Error) << "Could not send message to primary instance.";
|
|
|
|
}
|
2019-05-20 18:41:12 +02:00
|
|
|
return 0;
|
2019-01-11 20:07:59 +01:00
|
|
|
}
|
2022-05-21 19:09:09 +02:00
|
|
|
|
2022-05-19 22:02:35 +02:00
|
|
|
QGuiApplication::setWindowIcon(IconLoader::Load("strawberry"));
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2022-09-02 00:20:26 +02:00
|
|
|
#if defined(USE_BUNDLE)
|
|
|
|
{
|
|
|
|
QStringList library_paths;
|
|
|
|
#ifdef Q_OS_MACOS
|
|
|
|
library_paths.append(QCoreApplication::applicationDirPath() + "/../Frameworks");
|
|
|
|
#endif
|
|
|
|
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
|
|
|
|
library_paths.append(QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR);
|
|
|
|
#endif
|
|
|
|
if (!library_paths.isEmpty()) {
|
|
|
|
qLog(Debug) << "Looking for resources in" << library_paths;
|
|
|
|
QCoreApplication::setLibraryPaths(library_paths);
|
|
|
|
}
|
|
|
|
}
|
2018-02-27 18:06:05 +01:00
|
|
|
#endif
|
|
|
|
|
2018-03-18 18:39:30 +01:00
|
|
|
// Gnome on Ubuntu has menu icons disabled by default. I think that's a bad idea, and makes some menus in Strawberry look confusing.
|
2018-02-27 18:06:05 +01:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
|
|
|
|
2020-11-08 02:04:24 +01:00
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(AppearanceSettingsPage::kSettingsGroup);
|
2022-09-13 22:44:24 +02:00
|
|
|
QString style = s.value(AppearanceSettingsPage::kStyle).toString();
|
|
|
|
if (style.isEmpty()) {
|
|
|
|
style="default";
|
|
|
|
s.setValue(AppearanceSettingsPage::kStyle, style);
|
|
|
|
}
|
2020-11-08 02:04:24 +01:00
|
|
|
s.endGroup();
|
|
|
|
if (style != "default") {
|
|
|
|
QApplication::setStyle(style);
|
|
|
|
}
|
2020-11-08 03:22:38 +01:00
|
|
|
if (QApplication::style()) qLog(Debug) << "Style:" << QApplication::style()->objectName();
|
2020-11-08 02:04:24 +01:00
|
|
|
}
|
|
|
|
|
2022-08-28 02:44:37 +02:00
|
|
|
// Set the permissions on the config file on Unix - it can contain passwords for internet services, so it's important that other users can't read it.
|
2018-06-28 01:15:32 +02:00
|
|
|
// On Windows these are stored in the registry instead.
|
2018-02-27 18:06:05 +01:00
|
|
|
#ifdef Q_OS_UNIX
|
|
|
|
{
|
|
|
|
QSettings s;
|
2022-09-13 22:44:24 +02:00
|
|
|
if (QFile::exists(s.fileName())) {
|
|
|
|
if (!QFile::setPermissions(s.fileName(), QFile::ReadOwner | QFile::WriteOwner)) {
|
|
|
|
qLog(Error) << "Could not set permissions for settingsfile" << s.fileName();
|
2021-08-09 23:32:26 +02:00
|
|
|
}
|
2018-02-27 18:06:05 +01:00
|
|
|
}
|
2022-09-13 22:44:24 +02:00
|
|
|
else {
|
|
|
|
qLog(Error) << "Missing settingsfile" << s.fileName();
|
|
|
|
}
|
2018-02-27 18:06:05 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Resources
|
|
|
|
Q_INIT_RESOURCE(data);
|
2018-10-14 00:08:33 +02:00
|
|
|
Q_INIT_RESOURCE(icons);
|
2020-08-13 19:53:36 +02:00
|
|
|
#if defined(HAVE_TRANSLATIONS) && !defined(INSTALL_TRANSLATIONS)
|
2019-02-22 20:24:38 +01:00
|
|
|
Q_INIT_RESOURCE(translations);
|
|
|
|
#endif
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2019-03-13 00:43:46 +01:00
|
|
|
IconLoader::Init();
|
|
|
|
|
2019-02-22 20:24:38 +01:00
|
|
|
#ifdef HAVE_TRANSLATIONS
|
|
|
|
QString override_language = options.language();
|
|
|
|
if (override_language.isEmpty()) {
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(BehaviourSettingsPage::kSettingsGroup);
|
|
|
|
override_language = s.value("language").toString();
|
|
|
|
s.endGroup();
|
|
|
|
}
|
|
|
|
|
2019-07-22 20:53:05 +02:00
|
|
|
QString system_language = QLocale::system().uiLanguages().empty() ? QLocale::system().name() : QLocale::system().uiLanguages().first();
|
|
|
|
// uiLanguages returns strings with "-" as separators for language/region; however QTranslator needs "_" separators
|
|
|
|
system_language.replace("-", "_");
|
2019-02-22 20:24:38 +01:00
|
|
|
|
2019-07-22 20:53:05 +02:00
|
|
|
const QString language = override_language.isEmpty() ? system_language : override_language;
|
|
|
|
|
2023-07-21 05:55:24 +02:00
|
|
|
ScopedPtr<Translations> translations(new Translations);
|
2019-07-22 20:53:05 +02:00
|
|
|
|
2022-03-22 21:09:05 +01:00
|
|
|
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
2020-09-17 17:00:45 +02:00
|
|
|
translations->LoadTranslation("qt", QLibraryInfo::path(QLibraryInfo::TranslationsPath), language);
|
2022-03-22 21:09:05 +01:00
|
|
|
# else
|
2019-07-22 20:53:05 +02:00
|
|
|
translations->LoadTranslation("qt", QLibraryInfo::location(QLibraryInfo::TranslationsPath), language);
|
2022-03-22 21:09:05 +01:00
|
|
|
# endif
|
2019-07-22 20:53:05 +02:00
|
|
|
translations->LoadTranslation("strawberry", ":/translations", language);
|
2020-08-13 19:53:36 +02:00
|
|
|
translations->LoadTranslation("strawberry", TRANSLATIONS_DIR, language);
|
2021-09-10 01:46:13 +02:00
|
|
|
translations->LoadTranslation("strawberry", QCoreApplication::applicationDirPath(), language);
|
2019-07-22 20:53:05 +02:00
|
|
|
translations->LoadTranslation("strawberry", QDir::currentPath(), language);
|
2020-08-01 03:37:16 +02:00
|
|
|
|
2022-03-22 21:09:05 +01:00
|
|
|
# ifdef HAVE_QTSPARKLE
|
2022-03-17 06:51:15 +01:00
|
|
|
//qtsparkle::LoadTranslations(language);
|
2022-03-22 21:09:05 +01:00
|
|
|
# endif
|
2020-08-01 03:37:16 +02:00
|
|
|
|
2019-02-22 20:24:38 +01:00
|
|
|
#endif
|
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
Application app;
|
|
|
|
|
|
|
|
// Network proxy
|
|
|
|
QNetworkProxyFactory::setApplicationProxyFactory(NetworkProxyFactory::Instance());
|
|
|
|
|
|
|
|
// Create the tray icon and OSD
|
2023-07-21 05:55:24 +02:00
|
|
|
SharedPtr<SystemTrayIcon> tray_icon = make_shared<SystemTrayIcon>();
|
2021-05-20 21:40:08 +02:00
|
|
|
|
2020-12-11 23:59:38 +01:00
|
|
|
#if defined(Q_OS_MACOS)
|
2021-05-20 21:40:08 +02:00
|
|
|
OSDMac osd(tray_icon, &app);
|
2020-12-11 23:59:38 +01:00
|
|
|
#elif defined(HAVE_DBUS)
|
2021-05-20 21:40:08 +02:00
|
|
|
OSDDBus osd(tray_icon, &app);
|
2020-08-09 01:37:00 +02:00
|
|
|
#else
|
2021-05-20 21:40:08 +02:00
|
|
|
OSDBase osd(tray_icon, &app);
|
2020-08-09 01:37:00 +02:00
|
|
|
#endif
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
#ifdef HAVE_DBUS
|
2021-06-30 16:26:07 +02:00
|
|
|
mpris::Mpris2 mpris2(&app);
|
2018-02-27 18:06:05 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Window
|
2021-05-20 21:40:08 +02:00
|
|
|
MainWindow w(&app, tray_icon, &osd, options);
|
|
|
|
|
2018-07-01 22:26:46 +02:00
|
|
|
#ifdef Q_OS_MACOS
|
2018-02-27 18:06:05 +01:00
|
|
|
mac::EnableFullScreen(w);
|
2018-07-01 22:26:46 +02:00
|
|
|
#endif // Q_OS_MACOS
|
2020-10-03 20:05:30 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
#ifdef HAVE_DBUS
|
2021-06-30 16:26:07 +02:00
|
|
|
QObject::connect(&mpris2, &mpris::Mpris2::RaiseMainWindow, &w, &MainWindow::Raise);
|
2018-02-27 18:06:05 +01:00
|
|
|
#endif
|
2023-05-03 23:05:21 +02:00
|
|
|
QObject::connect(&single_app, &KDSingleApplication::messageReceived, &w, QOverload<const QByteArray&>::of(&MainWindow::CommandlineOptionsReceived));
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2021-09-10 01:46:13 +02:00
|
|
|
int ret = QCoreApplication::exec();
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-06-28 01:15:32 +02:00
|
|
|
return ret;
|
2023-05-03 23:05:21 +02:00
|
|
|
|
2018-06-28 01:15:32 +02:00
|
|
|
}
|