diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 04:10:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 04:10:07 +0000 |
commit | fd3a982e26813f5bcc82c7e89ce6fa2ad44432bf (patch) | |
tree | 9eda848e56fcb862fdfdf479adeccd95b6fe387a /kioslave/sftp | |
parent | 02f67d0e1355b79b1806746efb0f2f640e57f13d (diff) | |
download | tdebase-fd3a982e26813f5bcc82c7e89ce6fa2ad44432bf.tar.gz tdebase-fd3a982e26813f5bcc82c7e89ce6fa2ad44432bf.zip |
Revert automated changes
Sorry guys, they are just not ready for prime time
Work will continue as always
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1212480 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/sftp')
-rw-r--r-- | kioslave/sftp/kio_sftp.cpp | 236 | ||||
-rw-r--r-- | kioslave/sftp/kio_sftp.h | 12 | ||||
-rw-r--r-- | kioslave/sftp/ksshprocess.cpp | 14 | ||||
-rw-r--r-- | kioslave/sftp/ksshprocess.h | 4 | ||||
-rw-r--r-- | kioslave/sftp/process.cpp | 4 | ||||
-rw-r--r-- | kioslave/sftp/sftpfileattr.cpp | 24 | ||||
-rw-r--r-- | kioslave/sftp/sftpfileattr.h | 12 |
7 files changed, 153 insertions, 153 deletions
diff --git a/kioslave/sftp/kio_sftp.cpp b/kioslave/sftp/kio_sftp.cpp index ab9c78707..456d47084 100644 --- a/kioslave/sftp/kio_sftp.cpp +++ b/kioslave/sftp/kio_sftp.cpp @@ -291,7 +291,7 @@ void sftpProtocol::sftpCopyGet(const KURL& dest, const KURL& src, int mode, bool return; } - tqStatus info = sftpGet(src, offset, fd); + Status info = sftpGet(src, offset, fd); if ( info.code != 0 ) { // Should we keep the partially downloaded file ?? @@ -324,12 +324,12 @@ void sftpProtocol::sftpCopyGet(const KURL& dest, const KURL& src, int mode, bool finished(); } -sftpProtocol::tqStatus sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t offset, int fd ) +sftpProtocol::Status sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t offset, int fd ) { int code; sftpFileAttr attr(remoteEncoding()); - tqStatus res; + Status res; res.code = 0; res.size = 0; @@ -337,7 +337,7 @@ sftpProtocol::tqStatus sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t o // stat the file first to get its size if( (code = sftpStat(src, attr)) != SSH2_FX_OK ) { - return doProcesstqStatus(code, src.prettyURL()); + return doProcessStatus(code, src.prettyURL()); } // We cannot get file if it is a directory @@ -348,7 +348,7 @@ sftpProtocol::tqStatus sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t o } KIO::filesize_t fileSize = attr.fileSize(); - TQ_UINT32 pflags = SSH2_FXF_READ; + Q_UINT32 pflags = SSH2_FXF_READ; attr.clear(); TQByteArray handle; @@ -368,7 +368,7 @@ sftpProtocol::tqStatus sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t o // How big should each data packet be? Definitely not bigger than 64kb or // you will overflow the 2 byte size variable in a sftp packet. - TQ_UINT32 len = 60*1024; + Q_UINT32 len = 60*1024; code = SSH2_FX_OK; kdDebug(KIO_SFTP_DB) << "sftpGet(): offset = " << offset << endl; @@ -385,7 +385,7 @@ sftpProtocol::tqStatus sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t o if( mimeBuffer.size() > 1024 || offset == fileSize ) { // determine mimetype KMimeMagicResult* result = - KMimeMagic::self()->tqfindBufferFileType(mimeBuffer, src.fileName()); + KMimeMagic::self()->findBufferFileType(mimeBuffer, src.fileName()); kdDebug(KIO_SFTP_DB) << "sftpGet(): mimetype is " << result->mimeType() << endl; mimeType(result->mimeType()); @@ -449,13 +449,13 @@ void sftpProtocol::get(const KURL& url) { return; // Get resume offset - TQ_UINT64 offset = config()->readUnsignedLongNumEntry("resume"); + Q_UINT64 offset = config()->readUnsignedLongNumEntry("resume"); if( offset > 0 ) { canResume(); kdDebug(KIO_SFTP_DB) << "get(): canResume(), offset = " << offset << endl; } - tqStatus info = sftpGet(url, offset); + Status info = sftpGet(url, offset); if (info.code != 0) { @@ -772,16 +772,16 @@ void sftpProtocol::openConnection() { kdDebug(KIO_SFTP_DB) << "openConnection(): Sending SSH2_FXP_INIT packet." << endl; TQByteArray p; TQDataStream packet(p, IO_WriteOnly); - packet << (TQ_UINT32)5; // packet length - packet << (TQ_UINT8) SSH2_FXP_INIT; // packet type - packet << (TQ_UINT32)SSH2_FILEXFER_VERSION; // client version + packet << (Q_UINT32)5; // packet length + packet << (Q_UINT8) SSH2_FXP_INIT; // packet type + packet << (Q_UINT32)SSH2_FILEXFER_VERSION; // client version putPacket(p); getPacket(p); TQDataStream s(p, IO_ReadOnly); - TQ_UINT32 version; - TQ_UINT8 type; + Q_UINT32 version; + Q_UINT8 type; s >> type; kdDebug(KIO_SFTP_DB) << "openConnection(): Got type " << type << endl; @@ -895,7 +895,7 @@ void sftpProtocol::sftpPut( const KURL& dest, int permissions, bool resume, bool } } else if( code != SSH2_FX_NO_SUCH_FILE ) { - processtqStatus(code, origUrl.prettyURL()); + processStatus(code, origUrl.prettyURL()); return; } @@ -910,7 +910,7 @@ void sftpProtocol::sftpPut( const KURL& dest, int permissions, bool resume, bool KURL partUrl( origUrl ); partUrl.setFileName( partUrl.fileName() + ".part" ); - TQ_UINT64 offset = 0; + Q_UINT64 offset = 0; bool partExists = false; bool markPartial = config()->readBoolEntry("MarkPartial", true); @@ -966,7 +966,7 @@ void sftpProtocol::sftpPut( const KURL& dest, int permissions, bool resume, bool } } else { - processtqStatus(code, partUrl.prettyURL()); + processStatus(code, partUrl.prettyURL()); return; } } @@ -974,7 +974,7 @@ void sftpProtocol::sftpPut( const KURL& dest, int permissions, bool resume, bool // Determine the url we will actually write to... KURL writeUrl (markPartial ? partUrl:origUrl); - TQ_UINT32 pflags = 0; + Q_UINT32 pflags = 0; if( overwrite && !resume ) pflags = SSH2_FXF_WRITE | SSH2_FXF_CREAT | SSH2_FXF_TRUNC; else if( !overwrite && !resume ) @@ -1007,7 +1007,7 @@ void sftpProtocol::sftpPut( const KURL& dest, int permissions, bool resume, bool return; } else { - processtqStatus(code, writeUrl.prettyURL()); + processStatus(code, writeUrl.prettyURL()); return; } } @@ -1134,7 +1134,7 @@ void sftpProtocol::stat ( const KURL& url ){ int code; sftpFileAttr attr(remoteEncoding()); if( (code = sftpStat(url, attr)) != SSH2_FX_OK ) { - processtqStatus(code, url.prettyURL()); + processStatus(code, url.prettyURL()); return; } else { @@ -1157,7 +1157,7 @@ void sftpProtocol::mimetype ( const KURL& url ){ if( !mConnected ) return; - TQ_UINT32 pflags = SSH2_FXF_READ; + Q_UINT32 pflags = SSH2_FXF_READ; TQByteArray handle, mydata; sftpFileAttr attr(remoteEncoding()); int code; @@ -1166,8 +1166,8 @@ void sftpProtocol::mimetype ( const KURL& url ){ return; } - TQ_UINT32 len = 1024; // Get first 1k for determining mimetype - TQ_UINT64 offset = 0; + Q_UINT32 len = 1024; // Get first 1k for determining mimetype + Q_UINT64 offset = 0; code = SSH2_FX_OK; while( offset < len && code == SSH2_FX_OK ) { if( (code = sftpRead(handle, offset, len, mydata)) == SSH2_FX_OK ) { @@ -1210,7 +1210,7 @@ void sftpProtocol::listDir(const KURL& url) { if( (code = sftpOpenDirectory(url, handle)) != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "listDir(): open directory failed" << endl; - processtqStatus(code, url.prettyURL()); + processStatus(code, url.prettyURL()); return; } @@ -1219,13 +1219,13 @@ void sftpProtocol::listDir(const KURL& url) { while( code == SSH2_FX_OK ) { code = sftpReadDir(handle, url); if( code != SSH2_FX_OK && code != SSH2_FX_EOF ) - processtqStatus(code, url.prettyURL()); + processStatus(code, url.prettyURL()); kdDebug(KIO_SFTP_DB) << "listDir(): return code = " << code << endl; } if( (code = sftpClose(handle)) != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "listdir(): closing of directory failed" << endl; - processtqStatus(code, url.prettyURL()); + processStatus(code, url.prettyURL()); return; } @@ -1256,13 +1256,13 @@ void sftpProtocol::mkdir(const KURL&url, int permissions){ if (permissions != -1) attr.setPermissions(permissions); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << TQ_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size()); - s << (TQ_UINT8)SSH2_FXP_MKDIR; + s << Q_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size()); + s << (Q_UINT8)SSH2_FXP_MKDIR; s << id; s.writeBytes(path.data(), len); s << attr; @@ -1272,7 +1272,7 @@ void sftpProtocol::mkdir(const KURL&url, int permissions){ putPacket(p); getPacket(p); - TQ_UINT8 type; + Q_UINT8 type; TQDataStream r(p, IO_ReadOnly); r >> type >> id; @@ -1344,14 +1344,14 @@ void sftpProtocol::rename(const KURL& src, const KURL& dest, bool overwrite){ // If overwrite is specified, then simply remove the existing file/dir first... if( (code = sftpRemove( dest, !S_ISDIR(attr.permissions()) )) != SSH2_FX_OK ) { - processtqStatus(code); + processStatus(code); return; } } // Do the renaming... if( (code = sftpRename(src, dest)) != SSH2_FX_OK ) { - processtqStatus(code); + processStatus(code); return; } @@ -1404,7 +1404,7 @@ void sftpProtocol::symlink(const TQString& target, const KURL& dest, bool overwr // What error code do we return? Code for the original symlink command // or for the last command or for both? The second one is implemented here. if( failed ) - processtqStatus(code); + processStatus(code); finished(); } @@ -1429,7 +1429,7 @@ void sftpProtocol::chmod(const KURL& url, int permissions){ if( code == SSH2_FX_FAILURE ) error(ERR_CANNOT_CHMOD, TQString::null); else - processtqStatus(code, url.prettyURL()); + processStatus(code, url.prettyURL()); } finished(); } @@ -1445,7 +1445,7 @@ void sftpProtocol::del(const KURL &url, bool isfile){ int code; if( (code = sftpRemove(url, isfile)) != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "del(): sftpRemove failed with error code " << code << endl; - processtqStatus(code, url.prettyURL()); + processStatus(code, url.prettyURL()); } finished(); } @@ -1454,7 +1454,7 @@ void sftpProtocol::slave_status() { kdDebug(KIO_SFTP_DB) << "slave_status(): connected to " << mHost << "? " << mConnected << endl; - slavetqStatus ((mConnected ? mHost : TQString::null), mConnected); + slaveStatus ((mConnected ? mHost : TQString::null), mConnected); } bool sftpProtocol::getPacket(TQByteArray& msg) { @@ -1538,20 +1538,20 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){ TQCString path = remoteEncoding()->encode(url.path()); uint len = path.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << TQ_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); - s << (TQ_UINT8)SSH2_FXP_REALPATH; + s << Q_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); + s << (Q_UINT8)SSH2_FXP_REALPATH; s << id; s.writeBytes(path.data(), len); putPacket(p); getPacket(p); - TQ_UINT8 type; + Q_UINT8 type; TQDataStream r(p, IO_ReadOnly); r >> type >> id; @@ -1561,7 +1561,7 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){ } if( type == SSH2_FXP_STATUS ) { - TQ_UINT32 code; + Q_UINT32 code; r >> code; return code; } @@ -1571,7 +1571,7 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){ return -1; } - TQ_UINT32 count; + Q_UINT32 count; r >> count; if( count != 1 ) { kdError(KIO_SFTP_DB) << "sftpRealPath(): Bad number of file attributes for realpath command" << endl; @@ -1589,9 +1589,9 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){ return SSH2_FX_OK; } -sftpProtocol::tqStatus sftpProtocol::doProcesstqStatus(TQ_UINT8 code, const TQString& message) +sftpProtocol::Status sftpProtocol::doProcessStatus(Q_UINT8 code, const TQString& message) { - tqStatus res; + Status res; res.code = 0; res.size = 0; res.text = message; @@ -1628,8 +1628,8 @@ sftpProtocol::tqStatus sftpProtocol::doProcesstqStatus(TQ_UINT8 code, const TQSt } /** Process SSH_FXP_STATUS packets. */ -void sftpProtocol::processtqStatus(TQ_UINT8 code, const TQString& message){ - tqStatus st = doProcesstqStatus( code, message ); +void sftpProtocol::processStatus(Q_UINT8 code, const TQString& message){ + Status st = doProcessStatus( code, message ); if( st.code != 0 ) error( st.code, st.text ); } @@ -1642,21 +1642,21 @@ int sftpProtocol::sftpOpenDirectory(const KURL& url, TQByteArray& handle){ TQCString path = remoteEncoding()->encode(url.path()); uint len = path.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); - s << (TQ_UINT8)SSH2_FXP_OPENDIR; - s << (TQ_UINT32)id; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); + s << (Q_UINT8)SSH2_FXP_OPENDIR; + s << (Q_UINT32)id; s.writeBytes(path.data(), len); putPacket(p); getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -1666,7 +1666,7 @@ int sftpProtocol::sftpOpenDirectory(const KURL& url, TQByteArray& handle){ } if( type == SSH2_FXP_STATUS ) { - TQ_UINT32 errCode; + Q_UINT32 errCode; r >> errCode; return errCode; } @@ -1691,21 +1691,21 @@ int sftpProtocol::sftpClose(const TQByteArray& handle){ kdDebug(KIO_SFTP_DB) << "sftpClose()" << endl; - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size()); - s << (TQ_UINT8)SSH2_FXP_CLOSE; - s << (TQ_UINT32)id; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size()); + s << (Q_UINT8)SSH2_FXP_CLOSE; + s << (Q_UINT32)id; s << handle; putPacket(p); getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -1718,7 +1718,7 @@ int sftpProtocol::sftpClose(const TQByteArray& handle){ return -1; } - TQ_UINT32 code; + Q_UINT32 code; r >> code; if( code != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "sftpClose: close failed with err code " << code << endl; @@ -1735,14 +1735,14 @@ int sftpProtocol::sftpSetStat(const KURL& url, const sftpFileAttr& attr){ TQCString path = remoteEncoding()->encode(url.path()); uint len = path.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size()); - s << (TQ_UINT8)SSH2_FXP_SETSTAT; - s << (TQ_UINT32)id; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size()); + s << (Q_UINT8)SSH2_FXP_SETSTAT; + s << (Q_UINT32)id; s.writeBytes(path.data(), len); s << attr; @@ -1750,7 +1750,7 @@ int sftpProtocol::sftpSetStat(const KURL& url, const sftpFileAttr& attr){ getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -1764,7 +1764,7 @@ int sftpProtocol::sftpSetStat(const KURL& url, const sftpFileAttr& attr){ return -1; } - TQ_UINT32 code; + Q_UINT32 code; r >> code; if( code != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "sftpSetStat(): set stat failed with err code " << code << endl; @@ -1781,21 +1781,21 @@ int sftpProtocol::sftpRemove(const KURL& url, bool isfile){ TQCString path = remoteEncoding()->encode(url.path()); uint len = path.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); - s << (TQ_UINT8)(isfile ? SSH2_FXP_REMOVE : SSH2_FXP_RMDIR); - s << (TQ_UINT32)id; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); + s << (Q_UINT8)(isfile ? SSH2_FXP_REMOVE : SSH2_FXP_RMDIR); + s << (Q_UINT32)id; s.writeBytes(path.data(), len); putPacket(p); getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -1808,7 +1808,7 @@ int sftpProtocol::sftpRemove(const KURL& url, bool isfile){ return -1; } - TQ_UINT32 code; + Q_UINT32 code; r >> code; if( code != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "del(): del failed with err code " << code << endl; @@ -1828,16 +1828,16 @@ int sftpProtocol::sftpRename(const KURL& src, const KURL& dest){ uint slen = srcPath.length(); uint dlen = destPath.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + slen + 4 /*str length*/ + dlen); - s << (TQ_UINT8)SSH2_FXP_RENAME; - s << (TQ_UINT32)id; + s << (Q_UINT8)SSH2_FXP_RENAME; + s << (Q_UINT32)id; s.writeBytes(srcPath.data(), slen); s.writeBytes(destPath.data(), dlen); @@ -1845,7 +1845,7 @@ int sftpProtocol::sftpRename(const KURL& src, const KURL& dest){ getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -1871,8 +1871,8 @@ int sftpProtocol::sftpReadDir(const TQByteArray& handle, const KURL& url){ // url is needed so we can lookup the link destination kdDebug(KIO_SFTP_DB) << "sftpReadDir(): " << url << endl; - TQ_UINT32 id, expectedId, count; - TQ_UINT8 type; + Q_UINT32 id, expectedId, count; + Q_UINT8 type; sftpFileAttr attr (remoteEncoding()); attr.setDirAttrsFlag(true); @@ -1880,9 +1880,9 @@ int sftpProtocol::sftpReadDir(const TQByteArray& handle, const KURL& url){ TQByteArray p; TQDataStream s(p, IO_WriteOnly); id = expectedId = mMsgId++; - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size()); - s << (TQ_UINT8)SSH2_FXP_READDIR; - s << (TQ_UINT32)id; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size()); + s << (Q_UINT8)SSH2_FXP_READDIR; + s << (Q_UINT32)id; s << handle; putPacket(p); @@ -1943,13 +1943,13 @@ int sftpProtocol::sftpReadLink(const KURL& url, TQString& target){ //kdDebug(KIO_SFTP_DB) << "sftpReadLink(): Encoded Path: " << path << endl; //kdDebug(KIO_SFTP_DB) << "sftpReadLink(): Encoded Size: " << len << endl; - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); - s << (TQ_UINT8)SSH2_FXP_READLINK; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); + s << (Q_UINT8)SSH2_FXP_READLINK; s << id; s.writeBytes(path.data(), len); @@ -1957,7 +1957,7 @@ int sftpProtocol::sftpReadLink(const KURL& url, TQString& target){ putPacket(p); getPacket(p); - TQ_UINT8 type; + Q_UINT8 type; TQDataStream r(p, IO_ReadOnly); r >> type >> id; @@ -1967,7 +1967,7 @@ int sftpProtocol::sftpReadLink(const KURL& url, TQString& target){ } if( type == SSH2_FXP_STATUS ) { - TQ_UINT32 code; + Q_UINT32 code; r >> code; kdDebug(KIO_SFTP_DB) << "sftpReadLink(): read link failed with code " << code << endl; return code; @@ -1978,7 +1978,7 @@ int sftpProtocol::sftpReadLink(const KURL& url, TQString& target){ return -1; } - TQ_UINT32 count; + Q_UINT32 count; r >> count; if( count != 1 ) { kdError(KIO_SFTP_DB) << "sftpReadLink(): Bad number of file attributes for realpath command" << endl; @@ -2005,16 +2005,16 @@ int sftpProtocol::sftpSymLink(const TQString& _target, const KURL& dest){ kdDebug(KIO_SFTP_DB) << "sftpSymLink(" << target << " -> " << destPath << ")" << endl; - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + tlen + 4 /*str length*/ + dlen); - s << (TQ_UINT8)SSH2_FXP_SYMLINK; - s << (TQ_UINT32)id; + s << (Q_UINT8)SSH2_FXP_SYMLINK; + s << (Q_UINT32)id; s.writeBytes(target.data(), tlen); s.writeBytes(destPath.data(), dlen); @@ -2022,7 +2022,7 @@ int sftpProtocol::sftpSymLink(const TQString& _target, const KURL& dest){ getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -2035,7 +2035,7 @@ int sftpProtocol::sftpSymLink(const TQString& _target, const KURL& dest){ return -1; } - TQ_UINT32 code; + Q_UINT32 code; r >> code; if( code != SSH2_FX_OK ) { kdError(KIO_SFTP_DB) << "sftpSymLink(): rename failed with err code " << code << endl; @@ -2052,21 +2052,21 @@ int sftpProtocol::sftpStat(const KURL& url, sftpFileAttr& attr) { TQCString path = remoteEncoding()->encode(url.path()); uint len = path.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); - s << (TQ_UINT8)SSH2_FXP_LSTAT; - s << (TQ_UINT32)id; + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len); + s << (Q_UINT8)SSH2_FXP_LSTAT; + s << (Q_UINT32)id; s.writeBytes(path.data(), len); putPacket(p); getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -2075,7 +2075,7 @@ int sftpProtocol::sftpStat(const KURL& url, sftpFileAttr& attr) { } if( type == SSH2_FXP_STATUS ) { - TQ_UINT32 errCode; + Q_UINT32 errCode; r >> errCode; kdError(KIO_SFTP_DB) << "sftpStat(): stat failed with code " << errCode << endl; return errCode; @@ -2133,23 +2133,23 @@ int sftpProtocol::sftpStat(const KURL& url, sftpFileAttr& attr) { } -int sftpProtocol::sftpOpen(const KURL& url, const TQ_UINT32 pflags, +int sftpProtocol::sftpOpen(const KURL& url, const Q_UINT32 pflags, const sftpFileAttr& attr, TQByteArray& handle) { kdDebug(KIO_SFTP_DB) << "sftpOpen(" << url << ", handle" << endl; TQCString path = remoteEncoding()->encode(url.path()); uint len = path.length(); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + 4 /*pflags*/ + attr.size()); - s << (TQ_UINT8)SSH2_FXP_OPEN; - s << (TQ_UINT32)id; + s << (Q_UINT8)SSH2_FXP_OPEN; + s << (Q_UINT32)id; s.writeBytes(path.data(), len); s << pflags; s << attr; @@ -2158,7 +2158,7 @@ int sftpProtocol::sftpOpen(const KURL& url, const TQ_UINT32 pflags, getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -2167,7 +2167,7 @@ int sftpProtocol::sftpOpen(const KURL& url, const TQ_UINT32 pflags, } if( type == SSH2_FXP_STATUS ) { - TQ_UINT32 errCode; + Q_UINT32 errCode; r >> errCode; return errCode; } @@ -2188,19 +2188,19 @@ int sftpProtocol::sftpOpen(const KURL& url, const TQ_UINT32 pflags, } -int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, TQ_UINT32 len, TQByteArray& data) +int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, Q_UINT32 len, TQByteArray& data) { // kdDebug(KIO_SFTP_DB) << "sftpRead( offset = " << offset << ", len = " << len << ")" << endl; TQByteArray p; TQDataStream s(p, IO_WriteOnly); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size() + 8 /*offset*/ + 4 /*length*/); - s << (TQ_UINT8)SSH2_FXP_READ; - s << (TQ_UINT32)id; + s << (Q_UINT8)SSH2_FXP_READ; + s << (Q_UINT32)id; s << handle; s << offset; // we don't have a convienient 64 bit int so set upper int to zero s << len; @@ -2209,7 +2209,7 @@ int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, TQ getPacket(p); TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -2218,7 +2218,7 @@ int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, TQ } if( type == SSH2_FXP_STATUS ) { - TQ_UINT32 errCode; + Q_UINT32 errCode; r >> errCode; kdError(KIO_SFTP_DB) << "sftpRead: read failed with code " << errCode << endl; return errCode; @@ -2241,14 +2241,14 @@ int sftpProtocol::sftpWrite(const TQByteArray& handle, KIO::filesize_t offset, c TQByteArray p; TQDataStream s(p, IO_WriteOnly); - TQ_UINT32 id, expectedId; + Q_UINT32 id, expectedId; id = expectedId = mMsgId++; - s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + + s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size() + 8 /*offset*/ + 4 /* data size */ + data.size()); - s << (TQ_UINT8)SSH2_FXP_WRITE; - s << (TQ_UINT32)id; + s << (Q_UINT8)SSH2_FXP_WRITE; + s << (Q_UINT32)id; s << handle; s << offset; // we don't have a convienient 64 bit int so set upper int to zero s << data; @@ -2264,7 +2264,7 @@ int sftpProtocol::sftpWrite(const TQByteArray& handle, KIO::filesize_t offset, c // kdDebug(KIO_SFTP_DB) << "sftpWrite(): received packet [" << p << "]" << endl; TQDataStream r(p, IO_ReadOnly); - TQ_UINT8 type; + Q_UINT8 type; r >> type >> id; if( id != expectedId ) { @@ -2278,7 +2278,7 @@ int sftpProtocol::sftpWrite(const TQByteArray& handle, KIO::filesize_t offset, c return -1; } - TQ_UINT32 code; + Q_UINT32 code; r >> code; return code; } diff --git a/kioslave/sftp/kio_sftp.h b/kioslave/sftp/kio_sftp.h index f5b561325..22cd4764a 100644 --- a/kioslave/sftp/kio_sftp.h +++ b/kioslave/sftp/kio_sftp.h @@ -83,7 +83,7 @@ private: // Private variables /** Version of the sftp protocol we are using. */ int sftpVersion; - struct tqStatus + struct Status { int code; KIO::filesize_t size; @@ -109,9 +109,9 @@ private: // private methods /** Send an sftp packet to stdin of the ssh process. */ bool putPacket(TQByteArray& p); /** Process SSH_FXP_STATUS packets. */ - void processtqStatus(TQ_UINT8, const TQString& message = TQString::null); + void processStatus(Q_UINT8, const TQString& message = TQString::null); /** Process SSH_FXP_STATUS packes and return the result. */ - tqStatus doProcesstqStatus(TQ_UINT8, const TQString& message = TQString::null); + Status doProcessStatus(Q_UINT8, const TQString& message = TQString::null); /** Opens a directory handle for url.path. Returns true if succeeds. */ int sftpOpenDirectory(const KURL& url, TQByteArray& handle); /** Closes a directory or file handle. */ @@ -131,9 +131,9 @@ private: // private methods /** Stats a file. */ int sftpStat(const KURL& url, sftpFileAttr& attr); /** No descriptions */ - int sftpOpen(const KURL& url, const TQ_UINT32 pflags, const sftpFileAttr& attr, TQByteArray& handle); + int sftpOpen(const KURL& url, const Q_UINT32 pflags, const sftpFileAttr& attr, TQByteArray& handle); /** No descriptions */ - int sftpRead(const TQByteArray& handle, KIO::filesize_t offset, TQ_UINT32 len, TQByteArray& data); + int sftpRead(const TQByteArray& handle, KIO::filesize_t offset, Q_UINT32 len, TQByteArray& data); /** No descriptions */ int sftpWrite(const TQByteArray& handle, KIO::filesize_t offset, const TQByteArray& data); @@ -143,7 +143,7 @@ private: // private methods void sftpCopyGet(const KURL& dest, const KURL& src, int mode, bool overwrite); /** */ - tqStatus sftpGet( const KURL& src, KIO::filesize_t offset = 0, int fd = -1); + Status sftpGet( const KURL& src, KIO::filesize_t offset = 0, int fd = -1); void sftpPut( const KURL& dest, int permissions, bool resume, bool overwrite, int fd = -1); }; #endif diff --git a/kioslave/sftp/ksshprocess.cpp b/kioslave/sftp/ksshprocess.cpp index 20bdab679..9b2323bd6 100644 --- a/kioslave/sftp/ksshprocess.cpp +++ b/kioslave/sftp/ksshprocess.cpp @@ -30,7 +30,7 @@ * of ssh we are using. This command and its arguments are passed to * PTYProcess for execution. Once ssh is started we scan each line of input * from stdin, stderr, and the pty for recognizable strings. The recognizable - * strings are taken from several string tables. Each table tqcontains a string + * strings are taken from several string tables. Each table contains a string * for each specific version of ssh we support and a string for a generic * version of OpenSSH and commercial SSH incase we don't recognized the * specific ssh version strings (as when a new SSH version is released after @@ -206,7 +206,7 @@ void KSshProcess::removeSignalHandlers() { KSshProcess::KSshProcess() : mVersion(UNKNOWN_VER), mConnected(false), mRunning(false), mConnectState(0) { - mSshPath = KStandardDirs::findExe(TQString::tqfromLatin1("ssh")); + mSshPath = KStandardDirs::findExe(TQString::fromLatin1("ssh")); kdDebug(KSSHPROC) << "KSshProcess::KSshProcess(): ssh path [" << mSshPath << "]" << endl; @@ -292,7 +292,7 @@ TQString KSshProcess::versionStr() { return TQString::null; } - return TQString::tqfromLatin1(versionStrs[mVersion]); + return TQString::fromLatin1(versionStrs[mVersion]); } */ @@ -380,8 +380,8 @@ bool KSshProcess::setOptions(const SshOptList& opts) { // since KSshProcess depends on specific setting of these for // preforming authentication correctly. tmp = (*it).str.latin1(); - if( tmp.tqcontains("NumberOfPasswordPrompts") || - tmp.tqcontains("StrictHostKeyChecking") ) { + if( tmp.contains("NumberOfPasswordPrompts") || + tmp.contains("StrictHostKeyChecking") ) { mError = ERR_INVALID_OPT; return false; } @@ -762,7 +762,7 @@ bool KSshProcess::connect() { // STATE_WAIT_PROMPT: // Get a line of input from the ssh process. Check the contents // of the line to determine the next state. Ignore the line - // if we don't recognize its contents. If the line tqcontains + // if we don't recognize its contents. If the line contains // the continue prompt, we have an error since we should never // get that line in this state. Set ERR_INVALID_STATE error // and return false. @@ -776,7 +776,7 @@ bool KSshProcess::connect() { i18n("Error encountered while talking to ssh."); mConnectState = STATE_FATAL; } - else if( line.find(TQString::tqfromLatin1(passwordPrompt[mVersion]), 0, false) != -1 ) { + else if( line.find(TQString::fromLatin1(passwordPrompt[mVersion]), 0, false) != -1 ) { mConnectState = STATE_TRY_PASSWD; } else if( line.find(passphrasePrompt[mVersion]) != -1 ) { diff --git a/kioslave/sftp/ksshprocess.h b/kioslave/sftp/ksshprocess.h index 5130628e4..7fe8dd814 100644 --- a/kioslave/sftp/ksshprocess.h +++ b/kioslave/sftp/ksshprocess.h @@ -116,9 +116,9 @@ public: */ class SshOpt { public: - TQ_UINT32 opt; + Q_UINT32 opt; TQString str; - TQ_INT32 num; + Q_INT32 num; bool boolean; }; diff --git a/kioslave/sftp/process.cpp b/kioslave/sftp/process.cpp index 6ef02108e..ca99b36bb 100644 --- a/kioslave/sftp/process.cpp +++ b/kioslave/sftp/process.cpp @@ -4,7 +4,7 @@ * This file is part of the KDE project, module kdesu. * Copyright (C) 1999,2000 Geert Jansen <[email protected]> * - * This file tqcontains code from TEShell.C of the KDE konsole. + * This file contains code from TEShell.C of the KDE konsole. * Copyright (c) 1997,1998 by Lars Doelle <[email protected]> * * This is free software; you can use this library under the GNU Library @@ -260,7 +260,7 @@ int MyPtyProcess::exec(TQCString command, QCStringList args) // From now on, terminal output goes through the tty. TQCString path; - if (command.tqcontains('/')) + if (command.contains('/')) path = command; else { diff --git a/kioslave/sftp/sftpfileattr.cpp b/kioslave/sftp/sftpfileattr.cpp index 7b98cb17f..42148ac28 100644 --- a/kioslave/sftp/sftpfileattr.cpp +++ b/kioslave/sftp/sftpfileattr.cpp @@ -44,7 +44,7 @@ sftpFileAttr::sftpFileAttr(KRemoteEncoding* encoding){ /** Constructor to initialize the file attributes on declaration. */ sftpFileAttr::sftpFileAttr(Q_ULLONG size, uid_t uid, gid_t gid, mode_t permissions, time_t atime, - time_t mtime, TQ_UINT32 extendedCount) { + time_t mtime, Q_UINT32 extendedCount) { clear(); mDirAttrs = false; mSize = size; @@ -124,22 +124,22 @@ UDSEntry sftpFileAttr::entry() { /** Use to output the file attributes to a sftp packet */ TQDataStream& operator<< (TQDataStream& s, const sftpFileAttr& fa) { - s << (TQ_UINT32)fa.mFlags; + s << (Q_UINT32)fa.mFlags; if( fa.mFlags & SSH2_FILEXFER_ATTR_SIZE ) { s << (Q_ULLONG)fa.mSize; } if( fa.mFlags & SSH2_FILEXFER_ATTR_UIDGID ) - { s << (TQ_UINT32)fa.mUid << (TQ_UINT32)fa.mGid; } + { s << (Q_UINT32)fa.mUid << (Q_UINT32)fa.mGid; } if( fa.mFlags & SSH2_FILEXFER_ATTR_PERMISSIONS ) - { s << (TQ_UINT32)fa.mPermissions; } + { s << (Q_UINT32)fa.mPermissions; } if( fa.mFlags & SSH2_FILEXFER_ATTR_ACMODTIME ) - { s << (TQ_UINT32)fa.mAtime << (TQ_UINT32)fa.mMtime; } + { s << (Q_UINT32)fa.mAtime << (Q_UINT32)fa.mMtime; } if( fa.mFlags & SSH2_FILEXFER_ATTR_EXTENDED ) { - s << (TQ_UINT32)fa.mExtendedCount; + s << (Q_UINT32)fa.mExtendedCount; // XXX: Write extensions to data stream here // s.writeBytes(extendedtype).writeBytes(extendeddata); } @@ -175,7 +175,7 @@ TQDataStream& operator>> (TQDataStream& s, sftpFileAttr& fa) { fa.setFileSize(fileSize); } - TQ_UINT32 x; + Q_UINT32 x; if( fa.mFlags & SSH2_FILEXFER_ATTR_UIDGID ) { s >> x; fa.setUid(x); @@ -218,7 +218,7 @@ void sftpFileAttr::getUserGroupNames(){ kdDebug(7120) << "Decoded: " << longName << endl; - // Find the beginning of the third field which tqcontains the user name. + // Find the beginning of the third field which contains the user name. while( field != 2 ) { if( longName[i].isSpace() ) { field++; i++; @@ -233,7 +233,7 @@ void sftpFileAttr::getUserGroupNames(){ } // i is the first character of the space between fields 3 and 4 - // user tqcontains the owner's user name + // user contains the owner's user name while( i < l && longName[i].isSpace() ) { i++; } @@ -243,7 +243,7 @@ void sftpFileAttr::getUserGroupNames(){ group.append(longName[i]); i++; } - // group tqcontains the name of the group. + // group contains the name of the group. } mUserName = user; @@ -295,8 +295,8 @@ void sftpFileAttr::clear(){ } /** Return the size of the sftp attribute. */ -TQ_UINT32 sftpFileAttr::size() const{ - TQ_UINT32 size = 4; // for the attr flag +Q_UINT32 sftpFileAttr::size() const{ + Q_UINT32 size = 4; // for the attr flag if( mFlags & SSH2_FILEXFER_ATTR_SIZE ) size += 8; diff --git a/kioslave/sftp/sftpfileattr.h b/kioslave/sftp/sftpfileattr.h index 105b6d7c0..a2a9cf87e 100644 --- a/kioslave/sftp/sftpfileattr.h +++ b/kioslave/sftp/sftpfileattr.h @@ -42,7 +42,7 @@ private: // Private attributes TQString mFilename; /** Specifies which fields of the file attribute are available. */ - TQ_UINT32 mFlags; + Q_UINT32 mFlags; /** Size of the file in bytes. Should be 64 bit safe. */ Q_ULLONG mSize; @@ -64,7 +64,7 @@ private: // Private attributes /** Number of file attribute extensions. Not currently implemented */ - TQ_UINT32 mExtendedCount; + Q_UINT32 mExtendedCount; /** Longname of the file as found in a SSH_FXP_NAME sftp packet. These contents are parse to return the file's owner name and @@ -74,10 +74,10 @@ private: // Private attributes TQString mUserName; TQString mGroupName; - /** If file is a link, tqcontains the destination of the link */ + /** If file is a link, contains the destination of the link */ TQString mLinkDestination; - /** If resource is a link, tqcontains the type the link,e.g. file,dir... */ + /** If resource is a link, contains the type the link,e.g. file,dir... */ mode_t mLinkType; /** Whether >> operator should read filename and longname from the stream. */ @@ -95,10 +95,10 @@ public: /** Constructor to initialize the file attributes on declaration. */ sftpFileAttr(Q_ULLONG size_, uid_t uid_, gid_t gid_, mode_t permissions_, - time_t atime_, time_t mtime_, TQ_UINT32 extendedCount_ = 0); + time_t atime_, time_t mtime_, Q_UINT32 extendedCount_ = 0); /** Return the size of the sftp attribute not including filename or longname*/ - TQ_UINT32 size() const; + Q_UINT32 size() const; /** Clear all attributes and flags. */ void clear(); |