diff options
author | william os4y <william.os4y@gmail.com> | 2015-02-26 18:15:28 +0100 |
---|---|---|
committer | william os4y <william.os4y@gmail.com> | 2015-02-26 18:15:28 +0100 |
commit | aec1ead9ba72cbdedb859610b83f74fc2c8ecb34 (patch) | |
tree | 2a6b916a99f06eda59ccb010ee5fed626bdd4506 /libLumina/LuminaOS-OpenBSD.cpp | |
parent | fix issue #55: inform user whan return code is not null (diff) | |
parent | Have lumina-search load the icons a moment after the application is done init... (diff) | |
download | lumina-aec1ead9ba72cbdedb859610b83f74fc2c8ecb34.tar.gz lumina-aec1ead9ba72cbdedb859610b83f74fc2c8ecb34.tar.bz2 lumina-aec1ead9ba72cbdedb859610b83f74fc2c8ecb34.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'libLumina/LuminaOS-OpenBSD.cpp')
-rw-r--r-- | libLumina/LuminaOS-OpenBSD.cpp | 20 |
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; } |