From cc115a36157319f938d7c8fbfb24a4d32137183f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 17 Jul 2013 11:29:35 +0400 Subject: [PATCH] gui/filebrowser.cpp: restore selection, remove double paint on exec(), remember selected to restore on dir enter with OK button --- src/gui/filebrowser.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index b6aacabbd..2d3ae691d 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -845,8 +845,12 @@ bool CFileBrowser::exec(const char * const dirname) std::replace(name.begin(), name.end(), '\\', '/'); paintHead(); - ChangeDir(name); - paint(); + int selection = -1; + if (name == Path) + selection = selected; + + ChangeDir(name, selection); + //paint(); paintFoot(); int oldselected = selected; @@ -1071,7 +1075,10 @@ bool CFileBrowser::exec(const char * const dirname) ChangeDir(filelist[selected].Url); else #endif + { + selections.push_back(selected); ChangeDir(filelist[selected].Name); + } } else {