aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-02-24 08:25:10 -0500
committerKen Moore <moorekou@gmail.com>2015-02-24 08:25:10 -0500
commiteca245535f11dda7aa6b958fbc98af5c3440ebda (patch)
tree76e7881e6f22f5bdc540c228ad2ad1414c682d6e
parentAdd a new utility to the lumina source tree: lumina-xconfig (diff)
parentallow to list different type of mounted systems: mfs, nfs, ... (diff)
downloadlumina-eca245535f11dda7aa6b958fbc98af5c3440ebda.tar.gz
lumina-eca245535f11dda7aa6b958fbc98af5c3440ebda.tar.bz2
lumina-eca245535f11dda7aa6b958fbc98af5c3440ebda.zip
Merge pull request #57 from william-os4y/externalDevices2
External devices2
-rw-r--r--libLumina/LuminaOS-OpenBSD.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp
index ffc21fa4..2c86995a 100644
--- a/libLumina/LuminaOS-OpenBSD.cpp
+++ b/libLumina/LuminaOS-OpenBSD.cpp
@@ -30,20 +30,22 @@ QStringList LOS::ExternalDevicePaths(){
QStringList devs = LUtils::getCmdOutput("mount");
//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/");
+ 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.startsWith("wd")){ type = "HDRIVE"; }
else if(type.startsWith("cd")){ type="DVD"; }
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();
- }else{
- //invalid device - remove it from the list
- devs.removeAt(i);
- i--;
- }
+ QString fs = devs[i].section(" ", 4, 4);
+ QString path = devs[i].section(" ",2, 2);
+ if (!fs.isEmpty() ) { //we not found a filesystem, most probably this is an invalid row
+ devs[i] = type+"::::"+fs+"::::"+path;
+ }
+ else {
+ devs.removeAt(i);
+ i--;
+ }
}
return devs;
}
bgstack15