# 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})
{
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)
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());
}
// 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 "-"
#include <KLocalizedString>
#include <Kdelibs4ConfigMigrator>
#include <KConfigGui>
+#include <KIO/PreviewJob>
#include <QApplication>
#include <QCommandLineParser>
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"));
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()) {
// 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);