summaryrefslogtreecommitdiffstats
path: root/ark
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2016-08-20 21:44:47 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2016-08-20 21:44:47 +0900
commitd8d57cf6e803e70b62f3c630f6d54d9cc5350776 (patch)
treed07553190b07f7d75ce095672a3706ccdaec1253 /ark
parent64f5084c9e6da6bb8902ff081f92db54c4968829 (diff)
downloadtdeutils-d8d57cf6e803e70b62f3c630f6d54d9cc5350776.tar.gz
tdeutils-d8d57cf6e803e70b62f3c630f6d54d9cc5350776.zip
Ark: [rar module] fixed update of folder info for archives with multiple subfolders
Signed-off-by: Alexander Golubev <fatzer2@gmail.com> Fixed and partially reworked. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'ark')
-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;