diff options
| author | Arno <am@disconnect.de> | 2013-03-03 12:05:21 +0100 | 
|---|---|---|
| committer | Arno <am@disconnect.de> | 2013-03-03 12:05:21 +0100 | 
| commit | a0fe997bbe54b98a6338aa28d8b008266e423081 (patch) | |
| tree | a949fcccf3485359684344a2a64e0b67a3962073 /filestreemodel.cpp | |
| parent | 1ddfe1550f718f268c8fd6f333f83898907c9ba9 (diff) | |
| download | SheMov-a0fe997bbe54b98a6338aa28d8b008266e423081.tar.gz SheMov-a0fe997bbe54b98a6338aa28d8b008266e423081.tar.bz2 SheMov-a0fe997bbe54b98a6338aa28d8b008266e423081.zip | |
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 :)
Diffstat (limited to 'filestreemodel.cpp')
| -rw-r--r-- | filestreemodel.cpp | 16 | 
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>();  } | 
