aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-cpp/framework-OSInterface_private.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-12-15 13:56:26 -0500
committerKen Moore <ken@ixsystems.com>2017-12-15 13:56:26 -0500
commit496a3cb583a2f5fb2da7c1808077c1fc5a9bfc28 (patch)
tree4a57b239aea12a98265a35580552f3fa45e48cfd /src-qt5/src-cpp/framework-OSInterface_private.cpp
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-496a3cb583a2f5fb2da7c1808077c1fc5a9bfc28.tar.gz
lumina-496a3cb583a2f5fb2da7c1808077c1fc5a9bfc28.tar.bz2
lumina-496a3cb583a2f5fb2da7c1808077c1fc5a9bfc28.zip
A bit more work on the networking side of the OSInterface.
Also add a test project for running tests against particular frameworks.
Diffstat (limited to 'src-qt5/src-cpp/framework-OSInterface_private.cpp')
-rw-r--r--src-qt5/src-cpp/framework-OSInterface_private.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src-qt5/src-cpp/framework-OSInterface_private.cpp b/src-qt5/src-cpp/framework-OSInterface_private.cpp
index 7dfc8606..b4f4235e 100644
--- a/src-qt5/src-cpp/framework-OSInterface_private.cpp
+++ b/src-qt5/src-cpp/framework-OSInterface_private.cpp
@@ -6,7 +6,10 @@
//===========================================
// Internal, OS-agnostic functionality for managing the object itself
//===========================================
-#include <OSInterface.h>
+#include <framework-OSInterface.h>
+#include <QFile>
+#include <QDir>
+#include <QVariant>
OSInterface::OSInterface(QObject *parent) : QObject(parent){
watcher = 0;
@@ -29,7 +32,7 @@ OSInterface::~OSInterface(){
}
}
-OSInterface::OSInterface* instance(){
+OSInterface* OSInterface::instance(){
static OSInterface* m_os_object = 0;
if(m_os_object==0){
m_os_object = new OSInterface();
@@ -81,7 +84,7 @@ bool OSInterface::handleMediaDirChange(QString dir){ //returns true if directory
for(int i=0; i<files.length(); i++){ files[i] = qdir.absoluteFilePath(files[i]); }
QString key = "media_files/"+dir;
if(files.isEmpty() && INFO.contains(key)){ INFO.remove(key); emit mediaShortcutsChanged(); } //no files for this directory at the moment
- else{ INFO.setValue("media_files/"+dir, files); emit mediaShortcutsChanged(); } //save these file paths for later
+ else{ INFO.insert("media_files/"+dir, files); emit mediaShortcutsChanged(); } //save these file paths for later
//Make sure the directory is still watched (sometimes the dir is removed/recreated on modification)
if(!watcher->directories().contains(dir)){ watcher->addPath(dir); }
return true;
@@ -91,7 +94,7 @@ QStringList OSInterface::autoHandledMediaFiles(){
QStringList files;
QStringList keys = INFO.keys().filter("media_files/");
for(int i=0; i<keys.length(); i++){
- if(keys[i].startsWith("media_files/")){ files.append( INFO[keys[i]] ); }
+ if(keys[i].startsWith("media_files/")){ files << INFO[keys[i]].toStringList(); }
}
return files;
}
@@ -103,5 +106,5 @@ void OSInterface::setupNetworkManager(){
connectNetman();
}
//Load the initial state of the network accessibility
- netAccessChanged(netman->networkAccessibility());
+ netAccessChanged(netman->networkAccessible());
}
bgstack15