diff options
author | Christopher Roy Bratusek <nano@jpberlin.de> | 2015-01-23 23:30:38 +0100 |
---|---|---|
committer | Christopher Roy Bratusek <nano@jpberlin.de> | 2015-01-23 23:30:38 +0100 |
commit | 4595605bbd24197602b33df75791d095200f54bd (patch) | |
tree | 68d42f97ef0a01d744bd76db6b0ec33c8e2e4e6b | |
parent | add recommends for lxpolkit and qt5-configuration-tool (diff) | |
download | lumina-4595605bbd24197602b33df75791d095200f54bd.tar.gz lumina-4595605bbd24197602b33df75791d095200f54bd.tar.bz2 lumina-4595605bbd24197602b33df75791d095200f54bd.zip |
fixup device detection in LuminaOS-Debian
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 313e2ae3..0ba367e2 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -33,14 +33,16 @@ QStringList LOS::ExternalDevicePaths(){ //Now check the output for(int i=0; i<devs.length(); i++){ if(devs[i].startsWith("/dev/")){ + devs[i] = devs[i].simplified(); QString type = devs[i].section(" on ",0,0); - type.remove("/dev/"); + type.remove("/dev/"); //Determine the type of hardware device based on the dev node if(type.startsWith("sd")){ type = "HDRIVE"; } else if(type.startsWith("sr")){ type="DVD"; } + else if(type.contains("mapper")){ type="LVM"; } else{ type = "UNKNOWN"; } //Now put the device in the proper output format - devs[i] = type+"::::"+devs[i].section("(",1,1).section(",",0,0)+"::::"+devs[i].section(" on ",1,50).section("(",0,0).simplified(); + devs[i] = type + "::::" + devs[i].section(" ",1,1) + "::::" + devs[i].section(" ",2,2); }else{ //invalid device - remove it from the list devs.removeAt(i); |