diff --git a/ext/libstrawberry-common/core/workerpool.h b/ext/libstrawberry-common/core/workerpool.h index 305a34bc..490920a9 100644 --- a/ext/libstrawberry-common/core/workerpool.h +++ b/ext/libstrawberry-common/core/workerpool.h @@ -233,9 +233,9 @@ void WorkerPool::DoStart() { executable_path_ = executable_name_; QStringList search_path; - search_path << qApp->applicationDirPath(); + search_path << QCoreApplication::applicationDirPath(); #if defined(Q_OS_MACOS) && defined(USE_BUNDLE) - search_path << qApp->applicationDirPath() + "/" + USE_BUNDLE_DIR; + search_path << QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR; #endif for (const QString &path_prefix : search_path) { diff --git a/ext/strawberry-tagreader/tagreaderworker.cpp b/ext/strawberry-tagreader/tagreaderworker.cpp index 9c46f819..9ac2357b 100644 --- a/ext/strawberry-tagreader/tagreaderworker.cpp +++ b/ext/strawberry-tagreader/tagreaderworker.cpp @@ -59,5 +59,5 @@ void TagReaderWorker::MessageArrived(const spb::tagreader::Message &message) { void TagReaderWorker::DeviceClosed() { AbstractMessageHandler::DeviceClosed(); - qApp->exit(); + QCoreApplication::exit(); } diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index b7437a4d..bc48e8ab 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -1197,7 +1197,7 @@ void MainWindow::Exit() { if (exit_count_ > 1) { exit_ = true; - qApp->quit(); + QCoreApplication::quit(); } else { if (app_->player()->engine()->is_fadeout_enabled()) { @@ -1227,7 +1227,7 @@ void MainWindow::DoExit() { void MainWindow::ExitFinished() { exit_ = true; - qApp->quit(); + QCoreApplication::quit(); } diff --git a/src/core/mpris2.cpp b/src/core/mpris2.cpp index dbb54c63..416398c5 100644 --- a/src/core/mpris2.cpp +++ b/src/core/mpris2.cpp @@ -298,7 +298,7 @@ QStringList Mpris2::SupportedMimeTypes() { void Mpris2::Raise() { emit RaiseMainWindow(); } -void Mpris2::Quit() { qApp->quit(); } +void Mpris2::Quit() { QCoreApplication::quit(); } QString Mpris2::PlaybackStatus() const { return PlaybackStatus(app_->player()->GetState()); diff --git a/src/globalshortcuts/globalshortcut-x11.cpp b/src/globalshortcuts/globalshortcut-x11.cpp index 52e72bee..07ea9376 100644 --- a/src/globalshortcuts/globalshortcut-x11.cpp +++ b/src/globalshortcuts/globalshortcut-x11.cpp @@ -72,7 +72,7 @@ Display *X11Display() { if (!qApp) return nullptr; - QPlatformNativeInterface *native = qApp->platformNativeInterface(); + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); if (!native) return nullptr; void *display = native->nativeResourceForIntegration("display"); @@ -105,7 +105,7 @@ quint32 AppRootWindow() { if (!qApp) return 0; - QPlatformNativeInterface *native = qApp->platformNativeInterface(); + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); if (!native) return 0; QScreen *screen = QGuiApplication::primaryScreen(); diff --git a/src/main.cpp b/src/main.cpp index 7594884a..e38e9f45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) { } return 0; } - a.setQuitOnLastWindowClosed(false); + QGuiApplication::setQuitOnLastWindowClosed(false); #if defined(USE_BUNDLE) && (defined(Q_OS_LINUX) || defined(Q_OS_MACOS)) qLog(Debug) << "Looking for resources in" << QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR; @@ -272,7 +272,7 @@ int main(int argc, char *argv[]) { #endif translations->LoadTranslation("strawberry", ":/translations", language); translations->LoadTranslation("strawberry", TRANSLATIONS_DIR, language); - translations->LoadTranslation("strawberry", a.applicationDirPath(), language); + translations->LoadTranslation("strawberry", QCoreApplication::applicationDirPath(), language); translations->LoadTranslation("strawberry", QDir::currentPath(), language); #ifdef HAVE_QTSPARKLE @@ -313,7 +313,7 @@ int main(int argc, char *argv[]) { #endif QObject::connect(&a, &SingleApplication::receivedMessage, &w, QOverload::of(&MainWindow::CommandlineOptionsReceived)); - int ret = a.exec(); + int ret = QCoreApplication::exec(); return ret; } diff --git a/src/osd/osdpretty.cpp b/src/osd/osdpretty.cpp index 5c004968..1036688f 100644 --- a/src/osd/osdpretty.cpp +++ b/src/osd/osdpretty.cpp @@ -166,7 +166,7 @@ OSDPretty::~OSDPretty() { void OSDPretty::showEvent(QShowEvent *e) { screens_.clear(); - for(QScreen *screen : qApp->screens()) { + for(QScreen *screen : QGuiApplication::screens()) { screens_.insert(screen->name(), screen); } @@ -221,7 +221,7 @@ bool OSDPretty::IsTransparencyAvailable() { return QX11Info::isCompositingManagerRunning(); #elif defined(HAVE_X11) && defined(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H) if (qApp) { - QPlatformNativeInterface *native = qApp->platformNativeInterface(); + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); QScreen *screen = popup_screen_ == nullptr ? QGuiApplication::primaryScreen() : popup_screen_; if (native && screen) { return native->nativeResourceForScreen(QByteArray("compositingEnabled"), screen);