libsaria: Refilter during indexing
I trigger a REFILTER callback after each IndexTask is processed to keep the UI up to date with the current index.
This commit is contained in:
parent
f7bd0d873f
commit
6e033513c0
|
@ -10,6 +10,7 @@ using namespace std;
|
|||
|
||||
static map<string, set<ino_t> > substr_index;
|
||||
static set<ino_t> results;
|
||||
static string cur_filter;
|
||||
static bool filtered;
|
||||
|
||||
static void add_to_index(ino_t &inode, string &key)
|
||||
|
@ -65,6 +66,8 @@ void IndexTask::run_task()
|
|||
index_tag(inode, (*it)->get_artist_words());
|
||||
index_tag(inode, (*it)->get_album_words());
|
||||
}
|
||||
if (cur_filter != "")
|
||||
libsaria::library::filter(cur_filter);
|
||||
}
|
||||
|
||||
static void reindex_path(list<TrackTag> *tag_list)
|
||||
|
@ -164,6 +167,7 @@ namespace libsaria
|
|||
do_filter(key_list);
|
||||
filtered = true;
|
||||
}
|
||||
cur_filter = text;
|
||||
trigger_callback(REFILTER);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue