aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-09-17 10:09:14 -0400
committerKen Moore <moorekou@gmail.com>2015-09-17 10:09:14 -0400
commit9e1288482bb0e1252082a086c416bdbf02c8bf7e (patch)
tree8d2c564b4b98700dc45fb2b6a73a48555184f8c9
parentUpdate lumina-fm to use the new LUtils::GenerateOpenTerminalExec() function f... (diff)
downloadlumina-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.
-rw-r--r--lumina-fm/MainUI.cpp4
-rw-r--r--lumina-fm/widgets/DirWidget.cpp9
2 files changed, 8 insertions, 5 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index bdcbd75b..061a9758 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -614,7 +614,7 @@ void MainUI::OpenTerminal(QString dirpath){
QSettings sessionsettings( QSettings::UserScope, "LuminaDE","sessionsettings", this);
//xterm remains the default
QString defTerminal = sessionsettings.value("default-terminal", "xterm").toString();
- qDebug() << "Found default terminal:" << defTerminal;
+ //qDebug() << "Found default terminal:" << defTerminal;
//Now get the exec string and run it
QString cmd = LUtils::GenerateOpenTerminalExec(defTerminal, dirpath);
/*if(defTerminal.endsWith(".desktop")){
@@ -632,7 +632,7 @@ void MainUI::OpenTerminal(QString dirpath){
//-e is the parameter for most of the terminal appliction to execute an external command.
//In your case we start a shell in the selected directory
QProcess::startDetached(defTerminal + " -e \"cd " + dirpath + " && " + shell + " \" ");*/
- qDebug() << "Starting Terminal with command:" << cmd;
+ //qDebug() << "Starting Terminal with command:" << cmd;
QProcess::startDetached(cmd);
}
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();
}
bgstack15