From: Nate Graham Date: Sat, 17 Jul 2021 03:08:18 +0000 (-0400) Subject: Merge branch 'release/21.08' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/2c7a1f4b4c5a7cfd8cd4ddafbe7ca46f9b968830?hp=3fe971e17467e30ba59ca42a53931a273fd7e78b Merge branch 'release/21.08' --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9679e4a6f..c8957cd6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.16) # KDE Application Version, managed by release script set (RELEASE_SERVICE_VERSION_MAJOR "21") -set (RELEASE_SERVICE_VERSION_MINOR "07") -set (RELEASE_SERVICE_VERSION_MICRO "80") +set (RELEASE_SERVICE_VERSION_MINOR "11") +set (RELEASE_SERVICE_VERSION_MICRO "70") set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") project(Dolphin VERSION ${RELEASE_SERVICE_VERSION}) diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp index 7e453f72a..2b674b968 100644 --- a/src/dbusinterface.cpp +++ b/src/dbusinterface.cpp @@ -20,8 +20,10 @@ DBusInterface::DBusInterface() : { QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/freedesktop/FileManager1"), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); - QDBusConnection::sessionBus().interface()->registerService(QStringLiteral("org.freedesktop.FileManager1"), - QDBusConnectionInterface::QueueService); + QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface(); + if (sessionInterface) { + sessionInterface->registerService(QStringLiteral("org.freedesktop.FileManager1"), QDBusConnectionInterface::QueueService); + } } void DBusInterface::ShowFolders(const QStringList& uriList, const QString& startUpId) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index fe39d4d2f..d4c8199a6 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1543,7 +1543,8 @@ void DolphinMainWindow::setupActions() stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window")); stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-stash"))); stashSplit->setCheckable(false); - stashSplit->setVisible(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier"))); + QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface(); + stashSplit->setVisible(sessionInterface && sessionInterface->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier"))); connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash); KStandardAction::redisplay(this, &DolphinMainWindow::reloadView, actionCollection()); diff --git a/src/global.cpp b/src/global.cpp index 197d6ec28..d217a67ec 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -120,7 +120,8 @@ QVector, QStringList>> Do } // Look for dolphin instances among all available dbus services. - const QStringList dbusServices = QDBusConnection::sessionBus().interface()->registeredServiceNames().value(); + QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface(); + const QStringList dbusServices = sessionInterface ? sessionInterface->registeredServiceNames().value() : QStringList(); // Don't match the service without trailing "-" (unique instance) const QString pattern = QStringLiteral("org.kde.dolphin-"); // Don't match the pid without leading "-" diff --git a/src/main.cpp b/src/main.cpp index fba45f43c..ba894ec38 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -61,6 +62,8 @@ int main(int argc, char **argv) QApplication app(argc, argv); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon())); + KIO::PreviewJob::setDefaultDevicePixelRatio(app.devicePixelRatio()); + KCrash::initialize(); Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin")); @@ -178,7 +181,12 @@ int main(int argc, char **argv) mainWindow->show(); - KDBusService dolphinDBusService; + // Allow starting Dolphin on a system that is not running DBus: + KDBusService::StartupOptions serviceOptions = KDBusService::Multiple; + if (!QDBusConnection::sessionBus().isConnected()) { + serviceOptions |= KDBusService::NoExitOnFailure; + } + KDBusService dolphinDBusService(serviceOptions); DBusInterface interface; if (!app.isSessionRestored()) { diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index d43b9f520..98c012243 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -394,8 +394,8 @@ void InformationPanelContent::showPreview(const KFileItem& item, // adds a play arrow // compute relative pixel positions - const int zeroX = static_cast(p.width() / 2 - PLAY_ARROW_SIZE / 2 / devicePixelRatio()); - const int zeroY = static_cast(p.height() / 2 - PLAY_ARROW_SIZE / 2 / devicePixelRatio()); + const int zeroX = static_cast((p.width() / 2 - PLAY_ARROW_SIZE / 2) / pixmap.devicePixelRatio()); + const int zeroY = static_cast((p.height() / 2 - PLAY_ARROW_SIZE / 2) / pixmap.devicePixelRatio()); QPolygon arrow; arrow << QPoint(zeroX, zeroY);