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>

(cherry picked from commit d8d57cf6e8)
pull/30/head
Alexander Golubev 8 years ago committed by Michele Calgaro
parent 98837c22fe
commit f38d0cf308

@ -381,14 +381,30 @@ FileListView::contentsMouseMoveEvent(TQMouseEvent *e)
FileLVI* FileLVI*
FileListView::item(const TQString& filename) const FileListView::item(const TQString& filename) const
{ {
if (filename.isEmpty()) {
return 0;
}
TQStringList pathList = TQStringList::split( '/', filename );
FileLVI * flvi = (FileLVI*) firstChild(); FileLVI * flvi = (FileLVI*) firstChild();
// File path iterator
TQStringList::ConstIterator pathIt = pathList.begin(), pathEnd = pathList.end();
// Iterate over the current tree level siblings
while (flvi) while (flvi)
{ {
TQString curFilename = flvi->fileName(); if (flvi->fileName() == *pathIt || flvi->fileName() == (*pathIt).stripWhiteSpace()) {
if (curFilename == filename) ++pathIt;
return flvi; if (pathIt != pathEnd) {
flvi = (FileLVI*) flvi->nextSibling(); flvi = (FileLVI*) flvi->firstChild();
} else {
return flvi;
}
}
else {
flvi = (FileLVI*) flvi->nextSibling();
}
} }
return 0; return 0;

Loading…
Cancel
Save