summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdecore
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdecore') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/kcatalogue.cpp4
-rw-r--r--microkde/kdecore/kconfigbase.h4
-rw-r--r--microkde/kdecore/klibloader.cpp29
-rw-r--r--microkde/kdecore/klibloader.h10
-rw-r--r--microkde/kdecore/klocale.cpp23
-rw-r--r--microkde/kdecore/klocale.h4
-rw-r--r--microkde/kdecore/kmdcodec.cpp139
-rw-r--r--microkde/kdecore/kmdcodec.h38
-rw-r--r--microkde/kdecore/kprefs.cpp16
-rw-r--r--microkde/kdecore/kprefs.h10
-rw-r--r--microkde/kdecore/kshortcut.h8
-rw-r--r--microkde/kdecore/kstandarddirs.cpp24
-rw-r--r--microkde/kdecore/kstandarddirs.h10
13 files changed, 167 insertions, 152 deletions
diff --git a/microkde/kdecore/kcatalogue.cpp b/microkde/kdecore/kcatalogue.cpp
index 97ac326..1600b08 100644
--- a/microkde/kdecore/kcatalogue.cpp
+++ b/microkde/kdecore/kcatalogue.cpp
@@ -17,12 +17,14 @@
Boston, MA 02111-1307, USA.
*/
//US #include <config.h>
#include <qfile.h>
+//Added by qt3to4:
+#include <Q3CString>
#include <kdebug.h>
#include "kcatalogue.h"
char *k_nl_find_msg(struct kde_loaded_l10nfile *domain_file,
@@ -85,13 +87,13 @@ void KCatalogue::setFileName( const QString & fileName )
{
// nothing to do if the file name is already the same
if ( this->fileName() == fileName ) return;
doUnload();
- QCString newFileName = QFile::encodeName( fileName );
+ Q3CString newFileName = QFile::encodeName( fileName );
if ( !fileName.isEmpty() )
{
// set file name
char *filename = new char[ newFileName.length() + 1 ];
::qstrcpy( filename, newFileName );
diff --git a/microkde/kdecore/kconfigbase.h b/microkde/kdecore/kconfigbase.h
index 7e56d11..1ef6a04 100644
--- a/microkde/kdecore/kconfigbase.h
+++ b/microkde/kdecore/kconfigbase.h
@@ -23,12 +23,14 @@
// $Id$
#ifndef _KCONFIGBASE_H
#define _KCONFIGBASE_H
#include "kconfig.h"
+//Added by qt3to4:
+#include <Q3CString>
/**
* Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig
* groups.
*
* Careful programmers always set the group of a
@@ -79,13 +81,13 @@ public:
{ _config->setGroup( group ); }
KConfigGroupSaver( KConfig* config, const char *group )
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
- KConfigGroupSaver( KConfig* config, const QCString &group )
+ KConfigGroupSaver( KConfig* config, const Q3CString &group )
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
~KConfigGroupSaver() { _config->setGroup( _oldgroup ); }
KConfig* config() { return _config; };
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp
index 6d0475a..0b54eb6 100644
--- a/microkde/kdecore/klibloader.cpp
+++ b/microkde/kdecore/klibloader.cpp
@@ -17,15 +17,18 @@
Boston, MA 02111-1307, USA.
*/
//US #include <config.h>
#include <qclipboard.h>
#include <qfile.h>
#include <qtimer.h>
-#include <qobjectdict.h>
-#include <qwidgetlist.h>
+#include <q3objectdict.h>
#include <qwidget.h>
+#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3CString>
+#include <Q3PtrList>
#include "kapplication.h"
#include "klibloader.h"
#include "kstandarddirs.h"
#include "kdebug.h"
#include "klocale.h"
@@ -42,13 +45,13 @@
#include <qtopia/qlibrary.h>
#else
#include <qlibrary.h>
#endif
-template class QAsciiDict<KLibrary>;
+template class Q3AsciiDict<KLibrary>;
#include <stdlib.h> //getenv
/*US
#if HAVE_DLFCN_H
# include <dlfcn.h>
@@ -117,13 +120,13 @@ KLibrary::~KLibrary()
if ( m_timer && m_timer->isActive() )
m_timer->stop();
// If any object is remaining, delete
if ( m_objs.count() > 0 )
{
- QPtrListIterator<QObject> it( m_objs );
+ Q3PtrListIterator<QObject> it( m_objs );
for ( ; it.current() ; ++it )
{
kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl;
disconnect( it.current(), SIGNAL( destroyed() ),
this, SLOT( slotObjectDestroyed() ) );
}
@@ -149,13 +152,13 @@ QString KLibrary::fileName() const
KLibFactory* KLibrary::factory()
{
if ( m_factory )
return m_factory;
- QCString symname;
+ Q3CString symname;
symname.sprintf("init_%s", name().latin1() );
void* sym = symbol( symname );
if ( !sym )
{
qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data());
@@ -302,14 +305,14 @@ KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, QLibrary* h)
}
}
class KLibLoaderPrivate
{
public:
- QPtrList<KLibWrapPrivate> loaded_stack;
- QPtrList<KLibWrapPrivate> pending_close;
+ Q3PtrList<KLibWrapPrivate> loaded_stack;
+ Q3PtrList<KLibWrapPrivate> pending_close;
enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
QString errorMessage;
};
KLibLoader* KLibLoader::s_self = 0;
@@ -345,13 +348,13 @@ KLibLoader::KLibLoader( QObject* parent, const char* name )
}
KLibLoader::~KLibLoader()
{
// kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl;
- QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
+ Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs );
for (; it.current(); ++it )
{
kdDebug(150) << "The KLibLoader contains the library " << it.current()->name
<< " (" << it.current()->lib << ")" << endl;
d->pending_close.append(it.current());
}
@@ -361,13 +364,13 @@ KLibLoader::~KLibLoader()
delete d;
}
//static
QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ )
{
- QCString libname( name );
+ Q3CString libname( name );
// only append ".la" if there is no extension
// this allows to load non-libtool libraries as well
// (mhk, 20000228)
int pos = libname.findRev('/');
if (pos < 0)
@@ -418,13 +421,13 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta
#endif
}
if ( libfile.isEmpty() )
{
#ifndef NDEBUG
kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl;
- self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname);
+ self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(QString(libname));
qDebug("KLibLoader::library could not find library: %s", libname.data());
#endif
}
else
@@ -466,13 +469,13 @@ KLibrary* KLibLoader::library( const char *name )
wrap->ref_count++;
return wrap->lib;
}
/* Test if this library was loaded at some time, but got
unloaded meanwhile, whithout being dlclose()'ed. */
- QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack);
+ Q3PtrListIterator<KLibWrapPrivate> it(d->loaded_stack);
for (; it.current(); ++it) {
if (it.current()->name == name)
wrap = it.current();
}
if (wrap) {
@@ -547,13 +550,13 @@ KLibFactory* KLibLoader::factory( const char* name )
}
void KLibLoader::slotLibraryDestroyed()
{
const KLibrary *lib = static_cast<const KLibrary *>( sender() );
- QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
+ Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs );
for (; it.current(); ++it )
if ( it.current()->lib == lib )
{
KLibWrapPrivate *wrap = it.current();
wrap->lib = 0; /* the KLibrary object is already away */
m_libs.remove( it.currentKey() );
@@ -566,13 +569,13 @@ void KLibLoader::close_pending(KLibWrapPrivate *wrap)
{
if (wrap && !d->pending_close.containsRef( wrap ))
d->pending_close.append( wrap );
/* First delete all KLibrary objects in pending_close, but _don't_ unload
the DSO behind it. */
- QPtrListIterator<KLibWrapPrivate> it(d->pending_close);
+ Q3PtrListIterator<KLibWrapPrivate> it(d->pending_close);
for (; it.current(); ++it) {
wrap = it.current();
if (wrap->lib) {
disconnect( wrap->lib, SIGNAL( destroyed() ),
this, SLOT( slotLibraryDestroyed() ) );
delete wrap->lib;
diff --git a/microkde/kdecore/klibloader.h b/microkde/kdecore/klibloader.h
index ed57109..53d146e 100644
--- a/microkde/kdecore/klibloader.h
+++ b/microkde/kdecore/klibloader.h
@@ -18,14 +18,14 @@
#ifndef KLIBLOADER_H
#define KLIBLOADER_H
#include <qobject.h>
#include <qstring.h>
#include <qstringlist.h>
-#include <qasciidict.h>
-#include <qptrlist.h>
+#include <q3asciidict.h>
+#include <q3ptrlist.h>
#include <kglobal.h>
#include <stdlib.h> // For backwards compatibility
class KInstance;
class QTimer;
@@ -49,13 +49,13 @@ class QLibrary;
* @see KLibLoader
* @author Torben Weis <weis@kde.org>
*/
class KLibrary : public QObject
{
friend class KLibLoader;
- friend class QAsciiDict<KLibrary>;
+ friend class Q3AsciiDict<KLibrary>;
Q_OBJECT
public:
/**
* @internal
* Don't create KLibrary objects on your own. Instead use @ref KLibLoader.
@@ -124,13 +124,13 @@ private:
QString m_libname;
QString m_filename;
KLibFactory* m_factory;
//US void * m_handle;
QLibrary* m_handle;
- QPtrList<QObject> m_objs;
+ Q3PtrList<QObject> m_objs;
QTimer *m_timer;
KLibraryPrivate *d;
};
class KLibWrapPrivate;
@@ -284,13 +284,13 @@ protected:
KLibLoader( QObject* parent = 0, const char* name = 0 );
private slots:
void slotLibraryDestroyed();
private:
void close_pending( KLibWrapPrivate * );
- QAsciiDict<KLibWrapPrivate> m_libs;
+ Q3AsciiDict<KLibWrapPrivate> m_libs;
static KLibLoader* s_self;
protected:
virtual void virtual_hook( int id, void* data );
private:
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index 1d8ae9f..dd310fa 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -1,21 +1,22 @@
#include <qregexp.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include "kdebug.h"
#include "kcalendarsystemgregorian.h"
#include "klocale.h"
#include <qstringlist.h>
//#define COLLECT_TRANSLATION
-QDict<QString> *mLocaleDict = 0;
-void setLocaleDict( QDict<QString> * dict )
+Q3Dict<QString> *mLocaleDict = 0;
+void setLocaleDict( Q3Dict<QString> * dict )
{
mLocaleDict = dict;
}
#ifdef COLLECT_TRANSLATION
@@ -42,24 +43,24 @@ void addExist(const char *text,QString trans )
}
}
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
#endif
void dumpMissing()
{
#ifdef COLLECT_TRANSLATION
QString fileName = "/tmp/usernewtrans.txt";
QFile file( fileName );
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
return ;
}
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
ts.setCodec( QTextCodec::codecForName("utf8") );
int i;
for ( i = 0; i< missingTrans.count(); ++i ) {
QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" );
@@ -67,16 +68,16 @@ void dumpMissing()
}
file.close();
{
QString fileName = "/tmp/usertrans.txt";
QFile file( fileName );
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
return ;
}
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
ts.setCodec( QTextCodec::codecForName("utf8") );
int i;
for ( i = 0; i< existingTrans1.count(); ++i ) {
QString text = existingTrans1[i].replace( QRegExp("\n"),"\\n" );
@@ -464,13 +465,13 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime,
QString format("%1 %2");
if ( intIntDateFormat == Default )
format = "%1 %2";
else if ( intIntDateFormat == Format1 )
format = "%1 %2";
- else if ( intIntDateFormat == ISODate )
+ else if ( intIntDateFormat == Qt::ISODate )
format = "%1T%2";
QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat ))
.arg(formatTime( pDateTime.time(), includeSeconds , intIntDateFormat ));
//qDebug("KLocale::formatDateTime transformed %s, into %s", pDateTime.toString().latin1(), res.latin1() );
@@ -524,13 +525,13 @@ QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) con
// remove space at the begining
if (str.length() > strpos && str.at(strpos).isSpace())
strpos++;
c = fmt.at(fmtpos++);
- switch (c)
+ switch (c.unicode())
{
case 'a':
case 'A':
// this will just be ignored
{ // Cristian Tache: porting to Win: Block added because of "j" redefinition
for (int j = 1; j < 8; j++) {
@@ -635,13 +636,13 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const
// remove space at the begining
if (str.length() > strpos && str.at(strpos).isSpace())
strpos++;
c = Format.at(Formatpos++);
- switch (c)
+ switch (c.unicode())
{
case 'p':
{
QString s;
s = i18n("pm").lower();
int len = s.length();
@@ -731,13 +732,13 @@ QDateTime KLocale::readDateTime(const QString &intstr,
QString time = intstr.mid(pos+1);
QString dformat = dateFormat(intIntDateFormat);
QString tformat = timeFormat(intIntDateFormat);
QDate m_date = readDate(date, dformat, &ok1);
- QTime m_time = readTime(time, tformat, &ok2);
+ QTime m_time = readTime(time, !tformat.isEmpty(), &ok2);
QDateTime m_dt;
if (ok)
{
if ((ok1 == false) || (ok2 == false))
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h
index 58e0b39..840fc9d 100644
--- a/microkde/kdecore/klocale.h
+++ b/microkde/kdecore/klocale.h
@@ -1,20 +1,20 @@
#ifndef MINIKDE_KLOCALE_H
#define MINIKDE_KLOCALE_H
#include <qstring.h>
#include <qstringlist.h>
#include <qdatetime.h>
-#include <qdict.h>
+#include <q3dict.h>
#ifndef I18N_NOOP
#define I18N_NOOP(x) (x)
#endif
class KCalendarSystem;
-void setLocaleDict( QDict<QString> * dict );
+void setLocaleDict( Q3Dict<QString> * dict );
QString i18n(const char *text);
QString i18n(const char *hint, const char *text);
QString i18n(const char *text1, const char *textn, int num);
// Qt3's uic generates i18n( "msg", "comment" ) calls which conflict
// with our i18n method. we use uic -tr tr2i18n to redirect
diff --git a/microkde/kdecore/kmdcodec.cpp b/microkde/kdecore/kmdcodec.cpp
index bc03569..db11e52 100644
--- a/microkde/kdecore/kmdcodec.cpp
+++ b/microkde/kdecore/kmdcodec.cpp
@@ -36,12 +36,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <kdebug.h>
#include "kmdcodec.h"
+//Added by qt3to4:
+#include <Q3CString>
#define KMD5_S11 7
#define KMD5_S12 12
#define KMD5_S13 17
#define KMD5_S14 22
#define KMD5_S21 5
@@ -144,20 +146,20 @@ static int rikFindChar(register const char * _s, const char c)
if ((0 == *s) || (c == *s)) break; ++s;
}
return s - _s;
}
-QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF)
+Q3CString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF)
{
QByteArray out;
quotedPrintableEncode (in, out, useCRLF);
- return QCString (out.data(), out.size()+1);
+ return Q3CString (out.data(), out.size()+1);
}
-QCString KCodecs::quotedPrintableEncode(const QCString& str, bool useCRLF)
+Q3CString KCodecs::quotedPrintableEncode(const Q3CString& str, bool useCRLF)
{
if (str.isEmpty())
return "";
QByteArray in (str.length());
memcpy (in.data(), str.data(), str.length());
@@ -277,20 +279,20 @@ void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool
}
}
out.truncate(cursor - out.data());
}
-QCString KCodecs::quotedPrintableDecode(const QByteArray & in)
+Q3CString KCodecs::quotedPrintableDecode(const QByteArray & in)
{
QByteArray out;
quotedPrintableDecode (in, out);
- return QCString (out.data(), out.size()+1);
+ return Q3CString (out.data(), out.size()+1);
}
-QCString KCodecs::quotedPrintableDecode(const QCString & str)
+Q3CString KCodecs::quotedPrintableDecode(const Q3CString & str)
{
if (str.isEmpty())
return "";
QByteArray in (str.length());
memcpy (in.data(), str.data(), str.length());
@@ -352,27 +354,27 @@ void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out)
}
}
out.truncate(cursor - out.data());
}
-QCString KCodecs::base64Encode( const QCString& str, bool insertLFs )
+Q3CString KCodecs::base64Encode( const Q3CString& str, bool insertLFs )
{
if ( str.isEmpty() )
return "";
QByteArray in (str.length());
memcpy( in.data(), str.data(), str.length() );
return base64Encode( in, insertLFs );
}
-QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs )
+Q3CString KCodecs::base64Encode( const QByteArray& in, bool insertLFs )
{
QByteArray out;
base64Encode( in, out, insertLFs );
- return QCString( out.data(), out.size()+1 );
+ return Q3CString( out.data(), out.size()+1 );
}
void KCodecs::base64Encode( const QByteArray& in, QByteArray& out,
bool insertLFs )
{
// clear out the output buffer
@@ -402,66 +404,63 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out,
{
while (sidx < len-2)
{
if ( insertLFs )
{
if ( count && (count%76) == 0 )
- out.at(didx++) = '\n';
+ out[didx++] = '\n';
count += 4;
}
- out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077];
- out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 |
+ out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077];
+ out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 |
(data[sidx] << 4) & 077];
- out.at(didx++) = Base64EncMap[(data[sidx+2] >> 6) & 003 |
+ out[didx++] = Base64EncMap[(data[sidx+2] >> 6) & 003 |
(data[sidx+1] << 2) & 077];
- out.at(didx++) = Base64EncMap[data[sidx+2] & 077];
+ out[didx++] = Base64EncMap[data[sidx+2] & 077];
sidx += 3;
}
}
if (sidx < len)
{
if ( insertLFs && (count > 0) && (count%76) == 0 )
- out.at(didx++) = '\n';
+ out[didx++] = '\n';
- out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077];
+ out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077];
if (sidx < len-1)
{
- out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 |
+ out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 |
(data[sidx] << 4) & 077];
- out.at(didx++) = Base64EncMap[(data[sidx+1] << 2) & 077];
+ out[didx++] = Base64EncMap[(data[sidx+1] << 2) & 077];
}
else
{
- out.at(didx++) = Base64EncMap[(data[sidx] << 4) & 077];
+ out[didx++] = Base64EncMap[(data[sidx] << 4) & 077];
}
}
// Add padding
while (didx < out.size())
- {
- out.at(didx) = '=';
- didx++;
- }
+ out[didx++] = '=';
}
-QCString KCodecs::base64Decode( const QCString& str )
+Q3CString KCodecs::base64Decode( const Q3CString& str )
{
if ( str.isEmpty() )
return "";
QByteArray in( str.length() );
memcpy( in.data(), str.data(), str.length() );
return base64Decode( in );
}
-QCString KCodecs::base64Decode( const QByteArray& in )
+Q3CString KCodecs::base64Decode( const QByteArray& in )
{
QByteArray out;
base64Decode( in, out );
- return QCString( out.data(), out.size()+1 );
+ return Q3CString( out.data(), out.size()+1 );
}
void KCodecs::base64Decode( const QByteArray& in, QByteArray& out )
{
out.resize(0);
if ( in.isEmpty() )
@@ -502,13 +501,13 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out )
// Adhere to RFC 2045 and ignore characters
// that are not part of the encoding table.
unsigned char ch = data[idx];
if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) ||
(ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=')
{
- out.at(outIdx++) = Base64DecMap[ch];
+ out[outIdx++] = Base64DecMap[ch];
}
else
{
len--;
tail--;
}
@@ -520,47 +519,47 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out )
len = (tail>(len/4)) ? tail-(len/4) : 0;
unsigned int sidx = 0, didx = 0;
if ( len > 1 )
{
while (didx < len-2)
{
- out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003));
- out.at(didx+1) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017));
- out.at(didx+2) = (((out.at(sidx+2) << 6) & 255) | (out.at(sidx+3) & 077));
+ out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
+ out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
+ out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077));
sidx += 4;
didx += 3;
}
}
if (didx < len)
- out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003));
+ out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
if (++didx < len )
- out.at(didx) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017));
+ out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
// Resize the output buffer
if ( len == 0 || len < out.size() )
out.resize(len);
}
-QCString KCodecs::uuencode( const QCString& str )
+Q3CString KCodecs::uuencode( const Q3CString& str )
{
if ( str.isEmpty() )
return "";
QByteArray in;
in.resize( str.length() );
memcpy( in.data(), str.data(), str.length() );
return uuencode( in );
}
-QCString KCodecs::uuencode( const QByteArray& in )
+Q3CString KCodecs::uuencode( const QByteArray& in )
{
QByteArray out;
uuencode( in, out );
- return QCString( out.data(), out.size()+1 );
+ return Q3CString( out.data(), out.size()+1 );
}
void KCodecs::uuencode( const QByteArray& in, QByteArray& out )
{
out.resize( 0 );
if( in.isEmpty() )
@@ -577,87 +576,87 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out )
out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) );
// split into lines, adding line-length and line terminator
while (sidx+line_len < len)
{
// line length
- out.at(didx++) = UUEncMap[line_len];
+ out[didx++] = UUEncMap[line_len];
// 3-byte to 4-byte conversion + 0-63 to ascii printable conversion
for (unsigned int end = sidx+line_len; sidx < end; sidx += 3)
{
- out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077];
- out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 |
+ out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+ out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
(data[sidx] << 4) & 077];
- out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 |
+ out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 |
(data[sidx+1] << 2) & 077];
- out.at(didx++) = UUEncMap[data[sidx+2] & 077];
+ out[didx++] = UUEncMap[data[sidx+2] & 077];
}
// line terminator
//for (unsigned int idx=0; idx < nl_len; idx++)
- //out.at(didx++) = nl[idx];
+ //out[didx++] = nl[idx];
memcpy(out.data()+didx, nl, nl_len);
didx += nl_len;
}
// line length
- out.at(didx++) = UUEncMap[len-sidx];
+ out[didx++] = UUEncMap[len-sidx];
// 3-byte to 4-byte conversion + 0-63 to ascii printable conversion
while (sidx+2 < len)
{
- out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077];
- out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 |
+ out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+ out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
(data[sidx] << 4) & 077];
- out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 |
+ out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 |
(data[sidx+1] << 2) & 077];
- out.at(didx++) = UUEncMap[data[sidx+2] & 077];
+ out[didx++] = UUEncMap[data[sidx+2] & 077];
sidx += 3;
}
if (sidx < len-1)
{
- out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077];
- out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 |
+ out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+ out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
(data[sidx] << 4) & 077];
- out.at(didx++) = UUEncMap[(data[sidx+1] << 2) & 077];
- out.at(didx++) = UUEncMap[0];
+ out[didx++] = UUEncMap[(data[sidx+1] << 2) & 077];
+ out[didx++] = UUEncMap[0];
}
else if (sidx < len)
{
- out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077];
- out.at(didx++) = UUEncMap[(data[sidx] << 4) & 077];
- out.at(didx++) = UUEncMap[0];
- out.at(didx++) = UUEncMap[0];
+ out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+ out[didx++] = UUEncMap[(data[sidx] << 4) & 077];
+ out[didx++] = UUEncMap[0];
+ out[didx++] = UUEncMap[0];
}
// line terminator
memcpy(out.data()+didx, nl, nl_len);
didx += nl_len;
// sanity check
if ( didx != out.size() )
out.resize( 0 );
}
-QCString KCodecs::uudecode( const QCString& str )
+Q3CString KCodecs::uudecode( const Q3CString& str )
{
if ( str.isEmpty() )
return "";
QByteArray in;
in.resize( str.length() );
memcpy( in.data(), str.data(), str.length() );
return uudecode( in );
}
-QCString KCodecs::uudecode( const QByteArray& in )
+Q3CString KCodecs::uudecode( const QByteArray& in )
{
QByteArray out;
uudecode( in, out );
- return QCString( out.data(), out.size()+1 );
+ return Q3CString( out.data(), out.size()+1 );
}
void KCodecs::uudecode( const QByteArray& in, QByteArray& out )
{
out.resize( 0 );
if( in.isEmpty() )
@@ -702,31 +701,31 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out )
while (didx < end-2)
{
A = UUDecMap[(unsigned char) data[sidx]];
B = UUDecMap[(unsigned char) data[sidx+1]];
C = UUDecMap[(unsigned char) data[sidx+2]];
D = UUDecMap[(unsigned char) data[sidx+3]];
- out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) );
- out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) );
- out.at(didx++) = ( ((C << 6) & 255) | (D & 077) );
+ out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
+ out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
+ out[didx++] = ( ((C << 6) & 255) | (D & 077) );
sidx += 4;
}
}
if (didx < end)
{
A = UUDecMap[(unsigned char) data[sidx]];
B = UUDecMap[(unsigned char) data[sidx+1]];
- out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) );
+ out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
}
if (didx < end)
{
B = UUDecMap[(unsigned char) data[sidx+1]];
C = UUDecMap[(unsigned char) data[sidx+2]];
- out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) );
+ out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
}
// skip padding
while (sidx < len && data[sidx] != '\n' && data[sidx] != '\r')
sidx++;
@@ -758,24 +757,24 @@ KMD5::KMD5(const char *in, int len)
KMD5::KMD5(const QByteArray& in)
{
init();
update( in );
}
-KMD5::KMD5(const QCString& in)
+KMD5::KMD5(const Q3CString& in)
{
init();
update( in );
}
void KMD5::update(const QByteArray& in)
{
update(in.data(), int(in.size()));
}
-void KMD5::update(const QCString& in)
+void KMD5::update(const Q3CString& in)
{
update(in.data(), int(in.length()));
}
void KMD5::update(const unsigned char* in, int len)
{
@@ -870,13 +869,13 @@ void KMD5::finalize ()
bool KMD5::verify( const KMD5::Digest& digest)
{
finalize();
return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest)));
}
-bool KMD5::verify( const QCString& hexdigest)
+bool KMD5::verify( const Q3CString& hexdigest)
{
finalize();
return (0 == strcmp(hexDigest().data(), hexdigest));
}
const KMD5::Digest& KMD5::rawDigest()
@@ -889,36 +888,36 @@ void KMD5::rawDigest( KMD5::Digest& bin )
{
finalize();
memcpy( bin, m_digest, 16 );
}
-QCString KMD5::hexDigest()
+Q3CString KMD5::hexDigest()
{
- QCString s(33);
+ Q3CString s(33);
finalize();
sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
return s;
}
-void KMD5::hexDigest(QCString& s)
+void KMD5::hexDigest(Q3CString& s)
{
finalize();
s.resize(33);
sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
}
-QCString KMD5::base64Digest()
+Q3CString KMD5::base64Digest()
{
QByteArray ba(16);
finalize();
memcpy(ba.data(), m_digest, 16);
return KCodecs::base64Encode(ba);
@@ -953,13 +952,13 @@ void KMD5::transform( const unsigned char block[64] )
Q_UINT32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16];
decode (x, block, 64);
//memcpy( x, block, 64 );
//US Q_ASSERT(!m_finalized); // not just a user error, since the method is private
- ASSERT(!m_finalized); // not just a user error, since the method is private
+ Q_ASSERT(!m_finalized); // not just a user error, since the method is private
/* Round 1 */
FF (a, b, c, d, x[ 0], KMD5_S11, 0xd76aa478); /* 1 */
FF (d, a, b, c, x[ 1], KMD5_S12, 0xe8c7b756); /* 2 */
FF (c, d, a, b, x[ 2], KMD5_S13, 0x242070db); /* 3 */
FF (b, c, d, a, x[ 3], KMD5_S14, 0xc1bdceee); /* 4 */
diff --git a/microkde/kdecore/kmdcodec.h b/microkde/kdecore/kmdcodec.h
index 2c4d611..616b683 100644
--- a/microkde/kdecore/kmdcodec.h
+++ b/microkde/kdecore/kmdcodec.h
@@ -36,12 +36,14 @@
#define KBase64 KCodecs
#include <qglobal.h>
#include <qstring.h>
#include <qiodevice.h>
+//Added by qt3to4:
+#include <Q3CString>
/**
* A wrapper class for the most commonly used encoding and
* decoding algorithms. Currently there is support for encoding
* and decoding input using base64, uu and the quoted-printable
* specifications.
@@ -78,13 +80,13 @@ public:
* @param in data to be encoded.
* @param useCRLF if true the input data is expected to have
* CRLF line breaks and the output will have CRLF line
* breaks, too.
* @return quoted-printable encoded data.
*/
- static QCString quotedPrintableEncode(const QByteArray & in,
+ static Q3CString quotedPrintableEncode(const QByteArray & in,
bool useCRLF = true);
/**
* @overload
*
* Same as above except it accepts a null terminated
@@ -93,13 +95,13 @@ public:
* @param str data to be encoded.
* @param useCRLF if true the input data is expected to have
* CRLF line breaks and the output will have CRLF line
* breaks, too.
* @return quoted-printable encoded data.
*/
- static QCString quotedPrintableEncode(const QCString & str,
+ static Q3CString quotedPrintableEncode(const Q3CString & str,
bool useCRLF = true);
/**
* Encodes the given data using the quoted-printable algorithm.
*
* Use this function if you want the result of the encoding
@@ -126,24 +128,24 @@ public:
*
* Accepts data with CRLF or standard unix line breaks.
*
* @param in the data to be decoded.
* @return decoded data.
*/
- static QCString quotedPrintableDecode(const QByteArray & in);
+ static Q3CString quotedPrintableDecode(const QByteArray & in);
/**
* @overload
*
* Same as above except it accepts a null terminated
* string instead an array.
*
* @param str the data to be decoded.
* @return decoded data.
*/
- static QCString quotedPrintableDecode(const QCString & str);
+ static Q3CString quotedPrintableDecode(const Q3CString & str);
/**
* Decodes a quoted-printable encoded data.
*
* Accepts data with CRLF or standard unix line breaks.
* Use this function if you want the result of the decoding
@@ -172,24 +174,24 @@ public:
* line is longer than 45 octets (60 characters), excluding the
* line terminator.
*
* @param in the data to be uuencoded
* @return a uuencoded data.
*/
- static QCString uuencode( const QByteArray& in );
+ static Q3CString uuencode( const QByteArray& in );
/**
* @overload
*
* Same as the above functions except it accepts
* a null terminated string instead an array.
*
* @param str the string to be uuencoded.
* @return the encoded string.
*/
- static QCString uuencode( const QCString& str );
+ static Q3CString uuencode( const Q3CString& str );
/**
* Encodes the given data using the uuencode algorithm.
*
* Use this function if you want the result of the encoding
* to be placed in another array and cut down the number of
@@ -212,24 +214,24 @@ public:
* the utilities in unix and unix-like OS will be
* automatically ignored.
*
* @param in the data uuencoded data to be decoded.
* @return a decoded string.
*/
- static QCString uudecode( const QByteArray& in );
+ static Q3CString uudecode( const QByteArray& in );
/**
* @overload
*
* Same as the above functions except it accepts
* a null terminated string instead an array.
*
* @param str the string to be decoded.
* @return a uudecoded string.
*/
- static QCString uudecode( const QCString& str );
+ static Q3CString uudecode( const Q3CString& str );
/**
* Decodes the given data using the uudecode algorithm.
*
* Use this function if you want the result of the decoding
* to be placed in another array which cuts down the number
@@ -260,25 +262,25 @@ public:
*
* @param in the data to be encoded.
* @param insertLFs limit the number of characters per line.
*
* @return a base64 encoded string.
*/
- static QCString base64Encode( const QByteArray& in, bool insertLFs = false);
+ static Q3CString base64Encode( const QByteArray& in, bool insertLFs = false);
/**
* @overload
*
* Same as the above functions except it accepts
* a null terminated string instead an array.
*
* @param str the string to be encoded.
* @param insertLFs limit the number of characters per line.
* @return the decoded string.
*/
- static QCString base64Encode( const QCString& str, bool insertLFs = false );
+ static Q3CString base64Encode( const Q3CString& str, bool insertLFs = false );
/**
* Encodes the given data using the base64 algorithm.
*
* Use this function if you want the result of the encoding
* to be placed in another array which cuts down the number
@@ -305,24 +307,24 @@ public:
* Decodes the given data that was encoded using the
* base64 algorithm.
*
* @param in the base64-encoded data to be decoded.
* @return the decoded data.
*/
- static QCString base64Decode( const QByteArray& in );
+ static Q3CString base64Decode( const QByteArray& in );
/**
* @overload
*
* Same as the above functions except it accepts
* a null terminated string instead an array.
*
* @param str the base64-encoded string.
* @return the decoded string.
*/
- static QCString base64Decode( const QCString& str );
+ static Q3CString base64Decode( const Q3CString& str );
/**
* Decodes the given data that was encoded with the base64
* algorithm.
*
* Use this function if you want the result of the decoding
@@ -428,13 +430,13 @@ public:
/**
* @overload
*
* Same as above except it accepts a QByteArray as its argument.
*/
- KMD5(const QCString& a );
+ KMD5(const Q3CString& a );
/**
* Updates the message to be digested. Be sure to add all data
* before you read the digest. After reading the digest, you
* can <b>not</b> add more data!
*
@@ -457,13 +459,13 @@ public:
/**
* @overload
*
* @param in message to be added to the digest (QByteArray).
*/
- void update(const QCString& in );
+ void update(const Q3CString& in );
/**
* @overload
*
* reads the data from an I/O device, i.e. from a file (QFile).
*
@@ -499,35 +501,35 @@ public:
void rawDigest( KMD5::Digest& bin );
/**
* Returns the value of the calculated message digest in
* a hexadecimal representation.
*/
- QCString hexDigest ();
+ Q3CString hexDigest ();
/**
* @overload
*/
- void hexDigest(QCString&);
+ void hexDigest(Q3CString&);
/**
* Returns the value of the calculated message digest in
* a base64-encoded representation.
*/
- QCString base64Digest ();
+ Q3CString base64Digest ();
/**
* returns true if the calculated digest for the given
* message matches the given one.
*/
bool verify( const KMD5::Digest& digest);
/**
* @overload
*/
- bool verify(const QCString&);
+ bool verify(const Q3CString&);
protected:
/**
* Performs the real update work. Note
* that length is implied to be 64.
*/
diff --git a/microkde/kdecore/kprefs.cpp b/microkde/kdecore/kprefs.cpp
index 0220a34..d4010fa 100644
--- a/microkde/kdecore/kprefs.cpp
+++ b/microkde/kdecore/kprefs.cpp
@@ -18,12 +18,14 @@
Boston, MA 02111-1307, USA.
*/
// $Id$
#include <qcolor.h>
+//Added by qt3to4:
+#include <Q3ValueList>
#include <kconfig.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kdebug.h>
@@ -137,23 +139,23 @@ class KPrefsItemStringList : public KPrefsItem {
QStringList mDefault;
};
class KPrefsItemIntList : public KPrefsItem {
public:
- KPrefsItemIntList(const QString &group,const QString &name,QValueList<int> *,
- const QValueList<int> &defaultValue=QValueList<int>());
+ KPrefsItemIntList(const QString &group,const QString &name,Q3ValueList<int> *,
+ const Q3ValueList<int> &defaultValue=Q3ValueList<int>());
virtual ~KPrefsItemIntList() {}
void setDefault();
void readConfig(KConfig *);
void writeConfig(KConfig *);
private:
- QValueList<int> *mReference;
- QValueList<int> mDefault;
+ Q3ValueList<int> *mReference;
+ Q3ValueList<int> mDefault;
};
KPrefsItemBool::KPrefsItemBool(const QString &group,const QString &name,
bool *reference,bool defaultValue) :
KPrefsItem(group,name)
@@ -361,13 +363,13 @@ void KPrefsItemStringList::readConfig(KConfig *config)
config->setGroup(mGroup);
*mReference = config->readListEntry(mName);
}
KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name,
- QValueList<int> *reference,const QValueList<int> &defaultValue) :
+ Q3ValueList<int> *reference,const Q3ValueList<int> &defaultValue) :
KPrefsItem(group,name)
{
mReference = reference;
mDefault = defaultValue;
}
@@ -502,11 +504,11 @@ void KPrefs::addItemPassword(const QString &key,QString *reference,const QString
void KPrefs::addItemStringList(const QString &key,QStringList *reference,
const QStringList &defaultValue)
{
addItem(new KPrefsItemStringList(*mCurrentGroup,key,reference,defaultValue));
}
-void KPrefs::addItemIntList(const QString &key,QValueList<int> *reference,
- const QValueList<int> &defaultValue)
+void KPrefs::addItemIntList(const QString &key,Q3ValueList<int> *reference,
+ const Q3ValueList<int> &defaultValue)
{
addItem(new KPrefsItemIntList(*mCurrentGroup,key,reference,defaultValue));
}
diff --git a/microkde/kdecore/kprefs.h b/microkde/kdecore/kprefs.h
index 95d2724..d9d1572 100644
--- a/microkde/kdecore/kprefs.h
+++ b/microkde/kdecore/kprefs.h
@@ -18,17 +18,19 @@
Boston, MA 02111-1307, USA.
*/
#ifndef _KPREFS_H
#define _KPREFS_H
// $Id$
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qcolor.h>
#include <qfont.h>
#include <qsize.h>
#include <qstringlist.h>
+//Added by qt3to4:
+#include <Q3ValueList>
class KConfig;
/**
@short Class for storing a preferences setting
@author Cornelius Schumacher
@@ -280,14 +282,14 @@ class KPrefs {
@param reference Pointer to the variable, which is set by readConfig()
and setDefaults() calls and read by writeConfig() calls.
@param defaultValue Default value, which is used by setDefaults() and
when the config file does not yet contain the key of
this item.
*/
- void addItemIntList(const QString &key,QValueList<int> *reference,
- const QValueList<int> &defaultValue=QValueList<int>());
+ void addItemIntList(const QString &key,Q3ValueList<int> *reference,
+ const Q3ValueList<int> &defaultValue=Q3ValueList<int>());
protected:
/**
Implemented by subclasses that use special defaults.
*/
virtual void usrSetDefaults() {};
@@ -307,10 +309,10 @@ class KPrefs {
private:
static QString *mCurrentGroup;
KConfig *mConfig; // pointer to KConfig object
- QPtrList<KPrefsItem> mItems;
+ Q3PtrList<KPrefsItem> mItems;
};
#endif
diff --git a/microkde/kdecore/kshortcut.h b/microkde/kdecore/kshortcut.h
index 4813734..244d590 100644
--- a/microkde/kdecore/kshortcut.h
+++ b/microkde/kdecore/kshortcut.h
@@ -560,13 +560,13 @@ class KShortcut
/**
* Creates a new shortcut with the given Qt key code
* as the only key sequence.
* @param keyQt the qt keycode
* @see Qt::Key
*/
- KShortcut( int keyQt ) {}
+ KShortcut( int /*keyQt */) {}
/**
* Creates a new shortcut that contains only the given qt key
* sequence.
* @param keySeq the qt key sequence to add
*/
@@ -596,22 +596,22 @@ class KShortcut
* Creates a new key sequence that contains the given key sequence.
* The description consists of semicolon-separated keys as
* used in @ref KKeySequence::KKeySequence(const QString&).
* @param shortcut the description of the key
* @see KKeySequence::KKeySequence(const QString&)
*/
- KShortcut( const char* shortcut ) {}
+ KShortcut( const char* /*shortcut */) {}
/**
* Creates a new key sequence that contains the given key sequence.
* The description consists of semicolon-separated keys as
* used in @ref KKeySequence::KKeySequence(const QString&).
* @param shortcut the description of the key
* @see KKeySequence::KKeySequence(const QString&)
*/
- KShortcut( const QString& shortcut ) {}
+ KShortcut( const QString& /*shortcut */) {}
~KShortcut() {}
/**
* Clears the shortcut. The shortcut is null after calling this
* function.
* @see isNull()
@@ -813,13 +813,13 @@ class KShortcut
*/
//US QString toString() const;
/**
* @internal
*/
- QString toStringInternal( const KShortcut* pcutDefault = 0 ) const
+ QString toStringInternal( const KShortcut* /*pcutDefault*/ = 0 ) const
{
return "EMPTY IMPL.";
}
/**
* Returns a null shortcut.
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp
index d5bfefd..f10934b 100644
--- a/microkde/kdecore/kstandarddirs.cpp
+++ b/microkde/kdecore/kstandarddirs.cpp
@@ -34,21 +34,23 @@
//US #endif
//US#include <sys/types.h>
//US#include <dirent.h>
//US#include <pwd.h>
#include <qregexp.h>
-#include <qasciidict.h>
-#include <qdict.h>
+#include <q3asciidict.h>
+#include <q3dict.h>
#include <qdir.h>
#include <qfileinfo.h>
#include <qstring.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include <qstringlist.h>
+//Added by qt3to4:
+#include <Q3CString>
#include "kstandarddirs.h"
#include "kconfig.h"
#include "kdebug.h"
//US #include "kinstance.h"
#include "kshell.h"
@@ -56,21 +58,21 @@
//US#include <unistd.h>
//US
QString KStandardDirs::mAppDir = QString::null;
-template class QDict<QStringList>;
+template class Q3Dict<QStringList>;
#if 0
-#include <qtextedit.h>
+#include <q3textedit.h>
void ddd( QString op )
{
- static QTextEdit * dot = 0;
+ static Q3TextEdit * dot = 0;
if ( ! dot )
- dot = new QTextEdit();
+ dot = new Q3TextEdit();
dot->show();
dot->append( op );
}
@@ -82,13 +84,13 @@ public:
: restrictionsActive(false),
dataRestrictionActive(false)
{ }
bool restrictionsActive;
bool dataRestrictionActive;
- QAsciiDict<bool> restrictions;
+ Q3AsciiDict<bool> restrictions;
QStringList xdgdata_prefixes;
QStringList xdgconf_prefixes;
};
static const char* const types[] = {"html", "icon", "apps", "sound",
"data", "locale", "services", "mime",
@@ -442,13 +444,13 @@ static void lookupDirectory(const QString& path, const QString &relPart,
/*US
if (!recursive && !regexp.exactMatch(fn))
continue; // No match
*/
//US this should do the same:
- int pos = regexp.match(fn);
+ int pos = regexp.exactMatch(fn);
if (!recursive && !pos == 0)
continue; // No match
QString pathfn = path + fn;
/*US
if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) {
@@ -479,13 +481,13 @@ static void lookupDirectory(const QString& path, const QString &relPart,
/*US
if (!regexp.exactMatch(fn))
continue; // No match
*/
//US this should do the same:
- pos = regexp.match(fn);
+ pos = regexp.exactMatch(fn);
if (!pos == 0)
continue; // No match
}
//US if ( S_ISREG( buff.st_mode))
if ( pathfnInfo.isFile())
@@ -1105,13 +1107,13 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
while( i < len )
{
//US struct stat st;
int pos = target.find('/', i);
base += target.mid(i - 1, pos - i + 1);
- QCString baseEncoded = QFile::encodeName(base);
+ Q3CString baseEncoded = QFile::encodeName(base);
// bail out if we encountered a problem
//US if (stat(baseEncoded, &st) != 0)
QFileInfo baseEncodedInfo(baseEncoded);
if (!baseEncodedInfo.exists())
{
// Directory does not exist....
@@ -1205,13 +1207,13 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
QString readEnvPath(const char *env)
{
//#ifdef _WIN32_
// return "";
//#else
- QCString c_path;
+ Q3CString c_path;
if ( getenv(env) != NULL )
c_path = QString ( getenv(env) );
if (c_path.isEmpty())
return QString::null;
return QFile::decodeName(c_path);
//#endif
diff --git a/microkde/kdecore/kstandarddirs.h b/microkde/kdecore/kstandarddirs.h
index 901384e..f0e28fc 100644
--- a/microkde/kdecore/kstandarddirs.h
+++ b/microkde/kdecore/kstandarddirs.h
@@ -21,13 +21,13 @@
*/
#ifndef SSK_KSTDDIRS_H
#define SSK_KSTDDIRS_H
#include <qstring.h>
-#include <qdict.h>
+#include <q3dict.h>
#include <qstringlist.h>
#include <kglobal.h>
class KConfig;
class KStandardDirsPrivate;
@@ -571,17 +571,17 @@ public:
private:
QStringList prefixes;
// Directory dictionaries
- QDict<QStringList> absolutes;
- QDict<QStringList> relatives;
+ Q3Dict<QStringList> absolutes;
+ Q3Dict<QStringList> relatives;
- mutable QDict<QStringList> dircache;
- mutable QDict<QString> savelocations;
+ mutable Q3Dict<QStringList> dircache;
+ mutable Q3Dict<QString> savelocations;
// Disallow assignment and copy-construction
KStandardDirs( const KStandardDirs& );
KStandardDirs& operator= ( const KStandardDirs& );
bool addedCustoms;