diff --git a/src/handlers/xdgurl.cpp b/src/handlers/xdgurl.cpp index 96790ab0718e72a468422c11a338b017905c4a78..6cf2f4f724008b9d7af22b42c975b12f7eade303 100644 --- a/src/handlers/xdgurl.cpp +++ b/src/handlers/xdgurl.cpp @@ -78,27 +78,33 @@ QJsonObject XdgUrl::_importDestinations() QJsonObject destinations; QJsonObject appConfigDestinations = _appConfig->get("destinations"); QJsonObject appConfigDestinationsAlias = _appConfig->get("destinations_alias"); + QJsonObject userConfigDestinations = _userConfig->get("destinations"); + QJsonObject userConfigDestinationsAlias = _userConfig->get("destinations_alias"); foreach (const QString key, appConfigDestinations.keys()) { - QString value = appConfigDestinations[key].toString(); - if (value.contains("$HOME")) { - value = value.replace("$HOME", Utility::File::homePath()); - } - else if (value.contains("$XDG_DATA")) { - value = value.replace("$XDG_DATA", Utility::File::xdgDataHomePath()); - } - else if (value.contains("$KDE_DATA")) { - value = value.replace("$KDE_DATA", Utility::File::kdeDataHomePath()); - } - destinations[key] = value; + destinations[key] = _convertPathString(appConfigDestinations[key].toString()); } foreach (const QString key, appConfigDestinationsAlias.keys()) { QString value = appConfigDestinationsAlias[key].toString(); if (destinations.contains(value)) { - value = destinations[value].toString(); + destinations[key] = destinations.value(value); + } + } + + if (!userConfigDestinations.isEmpty()) { + foreach (const QString key, userConfigDestinations.keys()) { + destinations[key] = _convertPathString(userConfigDestinations[key].toString()); + } + } + + if (!userConfigDestinationsAlias.isEmpty()) { + foreach (const QString key, userConfigDestinationsAlias.keys()) { + QString value = userConfigDestinationsAlias[key].toString(); + if (destinations.contains(value)) { + destinations[key] = destinations.value(value); + } } - destinations[key] = value; } return destinations;