aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaOS-Linux.cpp
diff options
context:
space:
mode:
authorChristopher Roy Bratusek <nano@jpberlin.de>2015-01-23 23:38:17 +0100
committerChristopher Roy Bratusek <nano@jpberlin.de>2015-01-23 23:38:17 +0100
commit47036a271683076162909c062e1d22d6e8d8de06 (patch)
treebd2e94ae4b0d069a923aa166e2cfabfb24a24887 /libLumina/LuminaOS-Linux.cpp
parentfixup device detection in LuminaOS-Debian (diff)
downloadlumina-47036a271683076162909c062e1d22d6e8d8de06.tar.gz
lumina-47036a271683076162909c062e1d22d6e8d8de06.tar.bz2
lumina-47036a271683076162909c062e1d22d6e8d8de06.zip
fix device detection in generic LuminaOS-Linux
Diffstat (limited to 'libLumina/LuminaOS-Linux.cpp')
-rw-r--r--libLumina/LuminaOS-Linux.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp
index acece864..aaf781fb 100644
--- a/libLumina/LuminaOS-Linux.cpp
+++ b/libLumina/LuminaOS-Linux.cpp
@@ -30,14 +30,16 @@ QStringList LOS::ExternalDevicePaths(){
//Now check the output
for(int i=0; i<devs.length(); i++){
if(devs[i].startsWith("/dev/")){
- QString type = devs[i].section(" on ",0,0);
- type.remove("/dev/");
+ devs[i] = devs[i].simplified();
+ QString type = devs[i].section(" ",0,0);
+ 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(" ",4,4)+"::::"+devs[i].section(" ",2,2);
}else{
//invalid device - remove it from the list
devs.removeAt(i);
bgstack15