Commit c0860710 authored by Stephan Kulow's avatar Stephan Kulow
Browse files

svn merge svn+ssh://coolo@svn.kde.org/home/kde/trunk/KDE/kdebase@438057

          svn+ssh://coolo@svn.kde.org/home/kde/branches/work/kde4/kdebase
          .

I couldn't resolve one kicker conflict that results from different
development directions, so I rely on Aaron to sort it out - the file
is commited with conflicts

svn path=/trunk/KDE/kdebase/kioslave/; revision=439627
parent dae440dc
......@@ -22,12 +22,15 @@
#include <stdlib.h>
#include <qstring.h>
//Added by qt3to4:
#include <QTextStream>
#include <Q3CString>
#include <kinstance.h>
#include <kurl.h>
using namespace KIO;
AboutProtocol::AboutProtocol(const QCString &pool_socket, const QCString &app_socket)
AboutProtocol::AboutProtocol(const Q3CString &pool_socket, const Q3CString &app_socket)
: SlaveBase("about", pool_socket, app_socket)
{
}
......@@ -40,7 +43,7 @@ void AboutProtocol::get( const KURL& )
{
QString output;
QTextStream os(&output, IO_WriteOnly);
QTextStream os(&output, QIODevice::WriteOnly);
os.setEncoding(QTextStream::Locale);
os << "<html><head><title>about:blank</title></head><body></body></html>";
......
......@@ -20,7 +20,7 @@
#ifndef __kio_about_h__
#define __kio_about_h__
#include <qcstring.h>
#include <q3cstring.h>
#include <kio/global.h>
#include <kio/slavebase.h>
......@@ -29,7 +29,7 @@
class AboutProtocol : public KIO::SlaveBase
{
public:
AboutProtocol(const QCString &pool_socket, const QCString &app_socket);
AboutProtocol(const Q3CString &pool_socket, const Q3CString &app_socket);
virtual ~AboutProtocol();
virtual void get(const KURL& url);
......
......@@ -20,6 +20,8 @@
#include <qdir.h>
#include <qregexp.h>
//Added by qt3to4:
#include <Q3CString>
#include <kdebug.h>
#include <kprocess.h>
......@@ -32,7 +34,7 @@
using namespace KIO;
CgiProtocol::CgiProtocol( const QCString &pool, const QCString &app )
CgiProtocol::CgiProtocol( const Q3CString &pool, const Q3CString &app )
: SlaveBase( "cgi", pool, app )
{
kdDebug(7124) << "CgiProtocol::CgiProtocol" << endl;
......@@ -57,13 +59,13 @@ void CgiProtocol::get( const KURL& url )
kdDebug(7124) << " Protocol: " << url.protocol() << endl;
kdDebug(7124) << " Filename: " << url.filename() << endl;
#endif
QCString protocol = "SERVER_PROTOCOL=HTTP";
Q3CString protocol = "SERVER_PROTOCOL=HTTP";
putenv( protocol.data() );
QCString requestMethod = "REQUEST_METHOD=GET";
Q3CString requestMethod = "REQUEST_METHOD=GET";
putenv( requestMethod.data() );
QCString query = url.query().mid( 1 ).local8Bit();
Q3CString query = url.query().mid( 1 ).local8Bit();
query.prepend( "QUERY_STRING=" );
putenv( query.data() );
......@@ -98,7 +100,7 @@ void CgiProtocol::get( const KURL& url )
if ( forwardFile ) {
kdDebug(7124) << "Forwarding to '" << path << "'" << endl;
QCString filepath = QFile::encodeName( path );
Q3CString filepath = QFile::encodeName( path );
fd = fopen( filepath.data(), "r" );
......@@ -139,7 +141,7 @@ void CgiProtocol::get( const KURL& url )
buffer[n] = 0;
if ( stripHeader ) {
QCString output = buffer; // this assumes buffer is text and not binary
Q3CString output = buffer; // this assumes buffer is text and not binary
int colon = output.find( ':' );
int newline = output.find( '\n' );
int semicolon = output.findRev( ';', newline );
......@@ -154,7 +156,7 @@ void CgiProtocol::get( const KURL& url )
kdDebug(7124) << " end: " << end << endl;
#endif
QCString contentType = output.mid( colon + 1, end - colon - 1 );
Q3CString contentType = output.mid( colon + 1, end - colon - 1 );
contentType = contentType.stripWhiteSpace();
......
......@@ -19,6 +19,8 @@
#define KIO_CGI_H
#include <qobject.h>
//Added by qt3to4:
#include <Q3CString>
#include <kio/slavebase.h>
......@@ -31,7 +33,7 @@ class KProcess;
class CgiProtocol : public KIO::SlaveBase
{
public:
CgiProtocol( const QCString &pool, const QCString &app );
CgiProtocol( const Q3CString &pool, const Q3CString &app );
virtual ~CgiProtocol();
virtual void get( const KURL& url );
......
......@@ -23,10 +23,12 @@
#include <kfiledialog.h>
#include <qlayout.h>
#include <qlistbox.h>
#include <q3listbox.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qhbox.h>
#include <q3groupbox.h>
#include <q3hbox.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include "kcmcgi.h"
#include "kcmcgi.moc"
......@@ -48,12 +50,12 @@ KCMCgi::KCMCgi(QWidget *parent, const char *name)
QVBoxLayout *topLayout = new QVBoxLayout(this, 0, KDialog::spacingHint());
QGroupBox *topBox = new QGroupBox( 1, Horizontal, i18n("Paths to Local CGI Programs"), this );
Q3GroupBox *topBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Paths to Local CGI Programs"), this );
topLayout->addWidget( topBox );
mListBox = new QListBox( topBox );
mListBox = new Q3ListBox( topBox );
QHBox *buttonBox = new QHBox( topBox );
Q3HBox *buttonBox = new Q3HBox( topBox );
buttonBox->setSpacing( KDialog::spacingHint() );
mAddButton = new QPushButton( i18n("Add..."), buttonBox );
......@@ -61,7 +63,7 @@ KCMCgi::KCMCgi(QWidget *parent, const char *name)
mRemoveButton = new QPushButton( i18n("Remove"), buttonBox );
connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removePath() ) );
connect( mListBox, SIGNAL( clicked ( QListBoxItem * )),this, SLOT( slotItemSelected( QListBoxItem *)));
connect( mListBox, SIGNAL( clicked ( Q3ListBoxItem * )),this, SLOT( slotItemSelected( Q3ListBoxItem *)));
mConfig = new KConfig("kcmcgirc");
......@@ -82,7 +84,7 @@ KCMCgi::~KCMCgi()
delete mConfig;
}
void KCMCgi::slotItemSelected( QListBoxItem * )
void KCMCgi::slotItemSelected( Q3ListBoxItem * )
{
updateButton();
}
......
......@@ -20,7 +20,7 @@
#include <kcmodule.h>
class QListBox;
class Q3ListBox;
class QPushButton;
class KConfig;
......@@ -42,10 +42,10 @@ class KCMCgi : public KCModule
protected slots:
void addPath();
void removePath();
void slotItemSelected( QListBoxItem * item );
void slotItemSelected( Q3ListBoxItem * item );
private:
void updateButton();
QListBox *mListBox;
Q3ListBox *mListBox;
QPushButton *mAddButton;
QPushButton *mRemoveButton;
......
......@@ -31,6 +31,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kfilterbase.h>
#include "filter.h"
//Added by qt3to4:
#include <Q3CString>
extern "C" { KDE_EXPORT int kdemain(int argc, char **argv); }
......@@ -53,7 +55,7 @@ int kdemain( int argc, char ** argv)
return 0;
}
FilterProtocol::FilterProtocol( const QCString & protocol, const QCString &pool, const QCString &app )
FilterProtocol::FilterProtocol( const Q3CString & protocol, const Q3CString &pool, const Q3CString &app )
: KIO::SlaveBase( protocol, pool, app )
{
QString mimetype = QString::fromLatin1("application/x-") + QString::fromLatin1(protocol);
......@@ -75,7 +77,7 @@ void FilterProtocol::get( const KURL & )
}
needSubURLData();
filter->init(IO_ReadOnly);
filter->init(QIODevice::ReadOnly);
bool bNeedHeader = true;
bool bNeedMimetype = true;
......
......@@ -25,13 +25,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define __filter_h__
#include <qobject.h>
//Added by qt3to4:
#include <Q3CString>
#include <kio/global.h>
#include <kio/slavebase.h>
class FilterProtocol : public QObject, public KIO::SlaveBase
{
public:
FilterProtocol( const QCString & protocol, const QCString &pool, const QCString &app );
FilterProtocol( const Q3CString & protocol, const Q3CString &pool, const Q3CString &app );
virtual void get( const KURL &url );
virtual void put( const KURL &url, int _mode, bool _overwrite,
......
......@@ -22,8 +22,8 @@
#include <string.h>
#include <qtextstream.h>
#include <qdict.h>
#include <qcstring.h>
#include <q3dict.h>
#include <q3cstring.h>
#include <qfile.h>
#include <qregexp.h>
......@@ -67,7 +67,7 @@ extern "C"
/* ---------------------------------------------------------------------------------- */
FingerProtocol::FingerProtocol(const QCString &pool_socket, const QCString &app_socket)
FingerProtocol::FingerProtocol(const Q3CString &pool_socket, const Q3CString &app_socket)
: QObject(), SlaveBase("finger", pool_socket, app_socket)
{
myStdStream = new QString();
......@@ -133,7 +133,7 @@ void FingerProtocol::get(const KURL& url )
myKProcess->start(KProcess::Block, KProcess::All);
data(QCString(myStdStream->local8Bit()));
data(Q3CString(myStdStream->local8Bit()));
data(QByteArray());
finished();
......
......@@ -21,7 +21,7 @@
#define __kio_finger_h__
#include <qstring.h>
#include <qcstring.h>
#include <q3cstring.h>
#include <kurl.h>
#include <kprocess.h>
......@@ -34,7 +34,7 @@ class FingerProtocol : public QObject, public KIO::SlaveBase
public:
FingerProtocol(const QCString &pool_socket, const QCString &app_socket);
FingerProtocol(const Q3CString &pool_socket, const Q3CString &app_socket);
virtual ~FingerProtocol();
virtual void mimetype(const KURL& url);
......
......@@ -26,9 +26,9 @@
#include "config.h"
#include <qcstring.h>
#include <q3cstring.h>
#include <qfile.h>
#include <qsocket.h>
#include <q3socket.h>
#include <qdatetime.h>
#include <qbitarray.h>
#include <qregexp.h>
......@@ -69,7 +69,6 @@
#include <klocale.h>
#include <kremoteencoding.h>
#include <kurl.h>
#include <ksock.h>
#include <stdarg.h>
#include <time.h>
#include <sys/stat.h>
......@@ -236,7 +235,7 @@ const struct fishProtocol::fish_info fishProtocol::fishInfo[] = {
0 }
};
fishProtocol::fishProtocol(const QCString &pool_socket, const QCString &app_socket)
fishProtocol::fishProtocol(const Q3CString &pool_socket, const Q3CString &app_socket)
: SlaveBase("fish", pool_socket, app_socket), mimeBuffer(1024),
mimeTypeSent(false)
{
......@@ -536,7 +535,7 @@ manages initial communication setup including password queries
int fishProtocol::establishConnection(char *buffer, int len) {
QString buf;
buf.setLatin1(buffer,len);
int pos;
int pos=0;
// Strip trailing whitespace
while (buf.length() && (buf[buf.length()-1] == ' '))
buf.truncate(buf.length()-1);
......@@ -1170,7 +1169,7 @@ void fishProtocol::sent()
{
if (rawWrite > 0) {
myDebug( << "writing raw: " << rawData.size() << "/" << rawWrite << endl);
writeChild(rawData.data(),((unsigned int)rawWrite > rawData.size()?rawData.size():rawWrite));
writeChild(rawData.data(),((int)rawWrite > rawData.size()?rawData.size():rawWrite));
rawWrite -= rawData.size();
if (rawWrite > 0) {
dataReq();
......@@ -1263,7 +1262,7 @@ int fishProtocol::received(const char *buffer, int buflen)
if (pos < buflen)
{
QString s = remoteEncoding()->decode(QCString(buffer,pos+1));
QString s = remoteEncoding()->decode(Q3CString(buffer,pos+1));
buffer += pos+1;
buflen -= pos+1;
......@@ -1582,7 +1581,7 @@ void fishProtocol::del(const KURL &u, bool isFile){
void fishProtocol::special( const QByteArray &data ){
int tmp;
QDataStream stream(data, IO_ReadOnly);
QDataStream stream(data);
stream >> tmp;
switch (tmp) {
......
......@@ -17,7 +17,9 @@
#define __fish_h__
#include <qstring.h>
#include <qcstring.h>
#include <q3cstring.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <kurl.h>
......@@ -32,7 +34,7 @@
class fishProtocol : public KIO::SlaveBase
{
public:
fishProtocol(const QCString &pool_socket, const QCString &app_socket);
fishProtocol(const Q3CString &pool_socket, const Q3CString &app_socket);
virtual ~fishProtocol();
/**
......@@ -135,7 +137,7 @@ protected: // Protected attributes
/** queue for commands to be sent */
QStringList commandList;
/** queue for commands to be sent */
QValueList<int> commandCodes;
Q3ValueList<int> commandCodes;
/** bytes still to be read in raw mode */
int rawRead;
/** bytes still to be written in raw mode */
......
......@@ -37,7 +37,7 @@
#include <sys/types.h>
#include <qtextstream.h>
#include <qcstring.h>
#include <q3cstring.h>
#include <qfile.h>
#include "kio_floppy.h"
......@@ -81,7 +81,7 @@ void getDriveAndPath(const QString& path, QString& drive, QString& rest)
}
}
FloppyProtocol::FloppyProtocol (const QCString &pool, const QCString &app )
FloppyProtocol::FloppyProtocol (const Q3CString &pool, const Q3CString &app )
:SlaveBase( "floppy", pool, app )
,m_mtool(0)
,m_stdoutBuffer(0)
......
......@@ -43,7 +43,7 @@ struct StatInfo
class FloppyProtocol : public KIO::SlaveBase
{
public:
FloppyProtocol (const QCString &pool, const QCString &app );
FloppyProtocol (const Q3CString &pool, const Q3CString &app );
virtual ~FloppyProtocol();
virtual void listDir( const KURL& url);
......
......@@ -6,6 +6,8 @@
#include <qfile.h>
#include <qtextstream.h>
#include <qregexp.h>
//Added by qt3to4:
#include <Q3CString>
#include <kdebug.h>
#include <kprocess.h>
......@@ -18,7 +20,7 @@
using namespace KIO;
InfoProtocol::InfoProtocol( const QCString &pool, const QCString &app )
InfoProtocol::InfoProtocol( const Q3CString &pool, const Q3CString &app )
: SlaveBase( "info", pool, app )
, m_page( "" )
, m_node( "" )
......
......@@ -2,6 +2,8 @@
#define __info_h__
#include <qobject.h>
//Added by qt3to4:
#include <Q3CString>
#include <kio/slavebase.h>
......@@ -11,7 +13,7 @@ class InfoProtocol : public KIO::SlaveBase
{
public:
InfoProtocol( const QCString &pool, const QCString &app );
InfoProtocol( const Q3CString &pool, const Q3CString &app );
virtual ~InfoProtocol();
virtual void get( const KURL& url );
......
......@@ -23,6 +23,8 @@
#include <kabc/ldif.h>
#include "kio_ldap.h"
//Added by qt3to4:
#include <Q3CString>
using namespace KIO;
using namespace KABC;
......@@ -54,8 +56,8 @@ int kdemain( int argc, char **argv )
/**
* Initialize the ldap slave
*/
LDAPProtocol::LDAPProtocol( const QCString &protocol, const QCString &pool,
const QCString &app ) : SlaveBase( protocol, pool, app )
LDAPProtocol::LDAPProtocol( const Q3CString &protocol, const Q3CString &pool,
const Q3CString &app ) : SlaveBase( protocol, pool, app )
{
mLDAP = 0; mTLS = 0; mVer = 3; mAuthSASL = false;
mRealm = ""; mBindName = "";
......@@ -167,7 +169,7 @@ void LDAPProtocol::controlsFromMetaData( LDAPControl ***serverctrls,
QString oid; bool critical; QByteArray value;
int i = 0;
while ( hasMetaData( QString::fromLatin1("SERVER_CTRL%1").arg(i) ) ) {
QCString val = metaData( QString::fromLatin1("SERVER_CTRL%1").arg(i) ).utf8();
Q3CString val = metaData( QString::fromLatin1("SERVER_CTRL%1").arg(i) ).utf8();
LDIF::splitControl( val, oid, critical, value );
kdDebug(7125) << "server ctrl #" << i << " value: " << val <<
" oid: " << oid << " critical: " << critical << " value: " <<
......@@ -177,7 +179,7 @@ void LDAPProtocol::controlsFromMetaData( LDAPControl ***serverctrls,
}
i = 0;
while ( hasMetaData( QString::fromLatin1("CLIENT_CTRL%1").arg(i) ) ) {
QCString val = metaData( QString::fromLatin1("CLIENT_CTRL%1").arg(i) ).utf8();
Q3CString val = metaData( QString::fromLatin1("CLIENT_CTRL%1").arg(i) ).utf8();
LDIF::splitControl( val, oid, critical, value );
kdDebug(7125) << "client ctrl #" << i << " value: " << val <<
" oid: " << oid << " critical: " << critical << " value: " <<
......@@ -220,7 +222,7 @@ int LDAPProtocol::asyncSearch( LDAPUrl &usrc )
usrc.scope() << " filter=\"" << usrc.filter() << "\" attrs=" << usrc.attributes() <<
endl;
retval = ldap_search_ext( mLDAP, usrc.dn().utf8(), scope,
usrc.filter().isEmpty() ? QCString() : usrc.filter().utf8(), attrs, 0,
usrc.filter().isEmpty() ? Q3CString() : usrc.filter().utf8(), attrs, 0,
serverctrls, clientctrls,
0, mSizeLimit, &msgid );
......@@ -237,16 +239,16 @@ int LDAPProtocol::asyncSearch( LDAPUrl &usrc )
return retval;
}
QCString LDAPProtocol::LDAPEntryAsLDIF( LDAPMessage *message )
Q3CString LDAPProtocol::LDAPEntryAsLDIF( LDAPMessage *message )
{
QCString result;
Q3CString result;
char *name;
struct berval **bvals;
BerElement *entry;
QByteArray tmp;
char *dn = ldap_get_dn( mLDAP, message );
if ( dn == NULL ) return QCString( "" );
if ( dn == NULL ) return Q3CString( "" );
tmp.setRawData( dn, strlen( dn ) );
result += LDIF::assembleLine( "dn", tmp ) + '\n';
tmp.resetRawData( dn, strlen( dn ) );
......@@ -755,7 +757,7 @@ void LDAPProtocol::get( const KURL &_url )
// tell the mimetype
mimeType("text/plain");
// collect the result
QCString result;
Q3CString result;
filesize_t processed_size = 0;
QByteArray array;
......@@ -955,7 +957,7 @@ void LDAPProtocol::put( const KURL &_url, int, bool overwrite, bool )
" deloldrdn: " << ldif.delOldRdn() << endl;
controlsFromMetaData( &serverctrls, &clientctrls );
ldaperr = ldap_rename_s( mLDAP, ldif.dn().utf8(), ldif.newRdn().utf8(),
ldif.newSuperior().isEmpty() ? QCString() : ldif.newSuperior().utf8(),
ldif.newSuperior().isEmpty() ? Q3CString() : ldif.newSuperior().utf8(),
ldif.delOldRdn(), serverctrls, clientctrls );
FREELDAPMEM;
......
......@@ -2,7 +2,9 @@
#define __LDAP_H__
#include <qstring.h>
#include <qvaluelist.h>
#include <q3valuelist.h>
//Added by qt3to4:
#include <Q3CString>
#include <kio/slavebase.h>
#include <kio/authinfo.h>
......@@ -14,7 +16,7 @@
class LDAPProtocol : public KIO::SlaveBase
{
public:
LDAPProtocol( const QCString &protocol, const QCString &pool, const QCString &app );
LDAPProtocol( const Q3CString &protocol, const Q3CString &pool, const Q3CString &app );
virtual ~LDAPProtocol();
virtual void setHost( const QString& host, int port,
......@@ -54,7 +56,7 @@ class LDAPProtocol : public KIO::SlaveBase
const KABC::LDAPUrl &usrc, bool dir=false );
int asyncSearch( KABC::LDAPUrl &usrc );
QCString LDAPEntryAsLDIF( LDAPMessage *msg );
Q3CString LDAPEntryAsLDIF( LDAPMessage *msg );
void LDAPErr( const KURL &url, int err = LDAP_SUCCESS );
void changeCheck( KABC::LDAPUrl &url );
......
......@@ -24,6 +24,10 @@
#include <kconfig.h>
#include <qstring.h>
#include <qregexp.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <QTextStream>
#include <Q3CString>
#include <sys/stat.h>
#include <stdlib.h>
......@@ -43,7 +47,7 @@ extern "C" {
}
}
MacProtocol::MacProtocol(const QCString &pool, const QCString &app)
MacProtocol::MacProtocol(const Q3CString &pool, const Q3CString &app)
: QObject(), SlaveBase("mac", pool, app) {
/* logFile = new QFile("/home/jr/logfile");
logFile->open(IO_ReadWrite | IO_Append);
......@@ -151,11 +155,12 @@ void MacProtocol::listDir(const KURL& url) {
UDSEntry entry;
if (!standardOutputStream.isEmpty()) {
QTextStream in(&standardOutputStream, IO_ReadOnly);
QTextStream in(&standardOutputStream, QIODevice::ReadOnly);
QString line = in.readLine(); //throw away top file which shows current directory
line = in.readLine();
while (line != NULL) {
#warning another QString != NULL -->> !QString.isEmpty()
while (!line.isEmpty()) {
//1.0.4 puts this funny line in sometimes, we don't want it
if (line.contains("Thread ") == 0) {
entry = makeUDS(line);
......@@ -180,7 +185,7 @@ void MacProtocol::stat(const KURL& url) {
//doStat(), does all the work that stat() needs
//it's been separated out so it can be called from get() which
//also need information
QValueList<KIO::UDSAtom> MacProtocol::doStat(const KURL& url) {
Q3ValueList<KIO::UDSAtom> MacProtocol::doStat(const KURL& url) {
QString filename = prepareHP(url);
if (filename.isNull()) {
......@@ -225,7 +230,7 @@ QValueList<KIO::UDSAtom> MacProtocol::doStat(const KURL& url) {
return entry;
}//if filename == null
return QValueList<KIO::UDSAtom>();
return Q3ValueList<KIO::UDSAtom>();
}
//prepareHP() called from get() listDir() and stat()
......@@ -333,7 +338,7 @@ QString MacProtocol::prepareHP(const KURL& url) {
//makeUDS() takes a line of output from hpls -l and converts it into
// one of these UDSEntrys to return
//called from listDir() and stat()
QValueList<KIO::UDSAtom> MacProtocol::makeUDS(const QString& _line) {
Q3ValueList<KIO::UDSAtom> MacProtocol::makeUDS(const QString& _line) {
QString line(_line);
UDSEntry entry;
......
......@@ -22,15 +22,17 @@
#include <kprocess.h>
#include <qstring.h>
#include <qcstring.h>
#include <q3cstring.h>
#include <qfile.h>
#include <qtextstream.h>
//Added by qt3to4:
#include <Q3ValueList>
class MacProtocol : public QObject, public KIO::SlaveBase
{
Q_OBJECT
public:
MacProtocol(const QCString &pool, const QCString &app);