Remove obsolete QDesktopServices::storageLocation.
authorCamila <hello@camila.codes>
Tue, 27 Dec 2022 16:27:09 +0000 (17:27 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Mon, 30 Jan 2023 08:44:17 +0000 (09:44 +0100)
Use QStandardPaths::writableLocation instead.

Signed-off-by: Camila <hello@camila.codes>
src/gui/application.cpp

index 3a262a305b6712991cb23af8cf29ce2227eb86b5..cdf6360138c82210809be53c7fe747b7af0a2321 100644 (file)
@@ -247,9 +247,7 @@ Application::Application(int &argc, char **argv)
 #endif
         QT_WARNING_PUSH
         QT_WARNING_DISABLE_DEPRECATED
-        // We need to use the deprecated QDesktopServices::storageLocation because of its Qt4
-        // behavior of adding "data" to the path
-        QString oldDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+        QString oldDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
         if (oldDir.endsWith('/')) oldDir.chop(1); // macOS 10.11.x does not like trailing slash for rename/move.
         QT_WARNING_POP
         setApplicationName(_theme->appName());