diff options
author | Arno <am@disconnect.de> | 2013-10-12 08:18:41 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-10-12 08:18:41 +0200 |
commit | f4d47b31976bf0b95c8ee3e4c1f010ffe1d2fd21 (patch) | |
tree | ff5f353b15457dfa2688e625700d8294c85dc999 /smdirmodel.cpp | |
parent | 346b844eea4d5b19d51740b9b29d4f00d54fa373 (diff) | |
download | SheMov-f4d47b31976bf0b95c8ee3e4c1f010ffe1d2fd21.tar.gz SheMov-f4d47b31976bf0b95c8ee3e4c1f010ffe1d2fd21.tar.bz2 SheMov-f4d47b31976bf0b95c8ee3e4c1f010ffe1d2fd21.zip |
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.
Diffstat (limited to 'smdirmodel.cpp')
-rw-r--r-- | smdirmodel.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
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<QVariant> &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){ |