--- qftp.h.ORIG 2007-08-07 17:08:51.000000000 +0400+++ qftp.h 2007-10-02 21:02:53.000000000 +0400@@ -42,6 +42,7 @@ #include <QtCore/qstring.h> #include <QtNetwork/qurlinfo.h> #include <QtCore/qobject.h>+#include <QtCore/qtextcodec.h> QT_BEGIN_HEADER @@ -115,6 +116,8 @@ int rmdir(const QString &dir); int rename(const QString &oldname, const QString &newname); + void setTextCodec(QTextCodec*);+ int rawCommand(const QString &command); qint64 bytesAvailable() const;
--- qftp.cpp.ORIG 2007-08-07 17:08:51.000000000 +0400+++ qftp.cpp 2007-10-03 20:55:58.000000000 +0400@@ -75,6 +75,8 @@ QFtpDTP(QFtpPI *p, QObject *parent = 0); + QTextCodec *textCodec;+ void setData(QByteArray *); void setDevice(QIODevice *); void writeData();@@ -95,7 +97,7 @@ void abortConnection(); - static bool parseDir(const QByteArray &buffer, const QString &userName, QUrlInfo *info);+ bool parseDir(const QByteArray &buffer, const QString &userName, QUrlInfo *info); signals: void listInfo(const QUrlInfo&);@@ -278,6 +280,7 @@ pi(p), callWriteData(false) {+ textCodec = QTextCodec::codecForName("latin1"); clearData(); listener.setObjectName(QLatin1String("QFtpDTP active state server")); connect(&listener, SIGNAL(newConnection()), SLOT(setupSocket()));@@ -598,7 +601,7 @@ if (buffer.isEmpty()) return false; - QString bufferStr = QString::fromLatin1(buffer).trimmed();+ QString bufferStr = textCodec->toUnicode(buffer).trimmed(); // Unix style FTP servers QRegExp unixPattern(QLatin1String("^([\\-dl])([a-zA-Z\\-]{9,9})\\s+\\d+\\s+(\\S*)\\s+"@@ -2010,6 +2013,11 @@ return d_func()->addCommand(new QFtpCommand(Rename, cmds)); } +void QFtp::setTextCodec(QTextCodec* codec)+{+ d_func()->pi.dtp.textCodec = codec;+}+ /*! Sends the raw FTP command \a command to the FTP server. This is useful for low-level FTP access. If the operation you wish to