diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-11 23:09:20 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-11 23:09:20 +0200 |
commit | fb5b95cdce360a56e4fc4d690c739d78d332754e (patch) | |
tree | 83d8c8a88a6ea4f5774d3ca6e1464bdb607f5a01 /src/browser.cpp | |
parent | a9bee35cca51c3a192477aa87ad03f2b75f726ed (diff) |
browser: simplify function call
Diffstat (limited to 'src/browser.cpp')
-rw-r--r-- | src/browser.cpp | 8 |
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(); |