File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -146,17 +146,34 @@ bool CPanel::navigateBack()
146146{
147147 if (_currentDisplayMode != NormalMode)
148148 return setPath (currentDirPathPosix (), refreshCauseOther) == FileOperationResultCode::Ok;
149- else if (!_history.empty ())
150- return setPath (_history.navigateBack (), refreshCauseOther) == FileOperationResultCode::Ok;
151- else
149+
150+ if (_history.empty ())
152151 return false ;
152+
153+ while (!_history.isAtBeginning ())
154+ {
155+ const QString path = _history.navigateBack ();
156+ if (pathIsAccessible (path))
157+ {
158+ return setPath (path, refreshCauseOther) == FileOperationResultCode::Ok;
159+ }
160+ }
161+
162+ return false ;
153163}
154164
155165// Go to the next location from history, if any
156166bool CPanel::navigateForward ()
157167{
158- if (_currentDisplayMode == NormalMode && !_history.empty ())
159- return setPath (_history.navigateForward (), refreshCauseOther) == FileOperationResultCode::Ok;
168+ if (_currentDisplayMode != NormalMode || _history.empty ())
169+ return false ;
170+
171+ while (!_history.isAtEnd ())
172+ {
173+ const QString path = _history.navigateForward ();
174+ return setPath (path, refreshCauseOther) == FileOperationResultCode::Ok;
175+ }
176+
160177 return false ;
161178}
162179
You can’t perform that action at this time.
0 commit comments