summaryrefslogtreecommitdiffstats
path: root/kioslave/sftp
diff options
context:
space:
mode:
Diffstat (limited to 'kioslave/sftp')
-rw-r--r--kioslave/sftp/kio_sftp.cpp196
-rw-r--r--kioslave/sftp/kio_sftp.h8
-rw-r--r--kioslave/sftp/ksshprocess.cpp54
-rw-r--r--kioslave/sftp/ksshprocess.h4
-rw-r--r--kioslave/sftp/process.cpp6
-rw-r--r--kioslave/sftp/sftpfileattr.cpp18
-rw-r--r--kioslave/sftp/sftpfileattr.h8
7 files changed, 147 insertions, 147 deletions
diff --git a/kioslave/sftp/kio_sftp.cpp b/kioslave/sftp/kio_sftp.cpp
index 456d47084..2c8f995a5 100644
--- a/kioslave/sftp/kio_sftp.cpp
+++ b/kioslave/sftp/kio_sftp.cpp
@@ -348,7 +348,7 @@ sftpProtocol::Status sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t off
}
KIO::filesize_t fileSize = attr.fileSize();
- Q_UINT32 pflags = SSH2_FXF_READ;
+ TQ_UINT32 pflags = SSH2_FXF_READ;
attr.clear();
TQByteArray handle;
@@ -368,7 +368,7 @@ sftpProtocol::Status sftpProtocol::sftpGet( const KURL& src, KIO::filesize_t off
// 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.
- Q_UINT32 len = 60*1024;
+ TQ_UINT32 len = 60*1024;
code = SSH2_FX_OK;
kdDebug(KIO_SFTP_DB) << "sftpGet(): offset = " << offset << endl;
@@ -449,7 +449,7 @@ void sftpProtocol::get(const KURL& url) {
return;
// Get resume offset
- Q_UINT64 offset = config()->readUnsignedLongNumEntry("resume");
+ TQ_UINT64 offset = config()->readUnsignedLongNumEntry("resume");
if( offset > 0 ) {
canResume();
kdDebug(KIO_SFTP_DB) << "get(): canResume(), offset = " << offset << endl;
@@ -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 << (Q_UINT32)5; // packet length
- packet << (Q_UINT8) SSH2_FXP_INIT; // packet type
- packet << (Q_UINT32)SSH2_FILEXFER_VERSION; // client version
+ packet << (TQ_UINT32)5; // packet length
+ packet << (TQ_UINT8) SSH2_FXP_INIT; // packet type
+ packet << (TQ_UINT32)SSH2_FILEXFER_VERSION; // client version
putPacket(p);
getPacket(p);
TQDataStream s(p, IO_ReadOnly);
- Q_UINT32 version;
- Q_UINT8 type;
+ TQ_UINT32 version;
+ TQ_UINT8 type;
s >> type;
kdDebug(KIO_SFTP_DB) << "openConnection(): Got type " << type << endl;
@@ -910,7 +910,7 @@ void sftpProtocol::sftpPut( const KURL& dest, int permissions, bool resume, bool
KURL partUrl( origUrl );
partUrl.setFileName( partUrl.fileName() + ".part" );
- Q_UINT64 offset = 0;
+ TQ_UINT64 offset = 0;
bool partExists = false;
bool markPartial = config()->readBoolEntry("MarkPartial", true);
@@ -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);
- Q_UINT32 pflags = 0;
+ TQ_UINT32 pflags = 0;
if( overwrite && !resume )
pflags = SSH2_FXF_WRITE | SSH2_FXF_CREAT | SSH2_FXF_TRUNC;
else if( !overwrite && !resume )
@@ -1157,7 +1157,7 @@ void sftpProtocol::mimetype ( const KURL& url ){
if( !mConnected )
return;
- Q_UINT32 pflags = SSH2_FXF_READ;
+ TQ_UINT32 pflags = SSH2_FXF_READ;
TQByteArray handle, mydata;
sftpFileAttr attr(remoteEncoding());
int code;
@@ -1166,8 +1166,8 @@ void sftpProtocol::mimetype ( const KURL& url ){
return;
}
- Q_UINT32 len = 1024; // Get first 1k for determining mimetype
- Q_UINT64 offset = 0;
+ TQ_UINT32 len = 1024; // Get first 1k for determining mimetype
+ TQ_UINT64 offset = 0;
code = SSH2_FX_OK;
while( offset < len && code == SSH2_FX_OK ) {
if( (code = sftpRead(handle, offset, len, mydata)) == SSH2_FX_OK ) {
@@ -1256,13 +1256,13 @@ void sftpProtocol::mkdir(const KURL&url, int permissions){
if (permissions != -1)
attr.setPermissions(permissions);
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << Q_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size());
- s << (Q_UINT8)SSH2_FXP_MKDIR;
+ s << TQ_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size());
+ s << (TQ_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);
- Q_UINT8 type;
+ TQ_UINT8 type;
TQDataStream r(p, IO_ReadOnly);
r >> type >> id;
@@ -1484,7 +1484,7 @@ bool sftpProtocol::getPacket(TQByteArray& msg) {
b.open( IO_WriteOnly );
while( msgLen ) {
- len = atomicio(ssh.stdioFd(), buf.data(), kMin(buf.size(), msgLen), true /*read*/);
+ len = atomicio(ssh.stdioFd(), buf.data(), kMin((uint)buf.size(), msgLen), true /*read*/);
if( len == 0 || len == -1) {
TQString errmsg;
@@ -1538,20 +1538,20 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){
TQCString path = remoteEncoding()->encode(url.path());
uint len = path.length();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << Q_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
- s << (Q_UINT8)SSH2_FXP_REALPATH;
+ s << TQ_UINT32(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
+ s << (TQ_UINT8)SSH2_FXP_REALPATH;
s << id;
s.writeBytes(path.data(), len);
putPacket(p);
getPacket(p);
- Q_UINT8 type;
+ TQ_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 ) {
- Q_UINT32 code;
+ TQ_UINT32 code;
r >> code;
return code;
}
@@ -1571,7 +1571,7 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){
return -1;
}
- Q_UINT32 count;
+ TQ_UINT32 count;
r >> count;
if( count != 1 ) {
kdError(KIO_SFTP_DB) << "sftpRealPath(): Bad number of file attributes for realpath command" << endl;
@@ -1589,7 +1589,7 @@ int sftpProtocol::sftpRealPath(const KURL& url, KURL& newUrl){
return SSH2_FX_OK;
}
-sftpProtocol::Status sftpProtocol::doProcessStatus(Q_UINT8 code, const TQString& message)
+sftpProtocol::Status sftpProtocol::doProcessStatus(TQ_UINT8 code, const TQString& message)
{
Status res;
res.code = 0;
@@ -1628,7 +1628,7 @@ sftpProtocol::Status sftpProtocol::doProcessStatus(Q_UINT8 code, const TQString&
}
/** Process SSH_FXP_STATUS packets. */
-void sftpProtocol::processStatus(Q_UINT8 code, const TQString& message){
+void sftpProtocol::processStatus(TQ_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();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
- s << (Q_UINT8)SSH2_FXP_OPENDIR;
- s << (Q_UINT32)id;
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
+ s << (TQ_UINT8)SSH2_FXP_OPENDIR;
+ s << (TQ_UINT32)id;
s.writeBytes(path.data(), len);
putPacket(p);
getPacket(p);
TQDataStream r(p, IO_ReadOnly);
- Q_UINT8 type;
+ TQ_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 ) {
- Q_UINT32 errCode;
+ TQ_UINT32 errCode;
r >> errCode;
return errCode;
}
@@ -1691,21 +1691,21 @@ int sftpProtocol::sftpClose(const TQByteArray& handle){
kdDebug(KIO_SFTP_DB) << "sftpClose()" << endl;
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size());
- s << (Q_UINT8)SSH2_FXP_CLOSE;
- s << (Q_UINT32)id;
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size());
+ s << (TQ_UINT8)SSH2_FXP_CLOSE;
+ s << (TQ_UINT32)id;
s << handle;
putPacket(p);
getPacket(p);
TQDataStream r(p, IO_ReadOnly);
- Q_UINT8 type;
+ TQ_UINT8 type;
r >> type >> id;
if( id != expectedId ) {
@@ -1718,7 +1718,7 @@ int sftpProtocol::sftpClose(const TQByteArray& handle){
return -1;
}
- Q_UINT32 code;
+ TQ_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();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size());
- s << (Q_UINT8)SSH2_FXP_SETSTAT;
- s << (Q_UINT32)id;
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len + attr.size());
+ s << (TQ_UINT8)SSH2_FXP_SETSTAT;
+ s << (TQ_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);
- Q_UINT8 type;
+ TQ_UINT8 type;
r >> type >> id;
if( id != expectedId ) {
@@ -1764,7 +1764,7 @@ int sftpProtocol::sftpSetStat(const KURL& url, const sftpFileAttr& attr){
return -1;
}
- Q_UINT32 code;
+ TQ_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();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- 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 << (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.writeBytes(path.data(), len);
putPacket(p);
getPacket(p);
TQDataStream r(p, IO_ReadOnly);
- Q_UINT8 type;
+ TQ_UINT8 type;
r >> type >> id;
if( id != expectedId ) {
@@ -1808,7 +1808,7 @@ int sftpProtocol::sftpRemove(const KURL& url, bool isfile){
return -1;
}
- Q_UINT32 code;
+ TQ_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();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ +
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ +
4 /*str length*/ + slen +
4 /*str length*/ + dlen);
- s << (Q_UINT8)SSH2_FXP_RENAME;
- s << (Q_UINT32)id;
+ s << (TQ_UINT8)SSH2_FXP_RENAME;
+ s << (TQ_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);
- Q_UINT8 type;
+ TQ_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;
- Q_UINT32 id, expectedId, count;
- Q_UINT8 type;
+ TQ_UINT32 id, expectedId, count;
+ TQ_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 << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size());
- s << (Q_UINT8)SSH2_FXP_READDIR;
- s << (Q_UINT32)id;
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + handle.size());
+ s << (TQ_UINT8)SSH2_FXP_READDIR;
+ s << (TQ_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;
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
- s << (Q_UINT8)SSH2_FXP_READLINK;
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
+ s << (TQ_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);
- Q_UINT8 type;
+ TQ_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 ) {
- Q_UINT32 code;
+ TQ_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;
}
- Q_UINT32 count;
+ TQ_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;
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ +
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ +
4 /*str length*/ + tlen +
4 /*str length*/ + dlen);
- s << (Q_UINT8)SSH2_FXP_SYMLINK;
- s << (Q_UINT32)id;
+ s << (TQ_UINT8)SSH2_FXP_SYMLINK;
+ s << (TQ_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);
- Q_UINT8 type;
+ TQ_UINT8 type;
r >> type >> id;
if( id != expectedId ) {
@@ -2035,7 +2035,7 @@ int sftpProtocol::sftpSymLink(const TQString& _target, const KURL& dest){
return -1;
}
- Q_UINT32 code;
+ TQ_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();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
- s << (Q_UINT8)SSH2_FXP_LSTAT;
- s << (Q_UINT32)id;
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ + 4 /*str length*/ + len);
+ s << (TQ_UINT8)SSH2_FXP_LSTAT;
+ s << (TQ_UINT32)id;
s.writeBytes(path.data(), len);
putPacket(p);
getPacket(p);
TQDataStream r(p, IO_ReadOnly);
- Q_UINT8 type;
+ TQ_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 ) {
- Q_UINT32 errCode;
+ TQ_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 Q_UINT32 pflags,
+int sftpProtocol::sftpOpen(const KURL& url, const TQ_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();
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ +
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ +
4 /*str length*/ + len +
4 /*pflags*/ + attr.size());
- s << (Q_UINT8)SSH2_FXP_OPEN;
- s << (Q_UINT32)id;
+ s << (TQ_UINT8)SSH2_FXP_OPEN;
+ s << (TQ_UINT32)id;
s.writeBytes(path.data(), len);
s << pflags;
s << attr;
@@ -2158,7 +2158,7 @@ int sftpProtocol::sftpOpen(const KURL& url, const Q_UINT32 pflags,
getPacket(p);
TQDataStream r(p, IO_ReadOnly);
- Q_UINT8 type;
+ TQ_UINT8 type;
r >> type >> id;
if( id != expectedId ) {
@@ -2167,7 +2167,7 @@ int sftpProtocol::sftpOpen(const KURL& url, const Q_UINT32 pflags,
}
if( type == SSH2_FXP_STATUS ) {
- Q_UINT32 errCode;
+ TQ_UINT32 errCode;
r >> errCode;
return errCode;
}
@@ -2188,19 +2188,19 @@ int sftpProtocol::sftpOpen(const KURL& url, const Q_UINT32 pflags,
}
-int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, Q_UINT32 len, TQByteArray& data)
+int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, TQ_UINT32 len, TQByteArray& data)
{
// kdDebug(KIO_SFTP_DB) << "sftpRead( offset = " << offset << ", len = " << len << ")" << endl;
TQByteArray p;
TQDataStream s(p, IO_WriteOnly);
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ +
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ +
4 /*str length*/ + handle.size() +
8 /*offset*/ + 4 /*length*/);
- s << (Q_UINT8)SSH2_FXP_READ;
- s << (Q_UINT32)id;
+ s << (TQ_UINT8)SSH2_FXP_READ;
+ s << (TQ_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, Q_
getPacket(p);
TQDataStream r(p, IO_ReadOnly);
- Q_UINT8 type;
+ TQ_UINT8 type;
r >> type >> id;
if( id != expectedId ) {
@@ -2218,7 +2218,7 @@ int sftpProtocol::sftpRead(const TQByteArray& handle, KIO::filesize_t offset, Q_
}
if( type == SSH2_FXP_STATUS ) {
- Q_UINT32 errCode;
+ TQ_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);
- Q_UINT32 id, expectedId;
+ TQ_UINT32 id, expectedId;
id = expectedId = mMsgId++;
- s << (Q_UINT32)(1 /*type*/ + 4 /*id*/ +
+ s << (TQ_UINT32)(1 /*type*/ + 4 /*id*/ +
4 /*str length*/ + handle.size() +
8 /*offset*/ +
4 /* data size */ + data.size());
- s << (Q_UINT8)SSH2_FXP_WRITE;
- s << (Q_UINT32)id;
+ s << (TQ_UINT8)SSH2_FXP_WRITE;
+ s << (TQ_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);
- Q_UINT8 type;
+ TQ_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;
}
- Q_UINT32 code;
+ TQ_UINT32 code;
r >> code;
return code;
}
diff --git a/kioslave/sftp/kio_sftp.h b/kioslave/sftp/kio_sftp.h
index 22cd4764a..951d3e46e 100644
--- a/kioslave/sftp/kio_sftp.h
+++ b/kioslave/sftp/kio_sftp.h
@@ -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 processStatus(Q_UINT8, const TQString& message = TQString::null);
+ void processStatus(TQ_UINT8, const TQString& message = TQString::null);
/** Process SSH_FXP_STATUS packes and return the result. */
- Status doProcessStatus(Q_UINT8, const TQString& message = TQString::null);
+ Status doProcessStatus(TQ_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 Q_UINT32 pflags, const sftpFileAttr& attr, TQByteArray& handle);
+ int sftpOpen(const KURL& url, const TQ_UINT32 pflags, const sftpFileAttr& attr, TQByteArray& handle);
/** No descriptions */
- int sftpRead(const TQByteArray& handle, KIO::filesize_t offset, Q_UINT32 len, TQByteArray& data);
+ int sftpRead(const TQByteArray& handle, KIO::filesize_t offset, TQ_UINT32 len, TQByteArray& data);
/** No descriptions */
int sftpWrite(const TQByteArray& handle, KIO::filesize_t offset, const TQByteArray& data);
diff --git a/kioslave/sftp/ksshprocess.cpp b/kioslave/sftp/ksshprocess.cpp
index 9b2323bd6..6dfdb2419 100644
--- a/kioslave/sftp/ksshprocess.cpp
+++ b/kioslave/sftp/ksshprocess.cpp
@@ -206,7 +206,7 @@ void KSshProcess::removeSignalHandlers() {
KSshProcess::KSshProcess()
: mVersion(UNKNOWN_VER), mConnected(false),
mRunning(false), mConnectState(0) {
- mSshPath = KStandardDirs::findExe(TQString::fromLatin1("ssh"));
+ mSshPath = KStandardDirs::findExe(TQString::tqfromLatin1("ssh"));
kdDebug(KSSHPROC) << "KSshProcess::KSshProcess(): ssh path [" <<
mSshPath << "]" << endl;
@@ -266,7 +266,7 @@ KSshProcess::SshVersion KSshProcess::version() {
mVersion = UNKNOWN_VER;
for(int i = 0; i < SSH_VER_MAX; i++) {
- if( ver.find(versionStrs[i]) != -1 ) {
+ if( ver.tqfind(versionStrs[i]) != -1 ) {
mVersion = (SshVersion)i;
break;
}
@@ -292,7 +292,7 @@ TQString KSshProcess::versionStr() {
return TQString::null;
}
- return TQString::fromLatin1(versionStrs[mVersion]);
+ return TQString::tqfromLatin1(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.contains("NumberOfPasswordPrompts") ||
- tmp.contains("StrictHostKeyChecking") ) {
+ if( tmp.tqcontains("NumberOfPasswordPrompts") ||
+ tmp.tqcontains("StrictHostKeyChecking") ) {
mError = ERR_INVALID_OPT;
return false;
}
@@ -776,26 +776,26 @@ bool KSshProcess::connect() {
i18n("Error encountered while talking to ssh.");
mConnectState = STATE_FATAL;
}
- else if( line.find(TQString::fromLatin1(passwordPrompt[mVersion]), 0, false) != -1 ) {
+ else if( line.tqfind(TQString::tqfromLatin1(passwordPrompt[mVersion]), 0, false) != -1 ) {
mConnectState = STATE_TRY_PASSWD;
}
- else if( line.find(passphrasePrompt[mVersion]) != -1 ) {
+ else if( line.tqfind(passphrasePrompt[mVersion]) != -1 ) {
mConnectState = STATE_TRY_PASSPHRASE;
}
- else if( line.find(authSuccessMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(authSuccessMsg[mVersion]) != -1 ) {
return true;
}
- else if( line.find(authFailedMsg[mVersion]) != -1
- && line.find(tryAgainMsg[mVersion]) == -1 ) {
+ else if( line.tqfind(authFailedMsg[mVersion]) != -1
+ && line.tqfind(tryAgainMsg[mVersion]) == -1 ) {
mConnectState = STATE_AUTH_FAILED;
}
- else if( line.find(hostKeyMissingMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(hostKeyMissingMsg[mVersion]) != -1 ) {
mConnectState = STATE_NEW_KEY_WAIT_CONTINUE;
}
- else if( line.find(hostKeyChangedMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(hostKeyChangedMsg[mVersion]) != -1 ) {
mConnectState = STATE_DIFF_KEY_WAIT_CONTINUE;
}
- else if( line.find(continuePrompt[mVersion]) != -1 ) {
+ else if( line.tqfind(continuePrompt[mVersion]) != -1 ) {
//mConnectState = STATE_SEND_CONTINUE;
kdDebug(KSSHPROC) << "KSshProcess:connect(): "
"Got continue prompt where we shouldn't (STATE_WAIT_PROMPT)"
@@ -804,12 +804,12 @@ bool KSshProcess::connect() {
mErrorMsg =
i18n("Error encountered while talking to ssh.");
}
- else if( line.find(connectionClosedMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(connectionClosedMsg[mVersion]) != -1 ) {
mConnectState = STATE_FATAL;
mError = ERR_CLOSED_BY_REMOTE_HOST;
mErrorMsg = i18n("Connection closed by remote host.");
}
- else if( line.find(changeHostKeyOnDiskPrompt[mVersion]) != -1 ) {
+ else if( line.tqfind(changeHostKeyOnDiskPrompt[mVersion]) != -1 ) {
// always say yes to this. It always comes after commerical ssh
// prints a "continue to connect prompt". We assume that if the
// user choose to continue, then they also want to save the
@@ -924,9 +924,9 @@ bool KSshProcess::connect() {
i18n("Error encountered while talking to ssh.");
mConnectState = STATE_FATAL;
}
- else if( (line.find(authFailedMsg[mVersion]) != -1
- && line.find(tryAgainMsg[mVersion]) == -1)
- || line.find(hostKeyVerifyFailedMsg[mVersion]) != -1 ) {
+ else if( (line.tqfind(authFailedMsg[mVersion]) != -1
+ && line.tqfind(tryAgainMsg[mVersion]) == -1)
+ || line.tqfind(hostKeyVerifyFailedMsg[mVersion]) != -1 ) {
mError = ERR_AUTH_FAILED_NEW_KEY;
mErrorMsg = i18n(
"The identity of the remote host '%1' could not be verified "
@@ -948,15 +948,15 @@ bool KSshProcess::connect() {
mConnectState = STATE_FATAL;
}
- else if( line.find(continuePrompt[mVersion]) != -1 ) {
+ else if( line.tqfind(continuePrompt[mVersion]) != -1 ) {
mConnectState = STATE_NEW_KEY_CONTINUE;
}
- else if( line.find(connectionClosedMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(connectionClosedMsg[mVersion]) != -1 ) {
mConnectState = STATE_FATAL;
mError = ERR_CLOSED_BY_REMOTE_HOST;
mErrorMsg = i18n("Connection closed by remote host.");
}
- else if( line.find(keyFingerprintMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(keyFingerprintMsg[mVersion]) != -1 ) {
mKeyFingerprint = keyFingerprintMsg[mVersion].cap();
kdDebug(KSSHPROC) << "Found key fingerprint: " << mKeyFingerprint << endl;
mConnectState = STATE_NEW_KEY_WAIT_CONTINUE;
@@ -996,9 +996,9 @@ bool KSshProcess::connect() {
i18n("Error encountered while talking to ssh.");
mConnectState = STATE_FATAL;
}
- else if( (line.find(authFailedMsg[mVersion]) != -1
- && line.find(tryAgainMsg[mVersion]) == -1)
- || line.find(hostKeyVerifyFailedMsg[mVersion]) != -1 ) {
+ else if( (line.tqfind(authFailedMsg[mVersion]) != -1
+ && line.tqfind(tryAgainMsg[mVersion]) == -1)
+ || line.tqfind(hostKeyVerifyFailedMsg[mVersion]) != -1 ) {
mError = ERR_AUTH_FAILED_DIFF_KEY;
mErrorMsg = i18n(
"WARNING: The identity of the remote host '%1' has changed!\n\n"
@@ -1011,15 +1011,15 @@ bool KSshProcess::connect() {
).arg(mHost).arg(mKeyFingerprint).arg(mKnownHostsFile);
mConnectState = STATE_FATAL;
}
- else if( line.find(continuePrompt[mVersion]) != -1 ) {
+ else if( line.tqfind(continuePrompt[mVersion]) != -1 ) {
mConnectState = STATE_DIFF_KEY_CONTINUE;
}
- else if( line.find(keyFingerprintMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(keyFingerprintMsg[mVersion]) != -1 ) {
mKeyFingerprint = keyFingerprintMsg[mVersion].cap();
kdDebug(KSSHPROC) << "Found key fingerprint: " << mKeyFingerprint << endl;
mConnectState = STATE_DIFF_KEY_WAIT_CONTINUE;
}
- else if( line.find(knownHostsFileMsg[mVersion]) != -1 ) {
+ else if( line.tqfind(knownHostsFileMsg[mVersion]) != -1 ) {
mKnownHostsFile = (knownHostsFileMsg[mVersion]).cap(1);
kdDebug(KSSHPROC) << "Found known hosts file name: " << mKnownHostsFile << endl;
mConnectState = STATE_DIFF_KEY_WAIT_CONTINUE;
diff --git a/kioslave/sftp/ksshprocess.h b/kioslave/sftp/ksshprocess.h
index 7fe8dd814..5130628e4 100644
--- a/kioslave/sftp/ksshprocess.h
+++ b/kioslave/sftp/ksshprocess.h
@@ -116,9 +116,9 @@ public:
*/
class SshOpt {
public:
- Q_UINT32 opt;
+ TQ_UINT32 opt;
TQString str;
- Q_INT32 num;
+ TQ_INT32 num;
bool boolean;
};
diff --git a/kioslave/sftp/process.cpp b/kioslave/sftp/process.cpp
index ca99b36bb..b97d5860b 100644
--- a/kioslave/sftp/process.cpp
+++ b/kioslave/sftp/process.cpp
@@ -107,7 +107,7 @@ TQCString MyPtyProcess::readLineFrom(int fd, TQCString& inbuf, bool block)
if (!inbuf.isEmpty())
{
- pos = inbuf.find('\n');
+ pos = inbuf.tqfind('\n');
if (pos == -1)
{
@@ -155,7 +155,7 @@ TQCString MyPtyProcess::readLineFrom(int fd, TQCString& inbuf, bool block)
buf[nbytes] = '\000';
inbuf += buf;
- pos = inbuf.find('\n');
+ pos = inbuf.tqfind('\n');
if (pos == -1)
{
ret = inbuf;
@@ -260,7 +260,7 @@ int MyPtyProcess::exec(TQCString command, QCStringList args)
// From now on, terminal output goes through the tty.
TQCString path;
- if (command.contains('/'))
+ if (command.tqcontains('/'))
path = command;
else
{
diff --git a/kioslave/sftp/sftpfileattr.cpp b/kioslave/sftp/sftpfileattr.cpp
index 42148ac28..9b7bf9b34 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, Q_UINT32 extendedCount) {
+ time_t mtime, TQ_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 << (Q_UINT32)fa.mFlags;
+ s << (TQ_UINT32)fa.mFlags;
if( fa.mFlags & SSH2_FILEXFER_ATTR_SIZE )
{ s << (Q_ULLONG)fa.mSize; }
if( fa.mFlags & SSH2_FILEXFER_ATTR_UIDGID )
- { s << (Q_UINT32)fa.mUid << (Q_UINT32)fa.mGid; }
+ { s << (TQ_UINT32)fa.mUid << (TQ_UINT32)fa.mGid; }
if( fa.mFlags & SSH2_FILEXFER_ATTR_PERMISSIONS )
- { s << (Q_UINT32)fa.mPermissions; }
+ { s << (TQ_UINT32)fa.mPermissions; }
if( fa.mFlags & SSH2_FILEXFER_ATTR_ACMODTIME )
- { s << (Q_UINT32)fa.mAtime << (Q_UINT32)fa.mMtime; }
+ { s << (TQ_UINT32)fa.mAtime << (TQ_UINT32)fa.mMtime; }
if( fa.mFlags & SSH2_FILEXFER_ATTR_EXTENDED ) {
- s << (Q_UINT32)fa.mExtendedCount;
+ s << (TQ_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);
}
- Q_UINT32 x;
+ TQ_UINT32 x;
if( fa.mFlags & SSH2_FILEXFER_ATTR_UIDGID ) {
s >> x; fa.setUid(x);
@@ -295,8 +295,8 @@ void sftpFileAttr::clear(){
}
/** Return the size of the sftp attribute. */
-Q_UINT32 sftpFileAttr::size() const{
- Q_UINT32 size = 4; // for the attr flag
+TQ_UINT32 sftpFileAttr::size() const{
+ TQ_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 a2a9cf87e..006f1d124 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. */
- Q_UINT32 mFlags;
+ TQ_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 */
- Q_UINT32 mExtendedCount;
+ TQ_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
@@ -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_, Q_UINT32 extendedCount_ = 0);
+ time_t atime_, time_t mtime_, TQ_UINT32 extendedCount_ = 0);
/** Return the size of the sftp attribute not including filename or longname*/
- Q_UINT32 size() const;
+ TQ_UINT32 size() const;
/** Clear all attributes and flags. */
void clear();