From 9e1288482bb0e1252082a086c416bdbf02c8bf7e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 17 Sep 2015 10:09:14 -0400 Subject: Make the snapshot load/reload operations "active", in that it will detect when the list of snapshots has changed and will reload the snapshots shown in the UI on demand. --- lumina-fm/widgets/DirWidget.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lumina-fm/widgets/DirWidget.cpp') diff --git a/lumina-fm/widgets/DirWidget.cpp b/lumina-fm/widgets/DirWidget.cpp index 4625b082..6b8fe976 100644 --- a/lumina-fm/widgets/DirWidget.cpp +++ b/lumina-fm/widgets/DirWidget.cpp @@ -226,6 +226,7 @@ void DirWidget::LoadDir(QString dir, QList list){ //This is a normal directory - prompt for snapshot information line_dir->setText(CDIR); normalbasedir = CDIR; + if(!snapbasedir.isEmpty()){ watcher->removePath(snapbasedir); } snapbasedir.clear(); loadsnaps = true; } @@ -234,8 +235,9 @@ void DirWidget::LoadDir(QString dir, QList list){ ui->group_snaps->setEnabled(false); //to prevent the snap updates to be automatically used ui->group_snaps->setVisible(false); ui->slider_snap->setRange(1,1); + emit findSnaps(ID, normalbasedir); } - emit findSnaps(ID, normalbasedir); + if(DEBUG){ qDebug() << "Update History:" <addPath(snapbasedir); //add this to the watcher in case snapshots get created/removed //Now update the UI as necessary ui->slider_snap->setRange(0, snaps.length()); @@ -898,8 +901,8 @@ void DirWidget::SelectionChanged(){ void DirWidget::startSync(const QString &file){ //Update date_format based on user settings - if(file == sessionsettings_config_file) - setDateFormat(); + if(file == sessionsettings_config_file){ setDateFormat(); } + if(file == snapbasedir){ emit findSnaps(ID, normalbasedir); } //snapshot list changed if(synctimer->isActive()){ synctimer->stop(); } synctimer->start(); } -- cgit