aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-03-26 16:11:27 -0400
committerKen Moore <ken@pcbsd.org>2015-03-26 16:11:27 -0400
commit6a8abc0869565ab57d5a6ac73be39150926abb43 (patch)
tree1c199f778c924daba4fc9f214c5a79c2ec9938c1 /lumina-fm/MainUI.cpp
parentClean up the new filesystemusage functions a bit. Make sure that the director... (diff)
downloadlumina-6a8abc0869565ab57d5a6ac73be39150926abb43.tar.gz
lumina-6a8abc0869565ab57d5a6ac73be39150926abb43.tar.bz2
lumina-6a8abc0869565ab57d5a6ac73be39150926abb43.zip
Streamline quite a bit of the background worker:
1) Make sure the background routine *only* runs if the directory has changed or been modified (changing the view/config will no longer re-scan the dir) 2) Cleanup the number of translated strings in the dir info routine, and make it easily modified for larger file sizes (already increased to TB now). 3) Ensure that the whole-dir info is re-displayed if the selection is cleared.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r--lumina-fm/MainUI.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index c4b74dbd..e14d16d0 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -445,15 +445,18 @@ void MainUI::setCurrentDir(QString dir){
//qDebug() << "History:" << history;
tabBar->setTabData(tabBar->currentIndex(), history);
//Now adjust the items as necessary
- ui->tool_goToPlayer->setVisible(false);
- ui->tool_goToRestore->setVisible(false);
- ui->tool_goToImages->setVisible(false);
+ if(rawdir != olddir){
+ //The Filesystem model will need to load the new directory (triggering the background checks)
+ ui->tool_goToPlayer->setVisible(false);
+ ui->tool_goToRestore->setVisible(false);
+ ui->tool_goToImages->setVisible(false);
+ }
//Make sure the shortcut buttons are enabled as necessary
// If the dir is already loaded into the fsmodel cache it will not emit the directoryLoaded() signal
- if(rawdir == olddir){
+ /*if(rawdir == olddir){
emit DirChanged(rawdir); //This will be automatically run when a new dir is loaded
}
- emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), rawdir, tr("Items"));
+ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), rawdir, tr("Items"));*/
if(isUserWritable){ ui->label_dir_stats->setText(""); }
else{ ui->label_dir_stats->setText(tr("Limited Access Directory"));
}
@@ -551,7 +554,7 @@ void MainUI::AvailableBackups(QString basedir, QStringList snapdirs){
}
void MainUI::DisplayStatusBar(QString msg){
- qDebug() << "message to show in the status bar:" << msg;
+ //qDebug() << "message to show in the status bar:" << msg;
ui->statusbar->showMessage(msg);
}
@@ -846,6 +849,7 @@ void MainUI::currentDirectoryLoaded(){
ui->tool_goToRestore->setVisible(false);
ui->tool_goToImages->setVisible(false);
emit DirChanged(getCurrentDir());
+ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Items"));
ItemSelectionChanged();
}
@@ -978,7 +982,8 @@ void MainUI::ItemSelectionChanged(){
QFileInfoList sel = getSelectedItems();
//display info related to files selected.
//TO CHECK: impact if filesystem is very slow
- if (sel.size()>0) worker->createStatusBarMsg(sel, "", tr("Items selected"));
+ if(sel.size()>0){ emit Si_AdaptStatusBar(sel, "", tr("Items selected")); }
+ else{ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Items")); }
ui->tool_act_run->setEnabled(sel.length()==1);
ui->tool_act_runwith->setEnabled(sel.length()==1);
bgstack15