summaryrefslogtreecommitdiffstats
path: root/kioslave/smb
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
commitc663b6440964f6ac48027143ac9e63298991f9d0 (patch)
tree6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kioslave/smb
parenta061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff)
downloadtdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz
tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/smb')
-rw-r--r--kioslave/smb/kio_smb.cpp2
-rw-r--r--kioslave/smb/kio_smb.h30
-rw-r--r--kioslave/smb/kio_smb_auth.cpp16
-rw-r--r--kioslave/smb/kio_smb_browse.cpp26
-rw-r--r--kioslave/smb/kio_smb_config.cpp14
-rw-r--r--kioslave/smb/kio_smb_file.cpp6
-rw-r--r--kioslave/smb/kio_smb_internal.cpp8
-rw-r--r--kioslave/smb/kio_smb_internal.h22
-rw-r--r--kioslave/smb/kio_smb_mount.cpp42
9 files changed, 83 insertions, 83 deletions
diff --git a/kioslave/smb/kio_smb.cpp b/kioslave/smb/kio_smb.cpp
index 05db789ee..fd86ebadb 100644
--- a/kioslave/smb/kio_smb.cpp
+++ b/kioslave/smb/kio_smb.cpp
@@ -32,7 +32,7 @@
#include "kio_smb_internal.h"
//===========================================================================
-SMBSlave::SMBSlave(const QCString& pool, const QCString& app)
+SMBSlave::SMBSlave(const TQCString& pool, const TQCString& app)
: SlaveBase( "smb", pool, app )
{
m_initialized_smbc = false;
diff --git a/kioslave/smb/kio_smb.h b/kioslave/smb/kio_smb.h
index a04d7b3fa..da40bda13 100644
--- a/kioslave/smb/kio_smb.h
+++ b/kioslave/smb/kio_smb.h
@@ -39,11 +39,11 @@
//-------------
// QT includes
//-------------
-#include <qstring.h>
-#include <qptrlist.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
-#include <qstrlist.h>
+#include <tqstring.h>
+#include <tqptrlist.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
+#include <tqstrlist.h>
//--------------
// KDE includes
@@ -68,7 +68,7 @@
#include <stdio.h>
#include <errno.h>
#include <time.h>
-#include <qobject.h>
+#include <tqobject.h>
//-------------------------------
// Samba client library includes
@@ -92,7 +92,7 @@ class KProcess;
//===========================================================================
-class SMBSlave : public QObject, public KIO::SlaveBase
+class SMBSlave : public TQObject, public KIO::SlaveBase
{
Q_OBJECT
@@ -105,10 +105,10 @@ private:
/**
* From Controlcenter
*/
- QString m_default_user;
-// QString m_default_workgroup; //currently unused, Alex <[email protected]>
- QString m_default_password;
- QString m_default_encoding;
+ TQString m_default_user;
+// TQString m_default_workgroup; //currently unused, Alex <[email protected]>
+ TQString m_default_password;
+ TQString m_default_encoding;
/**
* we store the current url, it's needed for
@@ -234,7 +234,7 @@ public:
//-----------------------------------------------------------------------
// Functions overwritten in kio_smb.cpp
- SMBSlave(const QCString& pool, const QCString& app);
+ SMBSlave(const TQCString& pool, const TQCString& app);
virtual ~SMBSlave();
// Functions overwritten in kio_smb_browse.cpp
@@ -255,18 +255,18 @@ public:
virtual void put( const KURL& kurl, int permissions, bool overwrite, bool resume );
// Functions not implemented (yet)
- //virtual void setHost(const QString& host, int port, const QString& user, const QString& pass);
+ //virtual void setHost(const TQString& host, int port, const TQString& user, const TQString& pass);
//virtual void openConnection();
//virtual void closeConnection();
//virtual void slave_status();
- virtual void special( const QByteArray & );
+ virtual void special( const TQByteArray & );
private slots:
void readOutput(KProcess *proc, char *buffer, int buflen);
void readStdErr(KProcess *proc, char *buffer, int buflen);
private:
- QString mybuf, mystderr;
+ TQString mybuf, mystderr;
};
diff --git a/kioslave/smb/kio_smb_auth.cpp b/kioslave/smb/kio_smb_auth.cpp
index 60d9ac285..d216e1e5b 100644
--- a/kioslave/smb/kio_smb_auth.cpp
+++ b/kioslave/smb/kio_smb_auth.cpp
@@ -33,7 +33,7 @@
#include "kio_smb_internal.h"
#include <ksimpleconfig.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <stdlib.h>
// call for libsmbclient
@@ -67,14 +67,14 @@ void SMBSlave::auth_smbc_get_data(const char *server,const char *share,
kdDebug(KIO_SMB) << "AAAAAAAAAAAAAA auth_smbc_get_dat: set user=" << username << ", workgroup=" << workgroup
<< " server=" << server << ", share=" << share << endl;
- QString s_server = QString::fromUtf8(server);
- QString s_share = QString::fromUtf8(share);
+ TQString s_server = TQString::fromUtf8(server);
+ TQString s_share = TQString::fromUtf8(share);
workgroup[wgmaxlen - 1] = 0;
- QString s_workgroup = QString::fromUtf8(workgroup);
+ TQString s_workgroup = TQString::fromUtf8(workgroup);
username[unmaxlen - 1] = 0;
- QString s_username = QString::fromUtf8(username);
+ TQString s_username = TQString::fromUtf8(username);
password[pwmaxlen - 1] = 0;
- QString s_password = QString::fromUtf8(password);
+ TQString s_password = TQString::fromUtf8(password);
KIO::AuthInfo info;
info.url = KURL("smb:///");
@@ -93,7 +93,7 @@ void SMBSlave::auth_smbc_get_data(const char *server,const char *share,
{
// ok, we do not know the password. Let's try anonymous before we try for real
info.username = "anonymous";
- info.password = QString::null;
+ info.password = TQString::null;
}
else
{
@@ -117,7 +117,7 @@ bool SMBSlave::checkPassword(SMBUrl &url)
info.url = KURL("smb:///");
info.url.setHost(url.host());
- QString share = url.path();
+ TQString share = url.path();
int index = share.find('/', 1);
if (index > 1)
share = share.left(index);
diff --git a/kioslave/smb/kio_smb_browse.cpp b/kioslave/smb/kio_smb_browse.cpp
index de6bf4ed2..e9a216fd3 100644
--- a/kioslave/smb/kio_smb_browse.cpp
+++ b/kioslave/smb/kio_smb_browse.cpp
@@ -34,7 +34,7 @@
#include <pwd.h>
#include <grp.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include <kglobal.h>
@@ -83,7 +83,7 @@ bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ign
if ( user )
udsatom.m_str = user->pw_name;
else
- udsatom.m_str = QString::number( uid );
+ udsatom.m_str = TQString::number( uid );
udsentry.append(udsatom);
udsatom.m_uds = KIO::UDS_GROUP;
@@ -92,7 +92,7 @@ bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ign
if ( grp )
udsatom.m_str = grp->gr_name;
else
- udsatom.m_str = QString::number( gid );
+ udsatom.m_str = TQString::number( gid );
udsentry.append(udsatom);
udsatom.m_uds = KIO::UDS_ACCESS;
@@ -194,7 +194,7 @@ void SMBSlave::stat( const KURL& kurl )
KURL SMBSlave::checkURL(const KURL& kurl) const
{
kdDebug(KIO_SMB) << "checkURL " << kurl << endl;
- QString surl = kurl.url();
+ TQString surl = kurl.url();
if (surl.startsWith("smb:/")) {
if (surl.length() == 5) // just the above
return kurl; // unchanged
@@ -211,7 +211,7 @@ KURL SMBSlave::checkURL(const KURL& kurl) const
if (surl.contains('@') && !surl.contains("smb://")) {
KURL url(kurl);
url.setPath("/"+kurl.url().right( kurl.url().length()-kurl.url().find('@') -1));
- QString userinfo = kurl.url().mid(5, kurl.url().find('@')-5);
+ TQString userinfo = kurl.url().mid(5, kurl.url().find('@')-5);
if(userinfo.contains(':')) {
url.setUser(userinfo.left(userinfo.find(':')));
url.setPass(userinfo.right(userinfo.length()-userinfo.find(':')-1));
@@ -305,7 +305,7 @@ void SMBSlave::reportError(const SMBUrl &url)
"if they ask for it)") );
break;
default:
- error( ERR_INTERNAL, i18n("Unknown error condition in stat: %1").arg(QString::fromLocal8Bit( strerror(errno))) );
+ error( ERR_INTERNAL, i18n("Unknown error condition in stat: %1").arg(TQString::fromLocal8Bit( strerror(errno))) );
}
}
@@ -343,10 +343,10 @@ void SMBSlave::listDir( const KURL& kurl )
// Set name
atom.m_uds = KIO::UDS_NAME;
- QString dirpName = QString::fromUtf8( dirp->name );
+ TQString dirpName = TQString::fromUtf8( dirp->name );
// We cannot trust dirp->commentlen has it might be with or without the NUL character
// See KDE bug #111430 and Samba bug #3030
- QString comment = QString::fromUtf8( dirp->comment );
+ TQString comment = TQString::fromUtf8( dirp->comment );
if ( dirp->smbc_type == SMBC_SERVER || dirp->smbc_type == SMBC_WORKGROUP ) {
atom.m_str = dirpName.lower();
atom.m_str.at( 0 ) = dirpName.at( 0 ).upper();
@@ -398,18 +398,18 @@ void SMBSlave::listDir( const KURL& kurl )
if (dirp->smbc_type == SMBC_SERVER) {
atom.m_uds = KIO::UDS_URL;
- // QString workgroup = m_current_url.host().upper();
+ // TQString workgroup = m_current_url.host().upper();
KURL u("smb:/");
u.setHost(dirpName);
atom.m_str = u.url();
// when libsmbclient knows
- // atom.m_str = QString("smb://%1?WORKGROUP=%2").arg(dirpName).arg(workgroup.upper());
+ // atom.m_str = TQString("smb://%1?WORKGROUP=%2").arg(dirpName).arg(workgroup.upper());
kdDebug(KIO_SMB) << "list item " << atom.m_str << endl;
udsentry.append(atom);
atom.m_uds = KIO::UDS_MIME_TYPE;
- atom.m_str = QString::fromLatin1("application/x-smb-server");
+ atom.m_str = TQString::fromLatin1("application/x-smb-server");
udsentry.append(atom);
}
@@ -429,11 +429,11 @@ void SMBSlave::listDir( const KURL& kurl )
udsentry.append(atom);
atom.m_uds = KIO::UDS_MIME_TYPE;
- atom.m_str = QString::fromLatin1("application/x-smb-workgroup");
+ atom.m_str = TQString::fromLatin1("application/x-smb-workgroup");
udsentry.append(atom);
atom.m_uds = KIO::UDS_URL;
- // QString workgroup = m_current_url.host().upper();
+ // TQString workgroup = m_current_url.host().upper();
KURL u("smb:/");
u.setHost(dirpName);
atom.m_str = u.url();
diff --git a/kioslave/smb/kio_smb_config.cpp b/kioslave/smb/kio_smb_config.cpp
index c772f8b94..101ba160d 100644
--- a/kioslave/smb/kio_smb_config.cpp
+++ b/kioslave/smb/kio_smb_config.cpp
@@ -33,7 +33,7 @@
#include "kio_smb_internal.h"
#include <kconfig.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
//===========================================================================
void SMBSlave::reparseConfiguration()
{
@@ -43,23 +43,23 @@ void SMBSlave::reparseConfiguration()
// m_default_workgroup=cfg->readEntry("Workgroup");
// m_showHiddenShares=cfg->readBoolEntry("ShowHiddenShares",false);
- QString m_encoding = QTextCodec::codecForLocale()->name();
+ TQString m_encoding = TQTextCodec::codecForLocale()->name();
m_default_encoding = cfg->readEntry( "Encoding", m_encoding.lower() );
// unscramble, taken from Nicola Brodu's smb ioslave
//not really secure, but better than storing the plain password
- QString scrambled = cfg->readEntry( "Password" );
+ TQString scrambled = cfg->readEntry( "Password" );
m_default_password = "";
for (uint i=0; i<scrambled.length()/3; i++)
{
- QChar qc1 = scrambled[i*3];
- QChar qc2 = scrambled[i*3+1];
- QChar qc3 = scrambled[i*3+2];
+ TQChar qc1 = scrambled[i*3];
+ TQChar qc2 = scrambled[i*3+1];
+ TQChar qc3 = scrambled[i*3+2];
unsigned int a1 = qc1.latin1() - '0';
unsigned int a2 = qc2.latin1() - 'A';
unsigned int a3 = qc3.latin1() - '0';
unsigned int num = ((a1 & 0x3F) << 10) | ((a2& 0x1F) << 5) | (a3 & 0x1F);
- m_default_password[i] = QChar((uchar)((num - 17) ^ 173)); // restore
+ m_default_password[i] = TQChar((uchar)((num - 17) ^ 173)); // restore
}
delete cfg;
diff --git a/kioslave/smb/kio_smb_file.cpp b/kioslave/smb/kio_smb_file.cpp
index 67fe0d213..8c7867722 100644
--- a/kioslave/smb/kio_smb_file.cpp
+++ b/kioslave/smb/kio_smb_file.cpp
@@ -45,7 +45,7 @@ void SMBSlave::get( const KURL& kurl )
time_t lasttime = 0;
time_t starttime = 0;
KIO::filesize_t totalbytesread = 0;
- QByteArray filedata;
+ TQByteArray filedata;
SMBUrl url;
kdDebug(KIO_SMB) << "SMBSlave::get on " << kurl << endl;
@@ -132,7 +132,7 @@ void SMBSlave::get( const KURL& kurl )
}
smbc_close(filefd);
- data( QByteArray() );
+ data( TQByteArray() );
processedSize(static_cast<KIO::filesize_t>(st.st_size));
}
@@ -161,7 +161,7 @@ void SMBSlave::put( const KURL& kurl,
int filefd;
bool exists;
mode_t mode;
- QByteArray filedata;
+ TQByteArray filedata;
kdDebug(KIO_SMB) << "SMBSlave::put on " << kurl << endl;
diff --git a/kioslave/smb/kio_smb_internal.cpp b/kioslave/smb/kio_smb_internal.cpp
index 27cdfb8d3..3660e3e8a 100644
--- a/kioslave/smb/kio_smb_internal.cpp
+++ b/kioslave/smb/kio_smb_internal.cpp
@@ -31,7 +31,7 @@
#include "kio_smb.h"
#include "kio_smb_internal.h"
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include <kconfig.h>
#include <kglobal.h>
@@ -57,14 +57,14 @@ SMBUrl::SMBUrl(const KURL& kurl)
//-----------------------------------------------------------------------
-void SMBUrl::addPath(const QString &filedir)
+void SMBUrl::addPath(const TQString &filedir)
{
KURL::addPath(filedir);
updateCache();
}
//-----------------------------------------------------------------------
-bool SMBUrl::cd(const QString &filedir)
+bool SMBUrl::cd(const TQString &filedir)
{
if (!KURL::cd(filedir))
return false;
@@ -83,7 +83,7 @@ void SMBUrl::updateCache()
if (KURL::url() == "smb:/")
m_surl = "smb://";
else {
- QString surl = "smb://";
+ TQString surl = "smb://";
if (KURL::hasUser()) {
surl += KURL::encode_string(KURL::user(), 106);
if (KURL::hasPass()) {
diff --git a/kioslave/smb/kio_smb_internal.h b/kioslave/smb/kio_smb_internal.h
index aabfc7ab7..b6da04e58 100644
--- a/kioslave/smb/kio_smb_internal.h
+++ b/kioslave/smb/kio_smb_internal.h
@@ -65,9 +65,9 @@ public:
* Appends the specified file and dir to this SMBUrl
* "smb://server/share" --> "smb://server/share/filedir"
*/
- void addPath(const QString &filedir);
+ void addPath(const TQString &filedir);
- bool cd(const QString &dir);
+ bool cd(const TQString &dir);
/**
* Returns the type of this SMBUrl:
@@ -78,33 +78,33 @@ public:
*/
SMBUrlType getType() const;
- void setPass( const QString& _txt ) { KURL::setPass(_txt); updateCache(); }
- void setUser( const QString& _txt ) { KURL::setUser(_txt); updateCache(); }
- void setHost( const QString& _txt ) { KURL::setHost(_txt); updateCache(); }
+ void setPass( const TQString& _txt ) { KURL::setPass(_txt); updateCache(); }
+ void setUser( const TQString& _txt ) { KURL::setUser(_txt); updateCache(); }
+ void setHost( const TQString& _txt ) { KURL::setHost(_txt); updateCache(); }
/**
* Returns the workgroup if it given in url
*/
-// QString getWorkgroup() const;
+// TQString getWorkgroup() const;
/**
* Returns path after workgroup
*/
-// QString getServerShareDir() const;
+// TQString getServerShareDir() const;
/**
* Return a URL that is suitable for libsmbclient
*/
- QCString toSmbcUrl() const { return m_surl; }
+ TQCString toSmbcUrl() const { return m_surl; }
private:
/**
- * Change from QString to QCString (MS Windows's character encoding)
+ * Change from TQString to TQCString (MS Windows's character encoding)
*/
- QCString fromUnicode( const QString &_str ) const;
+ TQCString fromUnicode( const TQString &_str ) const;
void updateCache();
- QCString m_surl;
+ TQCString m_surl;
/**
* Type of URL
diff --git a/kioslave/smb/kio_smb_mount.cpp b/kioslave/smb/kio_smb_mount.cpp
index 08d62ed39..f9c366235 100644
--- a/kioslave/smb/kio_smb_mount.cpp
+++ b/kioslave/smb/kio_smb_mount.cpp
@@ -20,26 +20,26 @@
#include "kio_smb.h"
#include <kstandarddirs.h>
-#include <qcstring.h>
+#include <tqcstring.h>
#include <unistd.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kprocess.h>
void SMBSlave::readOutput(KProcess *, char *buffer, int buflen)
{
- mybuf += QString::fromLocal8Bit(buffer, buflen);
+ mybuf += TQString::fromLocal8Bit(buffer, buflen);
}
void SMBSlave::readStdErr(KProcess *, char *buffer, int buflen)
{
- mystderr += QString::fromLocal8Bit(buffer, buflen);
+ mystderr += TQString::fromLocal8Bit(buffer, buflen);
}
-void SMBSlave::special( const QByteArray & data)
+void SMBSlave::special( const TQByteArray & data)
{
kdDebug(KIO_SMB)<<"Smb::special()"<<endl;
int tmp;
- QDataStream stream(data, IO_ReadOnly);
+ TQDataStream stream(data, IO_ReadOnly);
stream >> tmp;
//mounting and umounting are both blocking, "guarded" by a SIGALARM in the future
switch (tmp)
@@ -47,11 +47,11 @@ void SMBSlave::special( const QByteArray & data)
case 1:
case 3:
{
- QString remotePath, mountPoint, user;
+ TQString remotePath, mountPoint, user;
stream >> remotePath >> mountPoint;
- QStringList sl=QStringList::split("/",remotePath);
- QString share,host;
+ TQStringList sl=TQStringList::split("/",remotePath);
+ TQString share,host;
if (sl.count()>=2)
{
host=(*sl.at(0)).mid(2);
@@ -89,7 +89,7 @@ void SMBSlave::special( const QByteArray & data)
proc.setUseShell(true); // to have the path to smbmnt (which is used by smbmount); see man smbmount
proc << "smbmount";
- QString options;
+ TQString options;
if ( smburl.user().isEmpty() )
{
@@ -113,11 +113,11 @@ void SMBSlave::special( const QByteArray & data)
proc << KProcess::quote(mountPoint.local8Bit());
proc << options;
- connect(&proc, SIGNAL( receivedStdout(KProcess *, char *, int )),
- SLOT(readOutput(KProcess *, char *, int)));
+ connect(&proc, TQT_SIGNAL( receivedStdout(KProcess *, char *, int )),
+ TQT_SLOT(readOutput(KProcess *, char *, int)));
- connect(&proc, SIGNAL( receivedStderr(KProcess *, char *, int )),
- SLOT(readStdErr(KProcess *, char *, int)));
+ connect(&proc, TQT_SIGNAL( receivedStderr(KProcess *, char *, int )),
+ TQT_SLOT(readStdErr(KProcess *, char *, int)));
if (!proc.start( KProcess::Block, KProcess::AllOutput ))
{
@@ -143,7 +143,7 @@ void SMBSlave::special( const QByteArray & data)
case 2:
case 4:
{
- QString mountPoint;
+ TQString mountPoint;
stream >> mountPoint;
KProcess proc;
@@ -154,11 +154,11 @@ void SMBSlave::special( const QByteArray & data)
mybuf.truncate(0);
mystderr.truncate(0);
- connect(&proc, SIGNAL( receivedStdout(KProcess *, char *, int )),
- SLOT(readOutput(KProcess *, char *, int)));
+ connect(&proc, TQT_SIGNAL( receivedStdout(KProcess *, char *, int )),
+ TQT_SLOT(readOutput(KProcess *, char *, int)));
- connect(&proc, SIGNAL( receivedStderr(KProcess *, char *, int )),
- SLOT(readStdErr(KProcess *, char *, int)));
+ connect(&proc, TQT_SIGNAL( receivedStderr(KProcess *, char *, int )),
+ TQT_SLOT(readStdErr(KProcess *, char *, int)));
if ( !proc.start( KProcess::Block, KProcess::AllOutput ) )
{
@@ -182,12 +182,12 @@ void SMBSlave::special( const QByteArray & data)
{
bool ok;
- QDir dir(mountPoint);
+ TQDir dir(mountPoint);
dir.cdUp();
ok = dir.rmdir(mountPoint);
if ( ok )
{
- QString p=dir.path();
+ TQString p=dir.path();
dir.cdUp();
ok = dir.rmdir(p);
}