summaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2012-09-11 23:09:20 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2012-09-11 23:09:20 +0200
commitfb5b95cdce360a56e4fc4d690c739d78d332754e (patch)
tree83d8c8a88a6ea4f5774d3ca6e1464bdb607f5a01 /src/browser.cpp
parenta9bee35cca51c3a192477aa87ad03f2b75f726ed (diff)
browser: simplify function call
Diffstat (limited to 'src/browser.cpp')
-rw-r--r--src/browser.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index f41149af..cacc30d8 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -138,13 +138,7 @@ void Browser::EnterPressed()
case itDirectory:
{
if (isParentDirectory(item))
- {
- size_t slash = itsBrowsedDir.rfind("/");
- if (slash != std::string::npos)
- GetDirectory(itsBrowsedDir.substr(0, slash), itsBrowsedDir);
- else
- GetDirectory("/", itsBrowsedDir);
- }
+ GetDirectory(getParentDirectory(itsBrowsedDir), itsBrowsedDir);
else
GetDirectory(item.name, itsBrowsedDir);
DrawHeader();