summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <[email protected]>2016-08-20 21:44:47 +0900
committerMichele Calgaro <[email protected]>2016-08-20 21:56:21 +0900
commitf38d0cf308d7ba7f59466f8f9d0c5703397590ae (patch)
tree332c4dcc638818c5a30a7ce12259a35e3fc89f13
parent98837c22fe2134201e8ff8a6a1adf58981343650 (diff)
downloadtdeutils-f38d0cf308d7ba7f59466f8f9d0c5703397590ae.tar.gz
tdeutils-f38d0cf308d7ba7f59466f8f9d0c5703397590ae.zip
Ark: [rar module] fixed update of folder info for archives with multiple subfolders
Signed-off-by: Alexander Golubev <[email protected]> Fixed and partially reworked. Signed-off-by: Michele Calgaro <[email protected]> (cherry picked from commit d8d57cf6e803e70b62f3c630f6d54d9cc5350776)
-rw-r--r--ark/filelistview.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/ark/filelistview.cpp b/ark/filelistview.cpp
index f951a22..f1c941f 100644
--- a/ark/filelistview.cpp
+++ b/ark/filelistview.cpp
@@ -381,14 +381,30 @@ FileListView::contentsMouseMoveEvent(TQMouseEvent *e)
FileLVI*
FileListView::item(const TQString& filename) const
{
+ if (filename.isEmpty()) {
+ return 0;
+ }
+
+ TQStringList pathList = TQStringList::split( '/', filename );
+
FileLVI * flvi = (FileLVI*) firstChild();
+ // File path iterator
+ TQStringList::ConstIterator pathIt = pathList.begin(), pathEnd = pathList.end();
+ // Iterate over the current tree level siblings
while (flvi)
{
- TQString curFilename = flvi->fileName();
- if (curFilename == filename)
- return flvi;
- flvi = (FileLVI*) flvi->nextSibling();
+ if (flvi->fileName() == *pathIt || flvi->fileName() == (*pathIt).stripWhiteSpace()) {
+ ++pathIt;
+ if (pathIt != pathEnd) {
+ flvi = (FileLVI*) flvi->firstChild();
+ } else {
+ return flvi;
+ }
+ }
+ else {
+ flvi = (FileLVI*) flvi->nextSibling();
+ }
}
return 0;