diff options
author | Jesse Smith <jessefrgsmith@yahoo.ca> | 2014-09-24 18:27:01 -0300 |
---|---|---|
committer | Jesse Smith <jessefrgsmith@yahoo.ca> | 2014-09-24 18:27:01 -0300 |
commit | cb6f25dbac535d38024d47f5a3c708b99061ba08 (patch) | |
tree | bd0099ddd83c5a9ba6c7da8071036218acf123dd /libLumina/LuminaOS-Linux.cpp | |
parent | Applied Debian patch to enable building on 32-bit Linux machines. Project (diff) | |
download | lumina-cb6f25dbac535d38024d47f5a3c708b99061ba08.tar.gz lumina-cb6f25dbac535d38024d47f5a3c708b99061ba08.tar.bz2 lumina-cb6f25dbac535d38024d47f5a3c708b99061ba08.zip |
Updated Debian rules/package files to reflect updated Lumina binaries.
Removed Debian patches that could no longer be applied cleanly.
Added initial external device support to Linux in libLumina.
Diffstat (limited to 'libLumina/LuminaOS-Linux.cpp')
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index af8c740f..bdd16fac 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -26,9 +26,25 @@ QString LOS::QtConfigShortcut(){ return "/usr/bin/qtconfig-qt4"; } //qtconfig bi QStringList LOS::ExternalDevicePaths(){ //Returns: QStringList[<type>::::<filesystem>::::<path>] //Note: <type> = [USB, HDRIVE, DVD, SDCARD, UNKNOWN] - - //Not implemented yet for Linux - return QStringList(); + 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/"); + //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{ 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--; + } + } + return devs; } //Read screen brightness information |