aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-04 19:28:17 +0000
committerWeblate <noreply@weblate.org>2017-11-04 19:28:17 +0000
commit7787f617656751ee7e0a58c813d0bfd5757c5c97 (patch)
tree48aa053bbd4fda9c64f89a061a2f442c860ab13d /src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
parentTranslated using Weblate (Lithuanian) (diff)
parentMerge pull request #497 from a-stjohn/patch-1 (diff)
downloadlumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.gz
lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.bz2
lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp')
-rw-r--r--src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
index b9346565..29a58ec9 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,25 @@ QStringList LOS::ExternalDevicePaths(){
i--;
}
}
+ //Also add info about anything in the "/media" directory
+ QDir media("/media");
+ QFileInfoList list = media.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot, QDir::Type | QDir::Name);
+ //qDebug() << "Media files found:" << list.length();
+ for(int i=0; i<list.length(); i++){
+ //qDebug() << "Found media entry:" << list[i].fileName();
+ if(list[i].isDir()){
+ devs << "UNKNOWN::::::::/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+"::::::::/media/"+list[i].fileName();
+ }
+ }
return devs;
}
bgstack15