From f4d47b31976bf0b95c8ee3e4c1f010ffe1d2fd21 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 12 Oct 2013 08:18:41 +0200 Subject: Fix resizing of columns in FileView Don't emit needResize after every model SmDirModel-change. It freezes the GUI. Let the user decide -> add a QAction to the toolBar. --- smdirmodel.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'smdirmodel.cpp') diff --git a/smdirmodel.cpp b/smdirmodel.cpp index 2b1e7dc..2cdfb8d 100644 --- a/smdirmodel.cpp +++ b/smdirmodel.cpp @@ -102,7 +102,6 @@ bool SmDirModel::setData(const QModelIndex &index, const QVariant &value, int ro QString dir = fileInfo(index).absolutePath(); QString newPath = QString("%1/%2").arg(dir).arg(newName); QFile::rename(old, newPath); - emit needResize(); return true; } return SmTreeModel::setData(index, value, role); @@ -160,7 +159,6 @@ void SmDirModel::dirEvent(const QList &data, int e){ } } } - emit needResize(); } void SmDirModel::readSettings(){ @@ -198,7 +196,7 @@ void SmDirModel::setMd5Sum(QString path, QString md5){ }else if(mimeType.startsWith("image")){ presentQ.prepare("SELECT COUNT(*) FROM pics WHERE cmd5sum = :md5"); }else{ - goto out; + return; } presentQ.bindValue(":md5", md5); presentQ.exec(); @@ -210,8 +208,6 @@ void SmDirModel::setMd5Sum(QString path, QString md5){ setData(presentIdx, present, Qt::EditRole); } } - out: - emit needResize(); } void SmDirModel::setFfmpeg(QString path, QVariantMap data){ @@ -222,7 +218,6 @@ void SmDirModel::setFfmpeg(QString path, QVariantMap data){ QModelIndex bitrateIdx = createIndex(idx.column(), Bitrate, idx.internalPointer()); setData(bitrateIdx, data["bit_rate"], Qt::EditRole); } - emit needResize(); } void SmDirModel::setPicSize(QString path, QVariant data){ @@ -231,7 +226,6 @@ void SmDirModel::setPicSize(QString path, QVariant data){ QModelIndex psIdx = createIndex(idx.column(), DurSize, idx.internalPointer()); setData(psIdx, data, Qt::EditRole); } - emit needResize(); } void SmDirModel::populate(SmTreeItem *root){ -- cgit v1.2.3-70-g09d2