|
Lines 84-92
Link Here
|
| 84 |
|
84 |
|
| 85 |
|
85 |
|
| 86 |
|
86 |
|
| 87 |
m_headerString = "-------------------------------------------------------------------------------"; |
87 |
m_headerString = "----------- --------- -------- ----- -------- ----- -------- ----"; |
| 88 |
|
|
|
| 89 |
m_isFirstLine = true; |
| 90 |
} |
88 |
} |
| 91 |
|
89 |
|
| 92 |
bool RarArch::processLine( const TQCString &line ) |
90 |
bool RarArch::processLine( const TQCString &line ) |
|
Lines 96-134
Link Here
|
| 96 |
TQTextCodec *codec = TQTextCodec::codecForLocale(); |
94 |
TQTextCodec *codec = TQTextCodec::codecForLocale(); |
| 97 |
unicode_line = codec->toUnicode( line ); |
95 |
unicode_line = codec->toUnicode( line ); |
| 98 |
|
96 |
|
| 99 |
if ( m_isFirstLine ) |
|
|
| 100 |
{ |
| 101 |
m_entryFilename = TQString::fromLocal8Bit( line ); |
| 102 |
m_entryFilename.remove( 0, 1 ); |
| 103 |
m_isFirstLine = false; |
| 104 |
return true; |
| 105 |
} |
| 106 |
|
| 107 |
TQStringList list; |
97 |
TQStringList list; |
| 108 |
|
98 |
|
| 109 |
TQStringList l2 = TQStringList::split( ' ', line ); |
99 |
TQStringList l2 = TQStringList::split( ' ', line ); |
| 110 |
|
100 |
|
| 111 |
if( l2[5].startsWith("d") ) |
101 |
// filename is after CRC column |
| 112 |
{ |
102 |
int idx = line.find(l2[6]) + l2[6].length() + 2; // beginning of file name |
| 113 |
m_isFirstLine = true; |
103 |
m_entryFilename = line.mid(idx); |
| 114 |
return true; |
|
|
| 115 |
} |
| 116 |
|
| 117 |
list << m_entryFilename; // filename |
104 |
list << m_entryFilename; // filename |
| 118 |
list << l2[ 0 ]; // size |
105 |
|
| 119 |
list << l2[ 1 ]; // packed |
106 |
list << l2[ 1 ]; // size |
| 120 |
list << l2[ 2 ]; // ratio |
107 |
list << l2[ 2 ]; // packed |
| 121 |
|
108 |
list << l2[ 3 ]; // ratio |
| 122 |
TQStringList date = TQStringList::split( '-', l2[ 3 ] ); |
109 |
|
| 123 |
list << ArkUtils::fixYear( date[ 2 ].latin1() ) + '-' + date[ 1 ] + '-' + date [ 0 ] + ' ' + l2[4]; // date |
110 |
TQStringList date = TQStringList::split( '-', l2[ 4 ] ); |
| 124 |
list << l2[ 5 ]; // attributes |
111 |
list << ArkUtils::fixYear( date[ 2 ].latin1() ) + '-' + date[ 1 ] + '-' + date [ 0 ] + ' ' + l2[5]; // date |
|
|
112 |
|
| 125 |
list << l2[ 6 ]; // crc |
113 |
list << l2[ 6 ]; // crc |
| 126 |
list << l2[ 7 ]; // method |
|
|
| 127 |
list << l2[ 8 ]; // Version |
| 128 |
|
114 |
|
| 129 |
m_gui->fileList()->addItem( list ); // send to GUI |
115 |
// send to GUI |
|
|
116 |
if ( l2[0] == "...D..." ) /* (un)rar v5 only */ |
| 117 |
{ |
| 118 |
// RAR utilities show the folders at the end of the listing so the folders |
| 119 |
// have been already added to the listview at this point without specifying |
| 120 |
// all the columns but name: let's fill the missing infos |
| 121 |
m_gui->fileList()->updateItem( list ); |
| 122 |
} |
| 123 |
else |
| 124 |
m_gui->fileList()->addItem( list ); |
| 130 |
|
125 |
|
| 131 |
m_isFirstLine = true; |
|
|
| 132 |
return true; |
126 |
return true; |
| 133 |
} |
127 |
} |
| 134 |
|
128 |
|
|
Lines 138-147
Link Here
|
| 138 |
list.append( PACKED_COLUMN ); |
138 |
list.append( PACKED_COLUMN ); |
| 139 |
list.append( RATIO_COLUMN ); |
139 |
list.append( RATIO_COLUMN ); |
| 140 |
list.append( TIMESTAMP_COLUMN ); |
140 |
list.append( TIMESTAMP_COLUMN ); |
| 141 |
list.append( PERMISSION_COLUMN ); |
|
|
| 142 |
list.append( CRC_COLUMN ); |
141 |
list.append( CRC_COLUMN ); |
| 143 |
list.append( METHOD_COLUMN ); |
|
|
| 144 |
list.append( VERSION_COLUMN ); |
| 145 |
|
142 |
|
| 146 |
emit headers( list ); |
143 |
emit headers( list ); |
| 147 |
} |
144 |
} |
|
Lines 270-276
Link Here
|
| 270 |
|
270 |
|
| 271 |
bool RarArch::passwordRequired() |
271 |
bool RarArch::passwordRequired() |
| 272 |
{ |
272 |
{ |
| 273 |
return m_lastShellOutput.find("Enter password") >= 0; |
273 |
return m_lastShellOutput.find("Enter password") >= 0 || m_lastShellOutput.find("encrypted") >= 0; |
| 274 |
} |
274 |
} |
| 275 |
|
275 |
|
| 276 |
void RarArch::remove( QStringList *list ) |
276 |
void RarArch::remove( QStringList *list ) |