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,15 +381,31 @@ 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)
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;
}

Loading…
Cancel
Save