aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaOS-OpenBSD.cpp
diff options
context:
space:
mode:
authorwilliam os4y <william.os4y@gmail.com>2015-02-22 23:12:48 +0100
committerwilliam os4y <william.os4y@gmail.com>2015-02-22 23:45:36 +0100
commitd0a700d5233e6da38430d4b8d7db53458458b2bb (patch)
tree814d9446c686640a85e9317fe7f5d32942651279 /libLumina/LuminaOS-OpenBSD.cpp
parentfix for ExternalDevices on OpenBSD (diff)
downloadlumina-d0a700d5233e6da38430d4b8d7db53458458b2bb.tar.gz
lumina-d0a700d5233e6da38430d4b8d7db53458458b2bb.tar.bz2
lumina-d0a700d5233e6da38430d4b8d7db53458458b2bb.zip
allow to list different type of mounted systems: mfs, nfs, ...
Diffstat (limited to 'libLumina/LuminaOS-OpenBSD.cpp')
-rw-r--r--libLumina/LuminaOS-OpenBSD.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp
index 44917a6e..2c86995a 100644
--- a/libLumina/LuminaOS-OpenBSD.cpp
+++ b/libLumina/LuminaOS-OpenBSD.cpp
@@ -30,9 +30,8 @@ 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(" ",0,0);
- type.remove("/dev/");
+ 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"; }
@@ -40,12 +39,13 @@ QStringList LOS::ExternalDevicePaths(){
//Now put the device in the proper output format
QString fs = devs[i].section(" ", 4, 4);
QString path = devs[i].section(" ",2, 2);
- devs[i] = type+"::::"+fs+"::::"+path;
- }else{
- //invalid device - remove it from the list
- devs.removeAt(i);
- i--;
- }
+ 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