From 7ad9e68f2c85c25a3fc1b267a574bb7561430baa Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Tue, 27 Sep 2016 19:52:29 +0900
Subject: [PATCH] Fix for destinations

---
 src/handlers/xdgurl.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/handlers/xdgurl.cpp b/src/handlers/xdgurl.cpp
index 7b5abcc..8182f4a 100644
--- a/src/handlers/xdgurl.cpp
+++ b/src/handlers/xdgurl.cpp
@@ -66,21 +66,23 @@ QJsonObject XdgUrl::_importDestinations()
     foreach (const QString key, appConfigDestinations.keys()) {
         QString value = appConfigDestinations[key].toString();
         if (value.startsWith("$HOME")) {
-            destinations[key] = value.replace("$HOME", Utility::File::homePath());
+            value = value.replace("$HOME", Utility::File::homePath());
         }
         else if (value.startsWith("$XDG_DATA")) {
-            destinations[key] = value.replace("$XDG_DATA", Utility::File::xdgDataHomePath());
+            value = value.replace("$XDG_DATA", Utility::File::xdgDataHomePath());
         }
         else if (value.startsWith("$KDE_DATA")) {
-            destinations[key] = value.replace("$KDE_DATA", Utility::File::kdeDataHomePath());
+            value = value.replace("$KDE_DATA", Utility::File::kdeDataHomePath());
         }
+        destinations[key] = value;
     }
 
     foreach (const QString key, appConfigDestinationsAlias.keys()) {
         QString value = appConfigDestinationsAlias[key].toString();
         if (destinations.contains(value)) {
-            destinations[key] = destinations.value(value);
+            value = destinations[value].toString();
         }
+        destinations[key] = value;
     }
 
     return destinations;
-- 
GitLab