* Merged bugfix patches from Chakra project

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1172733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 7cdaac30f5
commit 8b9f540b42

@ -33,6 +33,7 @@
// QT includes // QT includes
#include <tqapplication.h> #include <tqapplication.h>
#include <tqfile.h> #include <tqfile.h>
#include <tqtextcodec.h>
// KDE includes // KDE includes
#include <kdebug.h> #include <kdebug.h>
@ -330,15 +331,20 @@ void Arch::slotReceivedTOC( KProcess*, char* data, int length )
bool Arch::processLine( const TQCString &line ) bool Arch::processLine( const TQCString &line )
{ {
TQString columns[ 11 ]; TQString columns[ 11 ];
TQString unicode_line;
unsigned int pos = 0; unsigned int pos = 0;
int strpos, len; int strpos, len;
TQTextCodec *codec = TQTextCodec::codecForLocale();
unicode_line = codec->toUnicode( line );
// Go through our columns, try to pick out data, return silently on failure // Go through our columns, try to pick out data, return silently on failure
for ( TQPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col ) for ( TQPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col )
{ {
ArchColumns *curCol = *col; ArchColumns *curCol = *col;
strpos = curCol->pattern.search( line, pos ); strpos = curCol->pattern.search( unicode_line, pos );
len = curCol->pattern.matchedLength(); len = curCol->pattern.matchedLength();
if ( ( strpos == -1 ) || ( len > curCol->maxLength ) ) if ( ( strpos == -1 ) || ( len > curCol->maxLength ) )
@ -354,7 +360,7 @@ bool Arch::processLine( const TQCString &line )
pos = strpos + len; pos = strpos + len;
columns[curCol->colRef] = TQString::fromLocal8Bit( line.mid(strpos, len) ); columns[curCol->colRef] = TQString::fromLocal8Bit( unicode_line.mid(strpos, len) );
} }

@ -1533,7 +1533,7 @@ ArkWidget::action_extract()
it != selectedFiles.constEnd(); it != selectedFiles.constEnd();
++it ) ++it )
{ {
m_extractList->append( TQFile::encodeName( *it ) ); m_extractList->append( *it );
} }
if (!bOvwrt) if (!bOvwrt)

@ -32,6 +32,7 @@
// QT includes // QT includes
#include <tqfile.h> #include <tqfile.h>
#include <tqdir.h> #include <tqdir.h>
#include <tqtextcodec.h>
// KDE includes // KDE includes
#include <kdebug.h> #include <kdebug.h>
@ -89,9 +90,14 @@ RarArch::RarArch( ArkWidget *_gui, const TQString & _fileName )
bool RarArch::processLine( const TQCString &line ) bool RarArch::processLine( const TQCString &line )
{ {
TQString unicode_line;
TQTextCodec *codec = TQTextCodec::codecForLocale();
unicode_line = codec->toUnicode( line );
if ( m_isFirstLine ) if ( m_isFirstLine )
{ {
m_entryFilename = TQString::fromLocal8Bit( line ); m_entryFilename = TQString::fromLocal8Bit( unicode_line );
m_entryFilename.remove( 0, 1 ); m_entryFilename.remove( 0, 1 );
m_isFirstLine = false; m_isFirstLine = false;
return true; return true;
@ -99,7 +105,7 @@ bool RarArch::processLine( const TQCString &line )
TQStringList list; TQStringList list;
TQStringList l2 = TQStringList::split( ' ', line ); TQStringList l2 = TQStringList::split( ' ', unicode_line );
list << m_entryFilename; // filename list << m_entryFilename; // filename
list << l2[ 0 ]; // size list << l2[ 0 ]; // size
@ -253,8 +259,10 @@ void RarArch::unarchFileInternal()
{ {
*kp << "-o-"; *kp << "-o-";
} }
TQTextCodec *codec = TQTextCodec::codecForLocale();
*kp << m_filename; *kp << codec->fromUnicode(m_filename);
// if the file list is empty, no filenames go on the command line, // if the file list is empty, no filenames go on the command line,
// and we then extract everything in the archive. // and we then extract everything in the archive.
@ -263,11 +271,11 @@ void RarArch::unarchFileInternal()
TQStringList::Iterator it; TQStringList::Iterator it;
for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) for ( it = m_fileList->begin(); it != m_fileList->end(); ++it )
{ {
*kp << (*it); *kp << codec->fromUnicode(*it);
} }
} }
*kp << m_destDir ; *kp << codec->fromUnicode(m_destDir);
connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ),
TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) );

@ -28,6 +28,7 @@
// Qt includes // Qt includes
#include <tqdir.h> #include <tqdir.h>
#include <tqtextcodec.h>
// KDE includes // KDE includes
#include <kdebug.h> #include <kdebug.h>
@ -207,8 +208,10 @@ void ZipArch::unarchFileInternal()
*kp << "-o"; *kp << "-o";
else else
*kp << "-n"; *kp << "-n";
TQTextCodec *codec = TQTextCodec::codecForLocale();
*kp << m_filename; *kp << codec->fromUnicode(m_filename);
// if the list is empty, no filenames go on the command line, // if the list is empty, no filenames go on the command line,
// and we then extract everything in the archive. // and we then extract everything in the archive.
@ -218,11 +221,12 @@ void ZipArch::unarchFileInternal()
for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) for ( it = m_fileList->begin(); it != m_fileList->end(); ++it )
{ {
*kp << (*it); *kp << codec->fromUnicode(*it);
} }
} }
*kp << "-d" << m_destDir; *kp << "-d";
*kp << codec->fromUnicode(m_destDir);
connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ),
TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) );

Loading…
Cancel
Save