diff options
author | Ken Moore <moorekou@gmail.com> | 2015-09-17 10:09:14 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-09-17 10:09:14 -0400 |
commit | 9e1288482bb0e1252082a086c416bdbf02c8bf7e (patch) | |
tree | 8d2c564b4b98700dc45fb2b6a73a48555184f8c9 /lumina-fm/widgets/DirWidget.cpp | |
parent | Update lumina-fm to use the new LUtils::GenerateOpenTerminalExec() function f... (diff) | |
download | lumina-9e1288482bb0e1252082a086c416bdbf02c8bf7e.tar.gz lumina-9e1288482bb0e1252082a086c416bdbf02c8bf7e.tar.bz2 lumina-9e1288482bb0e1252082a086c416bdbf02c8bf7e.zip |
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.
Diffstat (limited to 'lumina-fm/widgets/DirWidget.cpp')
-rw-r--r-- | lumina-fm/widgets/DirWidget.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<LFileInfo> 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<LFileInfo> 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:" <<time.elapsed(); } //Now update the history for this browser //qDebug() << "History:" << history << normalbasedir << lastbasedir; @@ -457,6 +459,7 @@ void DirWidget::LoadSnaps(QString basedir, QStringList snaps){ //Save these value internally for use later snapbasedir = basedir; snapshots = snaps; + watcher->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(); } |