When opening an empty folder, file browser shows image count from previous non-empty folder, Issue 606

This commit is contained in:
Ingo
2015-05-17 20:40:57 +02:00
parent dc7929f7cb
commit 64426f7822
4 changed files with 10 additions and 2 deletions

View File

@@ -1181,6 +1181,7 @@ void FileBrowser::applyFilter (const BrowserFilter& filter) {
if (selchanged) if (selchanged)
notifySelectionListener (); notifySelectionListener ();
tbl->filterApplied();
redraw (); redraw ();
} }

View File

@@ -38,6 +38,7 @@ class FileBrowserListener {
public: public:
virtual ~FileBrowserListener () {} virtual ~FileBrowserListener () {}
virtual void filterApplied () {}
virtual void openRequested (std::vector<Thumbnail*> tbe) {} virtual void openRequested (std::vector<Thumbnail*> tbe) {}
virtual void developRequested (std::vector<FileBrowserEntry*> tbe, bool fastmode) {} virtual void developRequested (std::vector<FileBrowserEntry*> tbe, bool fastmode) {}
virtual void renameRequested (std::vector<FileBrowserEntry*> tbe) {} virtual void renameRequested (std::vector<FileBrowserEntry*> tbe) {}

View File

@@ -564,7 +564,7 @@ void FileCatalog::_refreshProgressBar () {
hbb = Gtk::manage (new Gtk::HBox ()); hbb = Gtk::manage (new Gtk::HBox ());
if (!previewsToLoad ) { if (!previewsToLoad ) {
hbb->pack_start (*Gtk::manage (new Gtk::Image (Gtk::Stock::DIRECTORY, Gtk::ICON_SIZE_MENU))); hbb->pack_start (*Gtk::manage (new Gtk::Image (Gtk::Stock::DIRECTORY, Gtk::ICON_SIZE_MENU)));
int filteredCount=fileBrowser->getNumFiltered(); int filteredCount = min(fileBrowser->getNumFiltered(),previewsLoaded);
label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER")+ label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER")+
(filteredCount!=previewsLoaded ? " ["+ Glib::ustring::format(filteredCount)+"/" : " (") (filteredCount!=previewsLoaded ? " ["+ Glib::ustring::format(filteredCount)+"/" : " (")
@@ -590,6 +590,11 @@ int refreshProgressBarUI (void* data) {
return 0; return 0;
} }
void FileCatalog::filterApplied() {
g_idle_add (refreshProgressBarUI, this);
}
void FileCatalog::previewReady (int dir_id, FileBrowserEntry* fdn) { void FileCatalog::previewReady (int dir_id, FileBrowserEntry* fdn) {
if ( dir_id != selectedDirectoryId ) if ( dir_id != selectedDirectoryId )

View File

@@ -259,6 +259,7 @@ class FileCatalog : public Gtk::VBox,
void showToolBar(); void showToolBar();
void hideToolBar(); void hideToolBar();
void filterApplied();
#ifndef _WIN32 #ifndef _WIN32
void on_dir_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, bool internal); void on_dir_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, bool internal);