From 666db6b8c2d7704415946c0a8d69adb3cf5ae7f5 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 3 Sep 2013 08:16:46 +0200 Subject: 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... --- smdirmodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'smdirmodel.cpp') 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(){ -- cgit v1.2.3-70-g09d2