From a0fe997bbe54b98a6338aa28d8b008266e423081 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 3 Mar 2013 12:05:21 +0100 Subject: Port to Qt5 * Change #include to qt5 * Fix missing QX11Info * use explicit constructor for QVariant(QColor) * use beginResetModel() and endResetModel() instead of reset(). The latter was removed. Hopefully it still works :) --- filestreemodel.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'filestreemodel.cpp') diff --git a/filestreemodel.cpp b/filestreemodel.cpp index 4f57267..b841e8a 100644 --- a/filestreemodel.cpp +++ b/filestreemodel.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -518,8 +518,8 @@ bool FilesTreeModel::updateSeries(int newSeries, QList 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(); - QVariant archived = s.value("ui/archivedcolor", Qt::black); + QVariant archived = s.value("ui/archivedcolor", QVariant(QColor(Qt::black))); mArchivedColor = archived.value(); - QVariant favorite = s.value("ui/favoritecolor", Qt::red); + QVariant favorite = s.value("ui/favoritecolor", QVariant(QColor(Qt::red))); mFavoriteColor = favorite.value(); } -- cgit v1.2.3-70-g09d2