From dc603077a93b2b24d709126200e7c5ee8c1af83b Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 20 Mar 2013 17:05:39 +0100 Subject: Auto resize FileView Automatically resize FileView when it changes. I guess I was quite drunk on the first try. Fortunately I didn't commit it :) --- smdirmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'smdirmodel.cpp') diff --git a/smdirmodel.cpp b/smdirmodel.cpp index a02c47c..cf2197a 100644 --- a/smdirmodel.cpp +++ b/smdirmodel.cpp @@ -89,6 +89,7 @@ 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 SmTreeModel::setData(index, value, role); } @@ -136,6 +137,7 @@ void SmDirModel::dirEvent(const QString &file, int e){ setData(c, fData.at(i), Qt::EditRole); } } + emit needResize(); } void SmDirModel::readSettings(){ @@ -167,6 +169,7 @@ void SmDirModel::populate(){ root->appendChild(n); } setRoot(root); + emit needResize(); } const QList SmDirModel::fileData(const QFileInfo &fi) const{ -- cgit v1.2.3-70-g09d2