aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-11-02 10:45:01 -0400
committerKen Moore <ken@ixsystems.com>2017-11-02 10:45:01 -0400
commite0c84c93d82e19b0aad62e65458fa21b1ae639f2 (patch)
tree151c8b61f133952660f22fbf0374fc6c54774546 /src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
parentFinish up the large cleanup of lumina-fileinfo. (diff)
downloadlumina-e0c84c93d82e19b0aad62e65458fa21b1ae639f2.tar.gz
lumina-e0c84c93d82e19b0aad62e65458fa21b1ae639f2.tar.bz2
lumina-e0c84c93d82e19b0aad62e65458fa21b1ae639f2.zip
Add parsing of the "/media" directory on FreeBSD to the External Device Paths LOS function.
Diffstat (limited to 'src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp')
-rw-r--r--src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
index b9346565..a1c82fc9 100644
--- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
+++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
@@ -27,12 +27,12 @@ QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system
QString LOS::ControlPanelShortcut(){ return "/usr/local/share/applications/pccontrol.desktop"; } //system control panel
QString LOS::AppStoreShortcut(){ return "/usr/local/share/applications/appcafe.desktop"; } //graphical app/pkg manager
//OS-specific RSS feeds (Format: QStringList[ <name>::::<url> ]; )
-QStringList LOS::RSSFeeds(){
+QStringList LOS::RSSFeeds(){
QStringList feeds;
feeds << "FreeBSD News Feed::::https://www.freebsd.org/news/rss.xml";
feeds << "TrueOS News Feed::::http://www.trueos.org/?feed=rss2";
return feeds;
- }
+ }
// ==== ExternalDevicePaths() ====
QStringList LOS::ExternalDevicePaths(){
@@ -59,6 +59,23 @@ QStringList LOS::ExternalDevicePaths(){
i--;
}
}
+ //Also add info about anything in the "/media" directory
+ QDir media("/media");
+ QFileInfoList list = media.entryInfoList(QDir::NoDotAndDotDot, QDir::Type | QDir::Name);
+ for(int i=0; i<list.length(); i++){
+ if(list[i].isDir()){
+ devs << "UNKNOWN::::directory::::/media/"+list[i].fileName();
+ }else if(list[i].fileName().endsWith(".desktop")){
+ QString type = list[i].fileName().section(".desktop",0,-2);
+ //Determine the type of hardware device based on the dev node
+ if(type.startsWith("da")){ type = "USB"; }
+ else if(type.startsWith("ada")){ type = "HDRIVE"; }
+ else if(type.startsWith("mmsd")){ type = "SDCARD"; }
+ else if(type.startsWith("cd")||type.startsWith("acd")){ type="DVD"; }
+ else{ type = "UNKNOWN"; }
+ devs << type+"::::unknown::::/media/"+list[i].fileName();
+ }
+ }
return devs;
}
bgstack15