Commit a5a18f5a authored by René J.V. Bertin's avatar René J.V. Bertin

kio_desktop: don't use QDesktopServices::storageLocation

The method is deprecated and using it can generate build failures (e.g.
with Qt 5.8+ and GCC 7.1+).

BUG: 381566
parent 637f2f79
......@@ -30,7 +30,6 @@
#include <QCoreApplication>
#include <QFile>
#include <QDBusInterface>
#include <QDesktopServices>
#include <QDir>
#include <QStandardPaths>
......@@ -65,11 +64,9 @@ DesktopProtocol::~DesktopProtocol()
void DesktopProtocol::checkLocalInstall()
#ifndef Q_WS_WIN
// We can't use QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) here, since it returns the home dir
// if the desktop folder doesn't exist.
QString desktopPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
if (desktopPath.isEmpty())
desktopPath = QDir::homePath() + "/Desktop";
// QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) returns the home dir
// if the desktop folder doesn't exist, so verify its result
QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
const QDir desktopDir(desktopPath);
bool desktopIsEmpty;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment