summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2016-10-01 14:46:47 +0200
committerArno <arno@disconnect.de>2016-10-01 14:46:47 +0200
commit726e55799ea72e4e92a23535428eea5706ce5f56 (patch)
treedc6ced625a46e1357e6f7211871556683131a19e
parent9f7eb6110e21ecd3a058ff6ff4316c2c5605d172 (diff)
downloadSheMov-726e55799ea72e4e92a23535428eea5706ce5f56.tar.gz
SheMov-726e55799ea72e4e92a23535428eea5706ce5f56.tar.bz2
SheMov-726e55799ea72e4e92a23535428eea5706ce5f56.zip
Update free space when event occurs
Update free space when we get an inotify event that changes disk space, or when refresh is called.
-rw-r--r--shemov.cpp1
-rw-r--r--smdirmodel.cpp3
-rw-r--r--smdirmodel.h1
3 files changed, 5 insertions, 0 deletions
diff --git a/shemov.cpp b/shemov.cpp
index 0aa87fd..b43b530 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -128,6 +128,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
connect(mFSWidget->dirModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(setFsFree()));
connect(mFSWidget->dirModel(), SIGNAL(layoutChanged()), this, SLOT(setFsFree()));
connect(mFSWidget->dirModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(setFsFree()));
+ connect(mFSWidget->fileModel(), SIGNAL(fsFreeChanged()), this, SLOT(setFsFree()));
connect(this, SIGNAL(configChanged()), mFSWidget->fileView(), SLOT(readConfig()));
connect(this, SIGNAL(configChanged()), picViewer, SLOT(readSettings()));
connect(this, SIGNAL(configChanged()), c->archiveTreeModel(), SLOT(readConfig()));
diff --git a/smdirmodel.cpp b/smdirmodel.cpp
index b9394d8..0d4ca30 100644
--- a/smdirmodel.cpp
+++ b/smdirmodel.cpp
@@ -143,6 +143,7 @@ void SmDirModel::dirEvent(const QList<QVariant> &data, int e){
* modelReset();
*/
addFile(data);
+ emit fsFreeChanged();
return;
}
QModelIndex idx = find(data.at(Name), Name, rootIndex());
@@ -158,6 +159,7 @@ void SmDirModel::dirEvent(const QList<QVariant> &data, int e){
setData(c, data.at(i), Qt::EditRole);
}
}
+ emit fsFreeChanged();
}
void SmDirModel::readSettings(){
@@ -180,6 +182,7 @@ void SmDirModel::readSettings(){
void SmDirModel::refresh(){
setDir(mCurrentDir);
+ emit fsFreeChanged();
}
void SmDirModel::populate(SmTreeItem *root){
diff --git a/smdirmodel.h b/smdirmodel.h
index f8e647b..9128797 100644
--- a/smdirmodel.h
+++ b/smdirmodel.h
@@ -51,6 +51,7 @@ class SmDirModel : public SmTreeModel {
void needResize();
void totalFiles(int numFiles);
void progress();
+ void fsFreeChanged();
private:
SmDirWatcher *mWatch;