OSDN Git Service

drkonqi: remove quotes from os-release file values
authorIvailo Monev <xakepa10@gmail.com>
Mon, 12 Oct 2015 06:44:46 +0000 (09:44 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 12 Oct 2015 06:44:55 +0000 (09:44 +0300)
drkonqi/systeminformation.cpp

index d0db284..c699874 100644 (file)
@@ -122,7 +122,14 @@ QString SystemInformation::fetchOSReleaseInformation() const
         const int index = line.indexOf('=');
         if ( index != -1 ) {
             const QString key = line.left(index);
-            const QString value = line.mid(index+1);
+            QString value = line.mid(index+1);
+            value = value.trimmed();
+            if(value.startsWith("'") or value.startsWith("\"")) {
+                value.remove(0, 1);
+            }
+            if(value.endsWith("'") or value.endsWith("\"")) {
+                value.chop(1);
+            }
             distroInfos.insert(key, value);
         }
     }