Skip to content
Snippets Groups Projects
Commit fd66b9ed authored by akiraohgaki's avatar akiraohgaki
Browse files

Convert path strings

parent ab81cebb
No related branches found
No related tags found
No related merge requests found
...@@ -6,27 +6,27 @@ ...@@ -6,27 +6,27 @@
}, },
"downloads": { "downloads": {
"name": "Downloads", "name": "Downloads",
"destination": "$HOME/Downloads", "destination": "$XDG_DOWNLOAD_DIR",
"generic_destination": "$APP_DATA/downloads" "generic_destination": "$APP_DATA/downloads"
}, },
"documents": { "documents": {
"name": "Documents", "name": "Documents",
"destination": "$HOME/Documents", "destination": "$XDG_DOCUMENTS_DIR",
"generic_destination": "$APP_DATA/documents" "generic_destination": "$APP_DATA/documents"
}, },
"pictures": { "pictures": {
"name": "Pictures", "name": "Pictures",
"destination": "$HOME/Pictures", "destination": "$XDG_PICTURES_DIR",
"generic_destination": "$APP_DATA/pictures" "generic_destination": "$APP_DATA/pictures"
}, },
"music": { "music": {
"name": "Music", "name": "Music",
"destination": "$HOME/Music", "destination": "$XDG_MUSIC_DIR",
"generic_destination": "$APP_DATA/music" "generic_destination": "$APP_DATA/music"
}, },
"videos": { "videos": {
"name": "Videos", "name": "Videos",
"destination": "$HOME/Videos", "destination": "$XDG_VIDEOS_DIR",
"generic_destination": "$APP_DATA/videos" "generic_destination": "$APP_DATA/videos"
}, },
"wallpapers": { "wallpapers": {
......
#include "confighandler.h" #include "confighandler.h"
#include <QStringList> #include <QStringList>
#include <QStandardPaths>
#include "qtlib_dir.h" #include "qtlib_dir.h"
...@@ -50,6 +51,21 @@ QString ConfigHandler::convertPathString(const QString &path) ...@@ -50,6 +51,21 @@ QString ConfigHandler::convertPathString(const QString &path)
if (newPath.contains("$HOME")) { if (newPath.contains("$HOME")) {
newPath.replace("$HOME", qtlib::Dir::homePath()); newPath.replace("$HOME", qtlib::Dir::homePath());
} }
else if (newPath.contains("$XDG_DOCUMENTS_DIR")) {
newPath.replace("$XDG_DOCUMENTS_DIR", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
}
else if (newPath.contains("$XDG_DOWNLOAD_DIR")) {
newPath.replace("$XDG_DOWNLOAD_DIR", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
}
else if (newPath.contains("$XDG_PICTURES_DIR")) {
newPath.replace("$XDG_PICTURES_DIR", QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
}
else if (newPath.contains("$XDG_MUSIC_DIR")) {
newPath.replace("$XDG_MUSIC_DIR", QStandardPaths::writableLocation(QStandardPaths::MusicLocation));
}
else if (newPath.contains("$XDG_VIDEOS_DIR")) {
newPath.replace("$XDG_VIDEOS_DIR", QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
}
else if (newPath.contains("$XDG_DATA_HOME")) { else if (newPath.contains("$XDG_DATA_HOME")) {
newPath.replace("$XDG_DATA_HOME", qtlib::Dir::genericDataPath()); newPath.replace("$XDG_DATA_HOME", qtlib::Dir::genericDataPath());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment