summaryrefslogtreecommitdiffstats
path: root/filestreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'filestreemodel.cpp')
-rw-r--r--filestreemodel.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/filestreemodel.cpp b/filestreemodel.cpp
index 4f57267..b841e8a 100644
--- a/filestreemodel.cpp
+++ b/filestreemodel.cpp
@@ -14,7 +14,7 @@
#include <QProcess>
#include <QImage>
#include <QDataStream>
-#include <QDesktopServices>
+#include <QStandardPaths>
#include <QDir>
#include <QFont>
#include <QSettings>
@@ -518,8 +518,8 @@ bool FilesTreeModel::updateSeries(int newSeries, QList<QPersistentModelIndex> fi
void FilesTreeModel::readCache(){
- QString settingsDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
- QString cacheFile = QString("%1/%2").arg(settingsDir).arg("sizeduration.cache");
+ QString settingsDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
+ QString cacheFile = QString("%1/%2").arg(settingsDir).arg("sizeduration.cache");
QFileInfo fi(cacheFile);
if(!fi.exists()){
return;
@@ -542,12 +542,12 @@ void FilesTreeModel::readCache(){
}
void FilesTreeModel::writeCache(){
- QString settingsDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+ QString settingsDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
QFileInfo fi(settingsDir);
if(!fi.exists()){
QDir root = QDir::root();
root.mkpath(settingsDir);
- }
+ }
QString cacheFile = QString("%1/%2").arg(settingsDir).arg("sizeduration.cache");
QFile cache(cacheFile);
cache.open(QIODevice::WriteOnly);
@@ -562,11 +562,11 @@ void FilesTreeModel::writeCache(){
void FilesTreeModel::readSettings(){
QSettings s;
- QVariant local = s.value("ui/localcolor", Qt::darkBlue);
+ QVariant local = s.value("ui/localcolor", QVariant(QColor(Qt::darkBlue)));
mLocalColor = local.value<QColor>();
- QVariant archived = s.value("ui/archivedcolor", Qt::black);
+ QVariant archived = s.value("ui/archivedcolor", QVariant(QColor(Qt::black)));
mArchivedColor = archived.value<QColor>();
- QVariant favorite = s.value("ui/favoritecolor", Qt::red);
+ QVariant favorite = s.value("ui/favoritecolor", QVariant(QColor(Qt::red)));
mFavoriteColor = favorite.value<QColor>();
}