summaryrefslogtreecommitdiffstats
path: root/ark/rar.cpp
diff options
context:
space:
mode:
authorFabio Rossi <rossi.f@inwind.it>2016-04-23 22:19:52 +1000
committerMichele Calgaro <michele.calgaro@yahoo.it>2016-04-23 22:23:45 +1000
commit1ac492f796364b35a681c1bab1dce81e1798b365 (patch)
tree588604f2ed96602195641f5ae5d0864162f2a828 /ark/rar.cpp
parent0123b079a9817ccd7bf4791db673b77414dad414 (diff)
downloadtdeutils-1ac492f796364b35a681c1bab1dce81e1798b365.tar.gz
tdeutils-1ac492f796364b35a681c1bab1dce81e1798b365.zip
Ark: info for folders in rar archives are now displayed as well.
This relates to bug 2541. Signed-off-by: Fabio Rossi <rossi.f@inwind.it> Patch updated and slightly reworked to fit TQt framework Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 058176316ee0b92a9d50d0c842690869af09e3de)
Diffstat (limited to 'ark/rar.cpp')
-rw-r--r--ark/rar.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/ark/rar.cpp b/ark/rar.cpp
index e47c78a..103f4ce 100644
--- a/ark/rar.cpp
+++ b/ark/rar.cpp
@@ -133,13 +133,6 @@ bool RarArch::processLine( const TQCString &line )
if (m_version < VERSION_5)
{
- if( l2[5].startsWith("d") )
- {
- // Folder item
- m_isFirstLine = true;
- return true;
- }
-
list << m_entryFilename; // filename
list << l2[ 0 ]; // size
list << l2[ 1 ]; // packed
@@ -151,19 +144,11 @@ bool RarArch::processLine( const TQCString &line )
list << l2[ 6 ]; // crc
list << l2[ 7 ]; // method
list << l2[ 8 ]; // Version
-
- m_gui->fileList()->addItem( list ); // send to GUI
-
+
m_isFirstLine = true;
}
else
{
- if( l2[0].startsWith("d") )
- {
- // Folder item
- return true;
- }
-
m_entryFilename = line.mid(line.find(l2[7]));
list << m_entryFilename; // filename
list << l2[ 1 ]; // size
@@ -174,9 +159,18 @@ bool RarArch::processLine( const TQCString &line )
list << l2[ 4 ] + " " + l2[ 5 ]; // date and time
list << l2[ 0 ]; // attributes
list << l2[ 6 ]; // crc
-
- m_gui->fileList()->addItem( list ); // send to GUI
}
+ // send to GUI
+ if ( l2[6] == "00000000" )
+ {
+ // folders have CRC equal to 00000000
+ // RAR utilities show the folders at the end of the listing so the folders
+ // have been already added to the listview at this point without specifying
+ // all the columns but the name. Update the item with the missing info
+ m_gui->fileList()->updateItem( list );
+ }
+ else
+ m_gui->fileList()->addItem( list );
return true;
}
@@ -355,7 +349,7 @@ void RarArch::unarchFileInternal()
bool RarArch::passwordRequired()
{
- return m_lastShellOutput.find("Enter password") >= 0;
+ return m_lastShellOutput.find("Enter password") >= 0 || m_lastShellOutput.find("encrypted") >= 0;
}
void RarArch::remove( TQStringList *list )