summaryrefslogtreecommitdiffstats
path: root/smdirmodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-09-03 08:16:46 +0200
committerArno <am@disconnect.de>2013-09-03 08:16:46 +0200
commit666db6b8c2d7704415946c0a8d69adb3cf5ae7f5 (patch)
tree16c3072a56baea84227b0874c048e223d485a601 /smdirmodel.cpp
parent130e0a3115cd66e38ec57846e06f69e7fd284400 (diff)
downloadSheMov-666db6b8c2d7704415946c0a8d69adb3cf5ae7f5.tar.gz
SheMov-666db6b8c2d7704415946c0a8d69adb3cf5ae7f5.tar.bz2
SheMov-666db6b8c2d7704415946c0a8d69adb3cf5ae7f5.zip
Introduce Expensive Operations
Add a configuration Option to (de-)select expensive file operations. That would be md5Summing and gathering the Bitrate/Duration. That should help the performance on networked directories...
Diffstat (limited to 'smdirmodel.cpp')
-rw-r--r--smdirmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/smdirmodel.cpp b/smdirmodel.cpp
index 6c84784..8a403d1 100644
--- a/smdirmodel.cpp
+++ b/smdirmodel.cpp
@@ -15,7 +15,7 @@
#include "smglobals.h"
#include "helper.h"
-SmDirModel::SmDirModel(const QStringList &headers, QObject *parent) : SmTreeModel(headers, parent), mHeaders(headers){
+SmDirModel::SmDirModel(const QStringList &headers, QObject *parent) : SmTreeModel(headers, parent), mHeaders(headers), mExpensiveOps(true){
mDb = QSqlDatabase::database("treedb");
mWatch = new SmDirWatcher(NumFields, this);
connect(mWatch, SIGNAL(needRefresh()), this, SLOT(refresh()));
@@ -102,7 +102,6 @@ bool SmDirModel::setData(const QModelIndex &index, const QVariant &value, int ro
QString newPath = QString("%1/%2").arg(dir).arg(newName);
QFile::rename(old, newPath);
emit needResize();
- // watcher->collector will do the rest
return true;
}
return SmTreeModel::setData(index, value, role);
@@ -177,6 +176,8 @@ void SmDirModel::readSettings(){
mRefreshTimer->start();
connect(mRefreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
}
+ bool expensive = s.value("ui/expensiveops", true).toBool();
+ mWatch->setExpensiveOps(expensive);
}
void SmDirModel::refresh(){