aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-26 10:48:12 -0500
committerKen Moore <ken@pcbsd.org>2015-01-26 10:48:12 -0500
commitfeb4085e7f958b6acacf579eba0772591ca2a736 (patch)
treeae8a6fbee7a4d5d1c8ecea1eca3fd77dac292cab /lumina-fm
parentMerge pull request #42 from Nanolx/luminaos-debian (diff)
downloadlumina-feb4085e7f958b6acacf579eba0772591ca2a736.tar.gz
lumina-feb4085e7f958b6acacf579eba0772591ca2a736.tar.bz2
lumina-feb4085e7f958b6acacf579eba0772591ca2a736.zip
Clean up the lumina-fm device usage from LuminaOS.
Diffstat (limited to 'lumina-fm')
-rw-r--r--lumina-fm/MainUI.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 88ffb22f..ffb92572 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -306,27 +306,32 @@ void MainUI::RebuildDeviceMenu(){
ui->menuExternal_Devices->addSeparator();
//Scan for externally mounted devices
QStringList devs = LOS::ExternalDevicePaths();
- QString label;
//Output Format: <type>::::<filesystem>::::<path> (6/24/14 - version 0.4.0 )
- // <type> = [USB, HDRIVE, SDCARD, DVD, UNKNOWN]
+ // <type> = [USB, HDRIVE, SDCARD, DVD, LVM, UNKNOWN]
//Now add them to the menu appropriately
for(int i=0; i<devs.length(); i++){
//Skip hidden mount points (usually only for system usage - not user browsing)
- if(devs[i].section("::::",2,2).section("/",-1).startsWith(".")){ continue; }
+ QString label, path, fs;
+ //Format inputs as necesary
+ path = devs[i].section("::::",2,2);
+ fs = devs[i].section("::::",1,1);
+ if(path.endsWith("/") && path.length()>1 ){ path.chop(1); }
+ if(path == "/"){ label = tr("Root"); }
+ else{ label = path.section("/",-1).simplified(); }
+ if(label.startsWith(".") ){ continue; } //don't show hidden mountpoint (not usually user-browsable)
//Create entry for this device
- if(devs[i].section("::::",2,2).section("/",-1).isEmpty()) {
- label = "root";
- } else {
- label = devs[i].section("::::",2,2).section("/",-1);
+ if( !fs.simplified().isEmpty()){
+ //Add filesystem type to the label
+ label = QString(tr("%1 (Type: %2)")).arg(label, fs);
}
- label = label + " (type: " + devs[i].section("::::",1,1) + ")";
- QAction *act = new QAction(label,this); act->setWhatsThis(devs[i].section("::::",2,2)); //full path to mountpoint
+ QAction *act = new QAction(label,this);
+ act->setWhatsThis(path); //full path to mountpoint
act->setToolTip( QString(tr("Filesystem: %1")).arg( devs[i].section("::::",1,1) ) );
//Now set the appropriate icon
QString type = devs[i].section("::::",0,0);
if(type=="USB"){ type = "drive-removable-media-usb"; }
- else if(type=="HDRIVE"){ type = "drive-harddisk"; }
+ else if(type=="HDRIVE" || type=="LVM"){ type = "drive-harddisk"; }
else if(type=="SDCARD"){ type = "media-flash-sd-mmc"; }
else if(type=="DVD"){ type = "media-optical"; }
else{ type = "drive-removable-media"; }
bgstack15