Duplicate entries in 'Recent Folders' gtk3, fixes #3572

This commit is contained in:
heckflosse 2017-01-02 23:22:43 +01:00
parent d702156f8a
commit 7f6ded741c

View File

@ -54,8 +54,8 @@ void RecentBrowser::selectionChanged ()
void RecentBrowser::dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile)
{
size_t numFolders = options.recentFolders.size();
size_t i;
ssize_t numFolders = options.recentFolders.size();
ssize_t i = -1;
if(numFolders > 0) { // search entry and move to top if it exists
for(i = 0; i < numFolders; ++i) {
@ -81,8 +81,10 @@ void RecentBrowser::dirSelected (const Glib::ustring& dirname, const Glib::ustri
recentDirs->remove_text (i);
}
recentDirs->prepend (dirname);
recentDirs->set_active_text (dirname);
if(i != 0) {
recentDirs->prepend (dirname);
}
recentDirs->set_active (0);
conn.block (false);
}