]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/21.08'
authorNate Graham <nate@kde.org>
Sat, 17 Jul 2021 03:08:18 +0000 (23:08 -0400)
committerNate Graham <nate@kde.org>
Sat, 17 Jul 2021 03:08:18 +0000 (23:08 -0400)
CMakeLists.txt
src/dbusinterface.cpp
src/dolphinmainwindow.cpp
src/global.cpp
src/main.cpp
src/panels/information/informationpanelcontent.cpp

index 9679e4a6f980dd59370c8615ab1bf07789d7c345..c8957cd6d68e3dcabe9c465bb3a2a523cd3c8054 100644 (file)
@@ -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})
 
index 7e453f72ac785ffddcba23582c6b2129cc10444a..2b674b96888382b5497e0fd639c8c9fd6f7a0788 100644 (file)
@@ -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)
index fe39d4d2fbabf7e298cf0aef52d79e377ccce393..d4c8199a6001719495be10fd6047a0860477dfe0 100644 (file)
@@ -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());
index 197d6ec288f5e1b88ca0a9b3d129154293d4fbb3..d217a67ec82c71996d90b2f2b01636a88189380d 100644 (file)
@@ -120,7 +120,8 @@ QVector<QPair<QSharedPointer<OrgKdeDolphinMainWindowInterface>, 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 "-"
index fba45f43c431b9698e272c5d3676e1e8a3490a9f..ba894ec38c2944633fe3b78243c02bb000249566 100644 (file)
@@ -23,6 +23,7 @@
 #include <KLocalizedString>
 #include <Kdelibs4ConfigMigrator>
 #include <KConfigGui>
+#include <KIO/PreviewJob>
 
 #include <QApplication>
 #include <QCommandLineParser>
@@ -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()) {
index d43b9f5205d72b92531b0b9849f652a59078d881..98c012243752fe98562ee419e84ea784bd6db98f 100644 (file)
@@ -394,8 +394,8 @@ void InformationPanelContent::showPreview(const KFileItem& item,
         // adds a play arrow
 
         // compute relative pixel positions
-        const int zeroX = static_cast<int>(p.width() / 2 - PLAY_ARROW_SIZE / 2 / devicePixelRatio());
-        const int zeroY = static_cast<int>(p.height() / 2 - PLAY_ARROW_SIZE / 2 / devicePixelRatio());
+        const int zeroX = static_cast<int>((p.width() / 2 - PLAY_ARROW_SIZE / 2) / pixmap.devicePixelRatio());
+        const int zeroY = static_cast<int>((p.height() / 2 - PLAY_ARROW_SIZE / 2) / pixmap.devicePixelRatio());
 
         QPolygon arrow;
         arrow << QPoint(zeroX, zeroY);