author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdecore | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/kdecore/kcatalogue.cpp | 4 | ||||
-rw-r--r-- | microkde/kdecore/kconfigbase.h | 4 | ||||
-rw-r--r-- | microkde/kdecore/klibloader.cpp | 29 | ||||
-rw-r--r-- | microkde/kdecore/klibloader.h | 10 | ||||
-rw-r--r-- | microkde/kdecore/klocale.cpp | 23 | ||||
-rw-r--r-- | microkde/kdecore/klocale.h | 4 | ||||
-rw-r--r-- | microkde/kdecore/kmdcodec.cpp | 139 | ||||
-rw-r--r-- | microkde/kdecore/kmdcodec.h | 38 | ||||
-rw-r--r-- | microkde/kdecore/kprefs.cpp | 16 | ||||
-rw-r--r-- | microkde/kdecore/kprefs.h | 10 | ||||
-rw-r--r-- | microkde/kdecore/kshortcut.h | 8 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 24 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.h | 10 |
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 @@ | |||
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | //US #include <config.h> | 20 | //US #include <config.h> |
21 | 21 | ||
22 | #include <qfile.h> | 22 | #include <qfile.h> |
23 | //Added by qt3to4: | ||
24 | #include <Q3CString> | ||
23 | 25 | ||
24 | #include <kdebug.h> | 26 | #include <kdebug.h> |
25 | 27 | ||
26 | #include "kcatalogue.h" | 28 | #include "kcatalogue.h" |
27 | 29 | ||
28 | char *k_nl_find_msg(struct kde_loaded_l10nfile *domain_file, | 30 | char *k_nl_find_msg(struct kde_loaded_l10nfile *domain_file, |
@@ -85,13 +87,13 @@ void KCatalogue::setFileName( const QString & fileName ) | |||
85 | { | 87 | { |
86 | // nothing to do if the file name is already the same | 88 | // nothing to do if the file name is already the same |
87 | if ( this->fileName() == fileName ) return; | 89 | if ( this->fileName() == fileName ) return; |
88 | 90 | ||
89 | doUnload(); | 91 | doUnload(); |
90 | 92 | ||
91 | QCString newFileName = QFile::encodeName( fileName ); | 93 | Q3CString newFileName = QFile::encodeName( fileName ); |
92 | 94 | ||
93 | if ( !fileName.isEmpty() ) | 95 | if ( !fileName.isEmpty() ) |
94 | { | 96 | { |
95 | // set file name | 97 | // set file name |
96 | char *filename = new char[ newFileName.length() + 1 ]; | 98 | char *filename = new char[ newFileName.length() + 1 ]; |
97 | ::qstrcpy( filename, newFileName ); | 99 | ::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 @@ | |||
23 | // $Id$ | 23 | // $Id$ |
24 | 24 | ||
25 | #ifndef _KCONFIGBASE_H | 25 | #ifndef _KCONFIGBASE_H |
26 | #define _KCONFIGBASE_H | 26 | #define _KCONFIGBASE_H |
27 | 27 | ||
28 | #include "kconfig.h" | 28 | #include "kconfig.h" |
29 | //Added by qt3to4: | ||
30 | #include <Q3CString> | ||
29 | 31 | ||
30 | /** | 32 | /** |
31 | * Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig | 33 | * Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig |
32 | * groups. | 34 | * groups. |
33 | * | 35 | * |
34 | * Careful programmers always set the group of a | 36 | * Careful programmers always set the group of a |
@@ -79,13 +81,13 @@ public: | |||
79 | { _config->setGroup( group ); } | 81 | { _config->setGroup( group ); } |
80 | 82 | ||
81 | KConfigGroupSaver( KConfig* config, const char *group ) | 83 | KConfigGroupSaver( KConfig* config, const char *group ) |
82 | : _config(config), _oldgroup(config->group()) | 84 | : _config(config), _oldgroup(config->group()) |
83 | { _config->setGroup( group ); } | 85 | { _config->setGroup( group ); } |
84 | 86 | ||
85 | KConfigGroupSaver( KConfig* config, const QCString &group ) | 87 | KConfigGroupSaver( KConfig* config, const Q3CString &group ) |
86 | : _config(config), _oldgroup(config->group()) | 88 | : _config(config), _oldgroup(config->group()) |
87 | { _config->setGroup( group ); } | 89 | { _config->setGroup( group ); } |
88 | 90 | ||
89 | ~KConfigGroupSaver() { _config->setGroup( _oldgroup ); } | 91 | ~KConfigGroupSaver() { _config->setGroup( _oldgroup ); } |
90 | 92 | ||
91 | KConfig* config() { return _config; }; | 93 | 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 @@ | |||
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | //US #include <config.h> | 19 | //US #include <config.h> |
20 | #include <qclipboard.h> | 20 | #include <qclipboard.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qtimer.h> | 22 | #include <qtimer.h> |
23 | #include <qobjectdict.h> | 23 | #include <q3objectdict.h> |
24 | #include <qwidgetlist.h> | ||
25 | #include <qwidget.h> | 24 | #include <qwidget.h> |
25 | #include <qwidget.h> | ||
26 | //Added by qt3to4: | ||
27 | #include <Q3CString> | ||
28 | #include <Q3PtrList> | ||
26 | 29 | ||
27 | #include "kapplication.h" | 30 | #include "kapplication.h" |
28 | #include "klibloader.h" | 31 | #include "klibloader.h" |
29 | #include "kstandarddirs.h" | 32 | #include "kstandarddirs.h" |
30 | #include "kdebug.h" | 33 | #include "kdebug.h" |
31 | #include "klocale.h" | 34 | #include "klocale.h" |
@@ -42,13 +45,13 @@ | |||
42 | #include <qtopia/qlibrary.h> | 45 | #include <qtopia/qlibrary.h> |
43 | #else | 46 | #else |
44 | #include <qlibrary.h> | 47 | #include <qlibrary.h> |
45 | #endif | 48 | #endif |
46 | 49 | ||
47 | 50 | ||
48 | template class QAsciiDict<KLibrary>; | 51 | template class Q3AsciiDict<KLibrary>; |
49 | 52 | ||
50 | #include <stdlib.h> //getenv | 53 | #include <stdlib.h> //getenv |
51 | 54 | ||
52 | /*US | 55 | /*US |
53 | #if HAVE_DLFCN_H | 56 | #if HAVE_DLFCN_H |
54 | # include <dlfcn.h> | 57 | # include <dlfcn.h> |
@@ -117,13 +120,13 @@ KLibrary::~KLibrary() | |||
117 | if ( m_timer && m_timer->isActive() ) | 120 | if ( m_timer && m_timer->isActive() ) |
118 | m_timer->stop(); | 121 | m_timer->stop(); |
119 | 122 | ||
120 | // If any object is remaining, delete | 123 | // If any object is remaining, delete |
121 | if ( m_objs.count() > 0 ) | 124 | if ( m_objs.count() > 0 ) |
122 | { | 125 | { |
123 | QPtrListIterator<QObject> it( m_objs ); | 126 | Q3PtrListIterator<QObject> it( m_objs ); |
124 | for ( ; it.current() ; ++it ) | 127 | for ( ; it.current() ; ++it ) |
125 | { | 128 | { |
126 | kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl; | 129 | kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl; |
127 | disconnect( it.current(), SIGNAL( destroyed() ), | 130 | disconnect( it.current(), SIGNAL( destroyed() ), |
128 | this, SLOT( slotObjectDestroyed() ) ); | 131 | this, SLOT( slotObjectDestroyed() ) ); |
129 | } | 132 | } |
@@ -149,13 +152,13 @@ QString KLibrary::fileName() const | |||
149 | 152 | ||
150 | KLibFactory* KLibrary::factory() | 153 | KLibFactory* KLibrary::factory() |
151 | { | 154 | { |
152 | if ( m_factory ) | 155 | if ( m_factory ) |
153 | return m_factory; | 156 | return m_factory; |
154 | 157 | ||
155 | QCString symname; | 158 | Q3CString symname; |
156 | symname.sprintf("init_%s", name().latin1() ); | 159 | symname.sprintf("init_%s", name().latin1() ); |
157 | 160 | ||
158 | void* sym = symbol( symname ); | 161 | void* sym = symbol( symname ); |
159 | if ( !sym ) | 162 | if ( !sym ) |
160 | { | 163 | { |
161 | qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data()); | 164 | 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) | |||
302 | } | 305 | } |
303 | } | 306 | } |
304 | 307 | ||
305 | class KLibLoaderPrivate | 308 | class KLibLoaderPrivate |
306 | { | 309 | { |
307 | public: | 310 | public: |
308 | QPtrList<KLibWrapPrivate> loaded_stack; | 311 | Q3PtrList<KLibWrapPrivate> loaded_stack; |
309 | QPtrList<KLibWrapPrivate> pending_close; | 312 | Q3PtrList<KLibWrapPrivate> pending_close; |
310 | enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; | 313 | enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; |
311 | 314 | ||
312 | QString errorMessage; | 315 | QString errorMessage; |
313 | }; | 316 | }; |
314 | 317 | ||
315 | KLibLoader* KLibLoader::s_self = 0; | 318 | KLibLoader* KLibLoader::s_self = 0; |
@@ -345,13 +348,13 @@ KLibLoader::KLibLoader( QObject* parent, const char* name ) | |||
345 | } | 348 | } |
346 | 349 | ||
347 | KLibLoader::~KLibLoader() | 350 | KLibLoader::~KLibLoader() |
348 | { | 351 | { |
349 | // kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; | 352 | // kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; |
350 | 353 | ||
351 | QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); | 354 | Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs ); |
352 | for (; it.current(); ++it ) | 355 | for (; it.current(); ++it ) |
353 | { | 356 | { |
354 | kdDebug(150) << "The KLibLoader contains the library " << it.current()->name | 357 | kdDebug(150) << "The KLibLoader contains the library " << it.current()->name |
355 | << " (" << it.current()->lib << ")" << endl; | 358 | << " (" << it.current()->lib << ")" << endl; |
356 | d->pending_close.append(it.current()); | 359 | d->pending_close.append(it.current()); |
357 | } | 360 | } |
@@ -361,13 +364,13 @@ KLibLoader::~KLibLoader() | |||
361 | delete d; | 364 | delete d; |
362 | } | 365 | } |
363 | 366 | ||
364 | //static | 367 | //static |
365 | QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) | 368 | QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) |
366 | { | 369 | { |
367 | QCString libname( name ); | 370 | Q3CString libname( name ); |
368 | 371 | ||
369 | // only append ".la" if there is no extension | 372 | // only append ".la" if there is no extension |
370 | // this allows to load non-libtool libraries as well | 373 | // this allows to load non-libtool libraries as well |
371 | // (mhk, 20000228) | 374 | // (mhk, 20000228) |
372 | int pos = libname.findRev('/'); | 375 | int pos = libname.findRev('/'); |
373 | if (pos < 0) | 376 | if (pos < 0) |
@@ -418,13 +421,13 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta | |||
418 | #endif | 421 | #endif |
419 | } | 422 | } |
420 | if ( libfile.isEmpty() ) | 423 | if ( libfile.isEmpty() ) |
421 | { | 424 | { |
422 | #ifndef NDEBUG | 425 | #ifndef NDEBUG |
423 | kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; | 426 | kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; |
424 | self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); | 427 | self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(QString(libname)); |
425 | 428 | ||
426 | qDebug("KLibLoader::library could not find library: %s", libname.data()); | 429 | qDebug("KLibLoader::library could not find library: %s", libname.data()); |
427 | #endif | 430 | #endif |
428 | 431 | ||
429 | } | 432 | } |
430 | else | 433 | else |
@@ -466,13 +469,13 @@ KLibrary* KLibLoader::library( const char *name ) | |||
466 | wrap->ref_count++; | 469 | wrap->ref_count++; |
467 | return wrap->lib; | 470 | return wrap->lib; |
468 | } | 471 | } |
469 | 472 | ||
470 | /* Test if this library was loaded at some time, but got | 473 | /* Test if this library was loaded at some time, but got |
471 | unloaded meanwhile, whithout being dlclose()'ed. */ | 474 | unloaded meanwhile, whithout being dlclose()'ed. */ |
472 | QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); | 475 | Q3PtrListIterator<KLibWrapPrivate> it(d->loaded_stack); |
473 | for (; it.current(); ++it) { | 476 | for (; it.current(); ++it) { |
474 | if (it.current()->name == name) | 477 | if (it.current()->name == name) |
475 | wrap = it.current(); | 478 | wrap = it.current(); |
476 | } | 479 | } |
477 | 480 | ||
478 | if (wrap) { | 481 | if (wrap) { |
@@ -547,13 +550,13 @@ KLibFactory* KLibLoader::factory( const char* name ) | |||
547 | } | 550 | } |
548 | 551 | ||
549 | void KLibLoader::slotLibraryDestroyed() | 552 | void KLibLoader::slotLibraryDestroyed() |
550 | { | 553 | { |
551 | const KLibrary *lib = static_cast<const KLibrary *>( sender() ); | 554 | const KLibrary *lib = static_cast<const KLibrary *>( sender() ); |
552 | 555 | ||
553 | QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); | 556 | Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs ); |
554 | for (; it.current(); ++it ) | 557 | for (; it.current(); ++it ) |
555 | if ( it.current()->lib == lib ) | 558 | if ( it.current()->lib == lib ) |
556 | { | 559 | { |
557 | KLibWrapPrivate *wrap = it.current(); | 560 | KLibWrapPrivate *wrap = it.current(); |
558 | wrap->lib = 0; /* the KLibrary object is already away */ | 561 | wrap->lib = 0; /* the KLibrary object is already away */ |
559 | m_libs.remove( it.currentKey() ); | 562 | m_libs.remove( it.currentKey() ); |
@@ -566,13 +569,13 @@ void KLibLoader::close_pending(KLibWrapPrivate *wrap) | |||
566 | { | 569 | { |
567 | if (wrap && !d->pending_close.containsRef( wrap )) | 570 | if (wrap && !d->pending_close.containsRef( wrap )) |
568 | d->pending_close.append( wrap ); | 571 | d->pending_close.append( wrap ); |
569 | 572 | ||
570 | /* First delete all KLibrary objects in pending_close, but _don't_ unload | 573 | /* First delete all KLibrary objects in pending_close, but _don't_ unload |
571 | the DSO behind it. */ | 574 | the DSO behind it. */ |
572 | QPtrListIterator<KLibWrapPrivate> it(d->pending_close); | 575 | Q3PtrListIterator<KLibWrapPrivate> it(d->pending_close); |
573 | for (; it.current(); ++it) { | 576 | for (; it.current(); ++it) { |
574 | wrap = it.current(); | 577 | wrap = it.current(); |
575 | if (wrap->lib) { | 578 | if (wrap->lib) { |
576 | disconnect( wrap->lib, SIGNAL( destroyed() ), | 579 | disconnect( wrap->lib, SIGNAL( destroyed() ), |
577 | this, SLOT( slotLibraryDestroyed() ) ); | 580 | this, SLOT( slotLibraryDestroyed() ) ); |
578 | delete wrap->lib; | 581 | 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 @@ | |||
18 | #ifndef KLIBLOADER_H | 18 | #ifndef KLIBLOADER_H |
19 | #define KLIBLOADER_H | 19 | #define KLIBLOADER_H |
20 | 20 | ||
21 | #include <qobject.h> | 21 | #include <qobject.h> |
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | #include <qstringlist.h> | 23 | #include <qstringlist.h> |
24 | #include <qasciidict.h> | 24 | #include <q3asciidict.h> |
25 | #include <qptrlist.h> | 25 | #include <q3ptrlist.h> |
26 | #include <kglobal.h> | 26 | #include <kglobal.h> |
27 | 27 | ||
28 | #include <stdlib.h> // For backwards compatibility | 28 | #include <stdlib.h> // For backwards compatibility |
29 | 29 | ||
30 | class KInstance; | 30 | class KInstance; |
31 | class QTimer; | 31 | class QTimer; |
@@ -49,13 +49,13 @@ class QLibrary; | |||
49 | * @see KLibLoader | 49 | * @see KLibLoader |
50 | * @author Torben Weis <weis@kde.org> | 50 | * @author Torben Weis <weis@kde.org> |
51 | */ | 51 | */ |
52 | class KLibrary : public QObject | 52 | class KLibrary : public QObject |
53 | { | 53 | { |
54 | friend class KLibLoader; | 54 | friend class KLibLoader; |
55 | friend class QAsciiDict<KLibrary>; | 55 | friend class Q3AsciiDict<KLibrary>; |
56 | 56 | ||
57 | Q_OBJECT | 57 | Q_OBJECT |
58 | public: | 58 | public: |
59 | /** | 59 | /** |
60 | * @internal | 60 | * @internal |
61 | * Don't create KLibrary objects on your own. Instead use @ref KLibLoader. | 61 | * Don't create KLibrary objects on your own. Instead use @ref KLibLoader. |
@@ -124,13 +124,13 @@ private: | |||
124 | 124 | ||
125 | QString m_libname; | 125 | QString m_libname; |
126 | QString m_filename; | 126 | QString m_filename; |
127 | KLibFactory* m_factory; | 127 | KLibFactory* m_factory; |
128 | //US void * m_handle; | 128 | //US void * m_handle; |
129 | QLibrary* m_handle; | 129 | QLibrary* m_handle; |
130 | QPtrList<QObject> m_objs; | 130 | Q3PtrList<QObject> m_objs; |
131 | QTimer *m_timer; | 131 | QTimer *m_timer; |
132 | KLibraryPrivate *d; | 132 | KLibraryPrivate *d; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | class KLibWrapPrivate; | 135 | class KLibWrapPrivate; |
136 | 136 | ||
@@ -284,13 +284,13 @@ protected: | |||
284 | KLibLoader( QObject* parent = 0, const char* name = 0 ); | 284 | KLibLoader( QObject* parent = 0, const char* name = 0 ); |
285 | 285 | ||
286 | private slots: | 286 | private slots: |
287 | void slotLibraryDestroyed(); | 287 | void slotLibraryDestroyed(); |
288 | private: | 288 | private: |
289 | void close_pending( KLibWrapPrivate * ); | 289 | void close_pending( KLibWrapPrivate * ); |
290 | QAsciiDict<KLibWrapPrivate> m_libs; | 290 | Q3AsciiDict<KLibWrapPrivate> m_libs; |
291 | 291 | ||
292 | static KLibLoader* s_self; | 292 | static KLibLoader* s_self; |
293 | 293 | ||
294 | protected: | 294 | protected: |
295 | virtual void virtual_hook( int id, void* data ); | 295 | virtual void virtual_hook( int id, void* data ); |
296 | private: | 296 | 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 @@ | |||
1 | #include <qregexp.h> | 1 | #include <qregexp.h> |
2 | #include <qapplication.h> | 2 | #include <qapplication.h> |
3 | #include <QDesktopWidget> | ||
3 | 4 | ||
4 | #include "kdebug.h" | 5 | #include "kdebug.h" |
5 | #include "kcalendarsystemgregorian.h" | 6 | #include "kcalendarsystemgregorian.h" |
6 | 7 | ||
7 | #include "klocale.h" | 8 | #include "klocale.h" |
8 | 9 | ||
9 | #include <qstringlist.h> | 10 | #include <qstringlist.h> |
10 | 11 | ||
11 | //#define COLLECT_TRANSLATION | 12 | //#define COLLECT_TRANSLATION |
12 | 13 | ||
13 | 14 | ||
14 | QDict<QString> *mLocaleDict = 0; | 15 | Q3Dict<QString> *mLocaleDict = 0; |
15 | void setLocaleDict( QDict<QString> * dict ) | 16 | void setLocaleDict( Q3Dict<QString> * dict ) |
16 | { | 17 | { |
17 | mLocaleDict = dict; | 18 | mLocaleDict = dict; |
18 | 19 | ||
19 | } | 20 | } |
20 | 21 | ||
21 | #ifdef COLLECT_TRANSLATION | 22 | #ifdef COLLECT_TRANSLATION |
@@ -42,24 +43,24 @@ void addExist(const char *text,QString trans ) | |||
42 | 43 | ||
43 | } | 44 | } |
44 | 45 | ||
45 | } | 46 | } |
46 | 47 | ||
47 | #include <qfile.h> | 48 | #include <qfile.h> |
48 | #include <qtextstream.h> | 49 | #include <q3textstream.h> |
49 | #include <qtextcodec.h> | 50 | #include <qtextcodec.h> |
50 | #endif | 51 | #endif |
51 | void dumpMissing() | 52 | void dumpMissing() |
52 | { | 53 | { |
53 | #ifdef COLLECT_TRANSLATION | 54 | #ifdef COLLECT_TRANSLATION |
54 | QString fileName = "/tmp/usernewtrans.txt"; | 55 | QString fileName = "/tmp/usernewtrans.txt"; |
55 | QFile file( fileName ); | 56 | QFile file( fileName ); |
56 | if (!file.open( IO_WriteOnly ) ) { | 57 | if (!file.open( QIODevice::WriteOnly ) ) { |
57 | return ; | 58 | return ; |
58 | } | 59 | } |
59 | QTextStream ts( &file ); | 60 | Q3TextStream ts( &file ); |
60 | ts.setCodec( QTextCodec::codecForName("utf8") ); | 61 | ts.setCodec( QTextCodec::codecForName("utf8") ); |
61 | 62 | ||
62 | int i; | 63 | int i; |
63 | for ( i = 0; i< missingTrans.count(); ++i ) { | 64 | for ( i = 0; i< missingTrans.count(); ++i ) { |
64 | 65 | ||
65 | QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" ); | 66 | QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" ); |
@@ -67,16 +68,16 @@ void dumpMissing() | |||
67 | 68 | ||
68 | } | 69 | } |
69 | file.close(); | 70 | file.close(); |
70 | { | 71 | { |
71 | QString fileName = "/tmp/usertrans.txt"; | 72 | QString fileName = "/tmp/usertrans.txt"; |
72 | QFile file( fileName ); | 73 | QFile file( fileName ); |
73 | if (!file.open( IO_WriteOnly ) ) { | 74 | if (!file.open( QIODevice::WriteOnly ) ) { |
74 | return ; | 75 | return ; |
75 | } | 76 | } |
76 | QTextStream ts( &file ); | 77 | Q3TextStream ts( &file ); |
77 | ts.setCodec( QTextCodec::codecForName("utf8") ); | 78 | ts.setCodec( QTextCodec::codecForName("utf8") ); |
78 | 79 | ||
79 | int i; | 80 | int i; |
80 | for ( i = 0; i< existingTrans1.count(); ++i ) { | 81 | for ( i = 0; i< existingTrans1.count(); ++i ) { |
81 | 82 | ||
82 | QString text = existingTrans1[i].replace( QRegExp("\n"),"\\n" ); | 83 | QString text = existingTrans1[i].replace( QRegExp("\n"),"\\n" ); |
@@ -464,13 +465,13 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime, | |||
464 | QString format("%1 %2"); | 465 | QString format("%1 %2"); |
465 | 466 | ||
466 | if ( intIntDateFormat == Default ) | 467 | if ( intIntDateFormat == Default ) |
467 | format = "%1 %2"; | 468 | format = "%1 %2"; |
468 | else if ( intIntDateFormat == Format1 ) | 469 | else if ( intIntDateFormat == Format1 ) |
469 | format = "%1 %2"; | 470 | format = "%1 %2"; |
470 | else if ( intIntDateFormat == ISODate ) | 471 | else if ( intIntDateFormat == Qt::ISODate ) |
471 | format = "%1T%2"; | 472 | format = "%1T%2"; |
472 | 473 | ||
473 | QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) | 474 | QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) |
474 | .arg(formatTime( pDateTime.time(), includeSeconds , intIntDateFormat )); | 475 | .arg(formatTime( pDateTime.time(), includeSeconds , intIntDateFormat )); |
475 | 476 | ||
476 | //qDebug("KLocale::formatDateTime transformed %s, into %s", pDateTime.toString().latin1(), res.latin1() ); | 477 | //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 | |||
524 | 525 | ||
525 | // remove space at the begining | 526 | // remove space at the begining |
526 | if (str.length() > strpos && str.at(strpos).isSpace()) | 527 | if (str.length() > strpos && str.at(strpos).isSpace()) |
527 | strpos++; | 528 | strpos++; |
528 | 529 | ||
529 | c = fmt.at(fmtpos++); | 530 | c = fmt.at(fmtpos++); |
530 | switch (c) | 531 | switch (c.unicode()) |
531 | { | 532 | { |
532 | case 'a': | 533 | case 'a': |
533 | case 'A': | 534 | case 'A': |
534 | // this will just be ignored | 535 | // this will just be ignored |
535 | { // Cristian Tache: porting to Win: Block added because of "j" redefinition | 536 | { // Cristian Tache: porting to Win: Block added because of "j" redefinition |
536 | for (int j = 1; j < 8; j++) { | 537 | for (int j = 1; j < 8; j++) { |
@@ -635,13 +636,13 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const | |||
635 | 636 | ||
636 | // remove space at the begining | 637 | // remove space at the begining |
637 | if (str.length() > strpos && str.at(strpos).isSpace()) | 638 | if (str.length() > strpos && str.at(strpos).isSpace()) |
638 | strpos++; | 639 | strpos++; |
639 | 640 | ||
640 | c = Format.at(Formatpos++); | 641 | c = Format.at(Formatpos++); |
641 | switch (c) | 642 | switch (c.unicode()) |
642 | { | 643 | { |
643 | case 'p': | 644 | case 'p': |
644 | { | 645 | { |
645 | QString s; | 646 | QString s; |
646 | s = i18n("pm").lower(); | 647 | s = i18n("pm").lower(); |
647 | int len = s.length(); | 648 | int len = s.length(); |
@@ -731,13 +732,13 @@ QDateTime KLocale::readDateTime(const QString &intstr, | |||
731 | QString time = intstr.mid(pos+1); | 732 | QString time = intstr.mid(pos+1); |
732 | 733 | ||
733 | QString dformat = dateFormat(intIntDateFormat); | 734 | QString dformat = dateFormat(intIntDateFormat); |
734 | QString tformat = timeFormat(intIntDateFormat); | 735 | QString tformat = timeFormat(intIntDateFormat); |
735 | 736 | ||
736 | QDate m_date = readDate(date, dformat, &ok1); | 737 | QDate m_date = readDate(date, dformat, &ok1); |
737 | QTime m_time = readTime(time, tformat, &ok2); | 738 | QTime m_time = readTime(time, !tformat.isEmpty(), &ok2); |
738 | 739 | ||
739 | QDateTime m_dt; | 740 | QDateTime m_dt; |
740 | 741 | ||
741 | if (ok) | 742 | if (ok) |
742 | { | 743 | { |
743 | if ((ok1 == false) || (ok2 == false)) | 744 | 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 @@ | |||
1 | #ifndef MINIKDE_KLOCALE_H | 1 | #ifndef MINIKDE_KLOCALE_H |
2 | #define MINIKDE_KLOCALE_H | 2 | #define MINIKDE_KLOCALE_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qdatetime.h> | 6 | #include <qdatetime.h> |
7 | #include <qdict.h> | 7 | #include <q3dict.h> |
8 | 8 | ||
9 | #ifndef I18N_NOOP | 9 | #ifndef I18N_NOOP |
10 | #define I18N_NOOP(x) (x) | 10 | #define I18N_NOOP(x) (x) |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | class KCalendarSystem; | 13 | class KCalendarSystem; |
14 | void setLocaleDict( QDict<QString> * dict ); | 14 | void setLocaleDict( Q3Dict<QString> * dict ); |
15 | QString i18n(const char *text); | 15 | QString i18n(const char *text); |
16 | QString i18n(const char *hint, const char *text); | 16 | QString i18n(const char *hint, const char *text); |
17 | QString i18n(const char *text1, const char *textn, int num); | 17 | QString i18n(const char *text1, const char *textn, int num); |
18 | 18 | ||
19 | // Qt3's uic generates i18n( "msg", "comment" ) calls which conflict | 19 | // Qt3's uic generates i18n( "msg", "comment" ) calls which conflict |
20 | // with our i18n method. we use uic -tr tr2i18n to redirect | 20 | // 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 @@ | |||
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | #include <string.h> | 37 | #include <string.h> |
38 | #include <stdlib.h> | 38 | #include <stdlib.h> |
39 | 39 | ||
40 | #include <kdebug.h> | 40 | #include <kdebug.h> |
41 | #include "kmdcodec.h" | 41 | #include "kmdcodec.h" |
42 | //Added by qt3to4: | ||
43 | #include <Q3CString> | ||
42 | 44 | ||
43 | #define KMD5_S11 7 | 45 | #define KMD5_S11 7 |
44 | #define KMD5_S12 12 | 46 | #define KMD5_S12 12 |
45 | #define KMD5_S13 17 | 47 | #define KMD5_S13 17 |
46 | #define KMD5_S14 22 | 48 | #define KMD5_S14 22 |
47 | #define KMD5_S21 5 | 49 | #define KMD5_S21 5 |
@@ -144,20 +146,20 @@ static int rikFindChar(register const char * _s, const char c) | |||
144 | if ((0 == *s) || (c == *s)) break; ++s; | 146 | if ((0 == *s) || (c == *s)) break; ++s; |
145 | } | 147 | } |
146 | 148 | ||
147 | return s - _s; | 149 | return s - _s; |
148 | } | 150 | } |
149 | 151 | ||
150 | QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) | 152 | Q3CString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) |
151 | { | 153 | { |
152 | QByteArray out; | 154 | QByteArray out; |
153 | quotedPrintableEncode (in, out, useCRLF); | 155 | quotedPrintableEncode (in, out, useCRLF); |
154 | return QCString (out.data(), out.size()+1); | 156 | return Q3CString (out.data(), out.size()+1); |
155 | } | 157 | } |
156 | 158 | ||
157 | QCString KCodecs::quotedPrintableEncode(const QCString& str, bool useCRLF) | 159 | Q3CString KCodecs::quotedPrintableEncode(const Q3CString& str, bool useCRLF) |
158 | { | 160 | { |
159 | if (str.isEmpty()) | 161 | if (str.isEmpty()) |
160 | return ""; | 162 | return ""; |
161 | 163 | ||
162 | QByteArray in (str.length()); | 164 | QByteArray in (str.length()); |
163 | memcpy (in.data(), str.data(), str.length()); | 165 | memcpy (in.data(), str.data(), str.length()); |
@@ -277,20 +279,20 @@ void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool | |||
277 | } | 279 | } |
278 | } | 280 | } |
279 | 281 | ||
280 | out.truncate(cursor - out.data()); | 282 | out.truncate(cursor - out.data()); |
281 | } | 283 | } |
282 | 284 | ||
283 | QCString KCodecs::quotedPrintableDecode(const QByteArray & in) | 285 | Q3CString KCodecs::quotedPrintableDecode(const QByteArray & in) |
284 | { | 286 | { |
285 | QByteArray out; | 287 | QByteArray out; |
286 | quotedPrintableDecode (in, out); | 288 | quotedPrintableDecode (in, out); |
287 | return QCString (out.data(), out.size()+1); | 289 | return Q3CString (out.data(), out.size()+1); |
288 | } | 290 | } |
289 | 291 | ||
290 | QCString KCodecs::quotedPrintableDecode(const QCString & str) | 292 | Q3CString KCodecs::quotedPrintableDecode(const Q3CString & str) |
291 | { | 293 | { |
292 | if (str.isEmpty()) | 294 | if (str.isEmpty()) |
293 | return ""; | 295 | return ""; |
294 | 296 | ||
295 | QByteArray in (str.length()); | 297 | QByteArray in (str.length()); |
296 | memcpy (in.data(), str.data(), str.length()); | 298 | memcpy (in.data(), str.data(), str.length()); |
@@ -352,27 +354,27 @@ void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out) | |||
352 | } | 354 | } |
353 | } | 355 | } |
354 | 356 | ||
355 | out.truncate(cursor - out.data()); | 357 | out.truncate(cursor - out.data()); |
356 | } | 358 | } |
357 | 359 | ||
358 | QCString KCodecs::base64Encode( const QCString& str, bool insertLFs ) | 360 | Q3CString KCodecs::base64Encode( const Q3CString& str, bool insertLFs ) |
359 | { | 361 | { |
360 | if ( str.isEmpty() ) | 362 | if ( str.isEmpty() ) |
361 | return ""; | 363 | return ""; |
362 | 364 | ||
363 | QByteArray in (str.length()); | 365 | QByteArray in (str.length()); |
364 | memcpy( in.data(), str.data(), str.length() ); | 366 | memcpy( in.data(), str.data(), str.length() ); |
365 | return base64Encode( in, insertLFs ); | 367 | return base64Encode( in, insertLFs ); |
366 | } | 368 | } |
367 | 369 | ||
368 | QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) | 370 | Q3CString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) |
369 | { | 371 | { |
370 | QByteArray out; | 372 | QByteArray out; |
371 | base64Encode( in, out, insertLFs ); | 373 | base64Encode( in, out, insertLFs ); |
372 | return QCString( out.data(), out.size()+1 ); | 374 | return Q3CString( out.data(), out.size()+1 ); |
373 | } | 375 | } |
374 | 376 | ||
375 | void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, | 377 | void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, |
376 | bool insertLFs ) | 378 | bool insertLFs ) |
377 | { | 379 | { |
378 | // clear out the output buffer | 380 | // clear out the output buffer |
@@ -402,66 +404,63 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, | |||
402 | { | 404 | { |
403 | while (sidx < len-2) | 405 | while (sidx < len-2) |
404 | { | 406 | { |
405 | if ( insertLFs ) | 407 | if ( insertLFs ) |
406 | { | 408 | { |
407 | if ( count && (count%76) == 0 ) | 409 | if ( count && (count%76) == 0 ) |
408 | out.at(didx++) = '\n'; | 410 | out[didx++] = '\n'; |
409 | count += 4; | 411 | count += 4; |
410 | } | 412 | } |
411 | out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; | 413 | out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077]; |
412 | out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | | 414 | out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 | |
413 | (data[sidx] << 4) & 077]; | 415 | (data[sidx] << 4) & 077]; |
414 | out.at(didx++) = Base64EncMap[(data[sidx+2] >> 6) & 003 | | 416 | out[didx++] = Base64EncMap[(data[sidx+2] >> 6) & 003 | |
415 | (data[sidx+1] << 2) & 077]; | 417 | (data[sidx+1] << 2) & 077]; |
416 | out.at(didx++) = Base64EncMap[data[sidx+2] & 077]; | 418 | out[didx++] = Base64EncMap[data[sidx+2] & 077]; |
417 | sidx += 3; | 419 | sidx += 3; |
418 | } | 420 | } |
419 | } | 421 | } |
420 | 422 | ||
421 | if (sidx < len) | 423 | if (sidx < len) |
422 | { | 424 | { |
423 | if ( insertLFs && (count > 0) && (count%76) == 0 ) | 425 | if ( insertLFs && (count > 0) && (count%76) == 0 ) |
424 | out.at(didx++) = '\n'; | 426 | out[didx++] = '\n'; |
425 | 427 | ||
426 | out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; | 428 | out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077]; |
427 | if (sidx < len-1) | 429 | if (sidx < len-1) |
428 | { | 430 | { |
429 | out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | | 431 | out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 | |
430 | (data[sidx] << 4) & 077]; | 432 | (data[sidx] << 4) & 077]; |
431 | out.at(didx++) = Base64EncMap[(data[sidx+1] << 2) & 077]; | 433 | out[didx++] = Base64EncMap[(data[sidx+1] << 2) & 077]; |
432 | } | 434 | } |
433 | else | 435 | else |
434 | { | 436 | { |
435 | out.at(didx++) = Base64EncMap[(data[sidx] << 4) & 077]; | 437 | out[didx++] = Base64EncMap[(data[sidx] << 4) & 077]; |
436 | } | 438 | } |
437 | } | 439 | } |
438 | 440 | ||
439 | // Add padding | 441 | // Add padding |
440 | while (didx < out.size()) | 442 | while (didx < out.size()) |
441 | { | 443 | out[didx++] = '='; |
442 | out.at(didx) = '='; | ||
443 | didx++; | ||
444 | } | ||
445 | } | 444 | } |
446 | 445 | ||
447 | QCString KCodecs::base64Decode( const QCString& str ) | 446 | Q3CString KCodecs::base64Decode( const Q3CString& str ) |
448 | { | 447 | { |
449 | if ( str.isEmpty() ) | 448 | if ( str.isEmpty() ) |
450 | return ""; | 449 | return ""; |
451 | 450 | ||
452 | QByteArray in( str.length() ); | 451 | QByteArray in( str.length() ); |
453 | memcpy( in.data(), str.data(), str.length() ); | 452 | memcpy( in.data(), str.data(), str.length() ); |
454 | return base64Decode( in ); | 453 | return base64Decode( in ); |
455 | } | 454 | } |
456 | 455 | ||
457 | QCString KCodecs::base64Decode( const QByteArray& in ) | 456 | Q3CString KCodecs::base64Decode( const QByteArray& in ) |
458 | { | 457 | { |
459 | QByteArray out; | 458 | QByteArray out; |
460 | base64Decode( in, out ); | 459 | base64Decode( in, out ); |
461 | return QCString( out.data(), out.size()+1 ); | 460 | return Q3CString( out.data(), out.size()+1 ); |
462 | } | 461 | } |
463 | 462 | ||
464 | void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) | 463 | void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) |
465 | { | 464 | { |
466 | out.resize(0); | 465 | out.resize(0); |
467 | if ( in.isEmpty() ) | 466 | if ( in.isEmpty() ) |
@@ -502,13 +501,13 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) | |||
502 | // Adhere to RFC 2045 and ignore characters | 501 | // Adhere to RFC 2045 and ignore characters |
503 | // that are not part of the encoding table. | 502 | // that are not part of the encoding table. |
504 | unsigned char ch = data[idx]; | 503 | unsigned char ch = data[idx]; |
505 | if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) || | 504 | if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) || |
506 | (ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=') | 505 | (ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=') |
507 | { | 506 | { |
508 | out.at(outIdx++) = Base64DecMap[ch]; | 507 | out[outIdx++] = Base64DecMap[ch]; |
509 | } | 508 | } |
510 | else | 509 | else |
511 | { | 510 | { |
512 | len--; | 511 | len--; |
513 | tail--; | 512 | tail--; |
514 | } | 513 | } |
@@ -520,47 +519,47 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) | |||
520 | len = (tail>(len/4)) ? tail-(len/4) : 0; | 519 | len = (tail>(len/4)) ? tail-(len/4) : 0; |
521 | unsigned int sidx = 0, didx = 0; | 520 | unsigned int sidx = 0, didx = 0; |
522 | if ( len > 1 ) | 521 | if ( len > 1 ) |
523 | { | 522 | { |
524 | while (didx < len-2) | 523 | while (didx < len-2) |
525 | { | 524 | { |
526 | out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); | 525 | out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003)); |
527 | out.at(didx+1) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); | 526 | out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017)); |
528 | out.at(didx+2) = (((out.at(sidx+2) << 6) & 255) | (out.at(sidx+3) & 077)); | 527 | out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077)); |
529 | sidx += 4; | 528 | sidx += 4; |
530 | didx += 3; | 529 | didx += 3; |
531 | } | 530 | } |
532 | } | 531 | } |
533 | 532 | ||
534 | if (didx < len) | 533 | if (didx < len) |
535 | out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); | 534 | out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003)); |
536 | 535 | ||
537 | if (++didx < len ) | 536 | if (++didx < len ) |
538 | out.at(didx) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); | 537 | out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017)); |
539 | 538 | ||
540 | // Resize the output buffer | 539 | // Resize the output buffer |
541 | if ( len == 0 || len < out.size() ) | 540 | if ( len == 0 || len < out.size() ) |
542 | out.resize(len); | 541 | out.resize(len); |
543 | } | 542 | } |
544 | 543 | ||
545 | QCString KCodecs::uuencode( const QCString& str ) | 544 | Q3CString KCodecs::uuencode( const Q3CString& str ) |
546 | { | 545 | { |
547 | if ( str.isEmpty() ) | 546 | if ( str.isEmpty() ) |
548 | return ""; | 547 | return ""; |
549 | 548 | ||
550 | QByteArray in; | 549 | QByteArray in; |
551 | in.resize( str.length() ); | 550 | in.resize( str.length() ); |
552 | memcpy( in.data(), str.data(), str.length() ); | 551 | memcpy( in.data(), str.data(), str.length() ); |
553 | return uuencode( in ); | 552 | return uuencode( in ); |
554 | } | 553 | } |
555 | 554 | ||
556 | QCString KCodecs::uuencode( const QByteArray& in ) | 555 | Q3CString KCodecs::uuencode( const QByteArray& in ) |
557 | { | 556 | { |
558 | QByteArray out; | 557 | QByteArray out; |
559 | uuencode( in, out ); | 558 | uuencode( in, out ); |
560 | return QCString( out.data(), out.size()+1 ); | 559 | return Q3CString( out.data(), out.size()+1 ); |
561 | } | 560 | } |
562 | 561 | ||
563 | void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) | 562 | void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) |
564 | { | 563 | { |
565 | out.resize( 0 ); | 564 | out.resize( 0 ); |
566 | if( in.isEmpty() ) | 565 | if( in.isEmpty() ) |
@@ -577,87 +576,87 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) | |||
577 | 576 | ||
578 | out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) ); | 577 | out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) ); |
579 | // split into lines, adding line-length and line terminator | 578 | // split into lines, adding line-length and line terminator |
580 | while (sidx+line_len < len) | 579 | while (sidx+line_len < len) |
581 | { | 580 | { |
582 | // line length | 581 | // line length |
583 | out.at(didx++) = UUEncMap[line_len]; | 582 | out[didx++] = UUEncMap[line_len]; |
584 | 583 | ||
585 | // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion | 584 | // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion |
586 | for (unsigned int end = sidx+line_len; sidx < end; sidx += 3) | 585 | for (unsigned int end = sidx+line_len; sidx < end; sidx += 3) |
587 | { | 586 | { |
588 | out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; | 587 | out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; |
589 | out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | | 588 | out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | |
590 | (data[sidx] << 4) & 077]; | 589 | (data[sidx] << 4) & 077]; |
591 | out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | | 590 | out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 | |
592 | (data[sidx+1] << 2) & 077]; | 591 | (data[sidx+1] << 2) & 077]; |
593 | out.at(didx++) = UUEncMap[data[sidx+2] & 077]; | 592 | out[didx++] = UUEncMap[data[sidx+2] & 077]; |
594 | } | 593 | } |
595 | 594 | ||
596 | // line terminator | 595 | // line terminator |
597 | //for (unsigned int idx=0; idx < nl_len; idx++) | 596 | //for (unsigned int idx=0; idx < nl_len; idx++) |
598 | //out.at(didx++) = nl[idx]; | 597 | //out[didx++] = nl[idx]; |
599 | memcpy(out.data()+didx, nl, nl_len); | 598 | memcpy(out.data()+didx, nl, nl_len); |
600 | didx += nl_len; | 599 | didx += nl_len; |
601 | } | 600 | } |
602 | 601 | ||
603 | // line length | 602 | // line length |
604 | out.at(didx++) = UUEncMap[len-sidx]; | 603 | out[didx++] = UUEncMap[len-sidx]; |
605 | // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion | 604 | // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion |
606 | while (sidx+2 < len) | 605 | while (sidx+2 < len) |
607 | { | 606 | { |
608 | out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; | 607 | out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; |
609 | out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | | 608 | out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | |
610 | (data[sidx] << 4) & 077]; | 609 | (data[sidx] << 4) & 077]; |
611 | out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | | 610 | out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 | |
612 | (data[sidx+1] << 2) & 077]; | 611 | (data[sidx+1] << 2) & 077]; |
613 | out.at(didx++) = UUEncMap[data[sidx+2] & 077]; | 612 | out[didx++] = UUEncMap[data[sidx+2] & 077]; |
614 | sidx += 3; | 613 | sidx += 3; |
615 | } | 614 | } |
616 | 615 | ||
617 | if (sidx < len-1) | 616 | if (sidx < len-1) |
618 | { | 617 | { |
619 | out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; | 618 | out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; |
620 | out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | | 619 | out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | |
621 | (data[sidx] << 4) & 077]; | 620 | (data[sidx] << 4) & 077]; |
622 | out.at(didx++) = UUEncMap[(data[sidx+1] << 2) & 077]; | 621 | out[didx++] = UUEncMap[(data[sidx+1] << 2) & 077]; |
623 | out.at(didx++) = UUEncMap[0]; | 622 | out[didx++] = UUEncMap[0]; |
624 | } | 623 | } |
625 | else if (sidx < len) | 624 | else if (sidx < len) |
626 | { | 625 | { |
627 | out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; | 626 | out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; |
628 | out.at(didx++) = UUEncMap[(data[sidx] << 4) & 077]; | 627 | out[didx++] = UUEncMap[(data[sidx] << 4) & 077]; |
629 | out.at(didx++) = UUEncMap[0]; | 628 | out[didx++] = UUEncMap[0]; |
630 | out.at(didx++) = UUEncMap[0]; | 629 | out[didx++] = UUEncMap[0]; |
631 | } | 630 | } |
632 | 631 | ||
633 | // line terminator | 632 | // line terminator |
634 | memcpy(out.data()+didx, nl, nl_len); | 633 | memcpy(out.data()+didx, nl, nl_len); |
635 | didx += nl_len; | 634 | didx += nl_len; |
636 | 635 | ||
637 | // sanity check | 636 | // sanity check |
638 | if ( didx != out.size() ) | 637 | if ( didx != out.size() ) |
639 | out.resize( 0 ); | 638 | out.resize( 0 ); |
640 | } | 639 | } |
641 | 640 | ||
642 | QCString KCodecs::uudecode( const QCString& str ) | 641 | Q3CString KCodecs::uudecode( const Q3CString& str ) |
643 | { | 642 | { |
644 | if ( str.isEmpty() ) | 643 | if ( str.isEmpty() ) |
645 | return ""; | 644 | return ""; |
646 | 645 | ||
647 | QByteArray in; | 646 | QByteArray in; |
648 | in.resize( str.length() ); | 647 | in.resize( str.length() ); |
649 | memcpy( in.data(), str.data(), str.length() ); | 648 | memcpy( in.data(), str.data(), str.length() ); |
650 | return uudecode( in ); | 649 | return uudecode( in ); |
651 | } | 650 | } |
652 | 651 | ||
653 | QCString KCodecs::uudecode( const QByteArray& in ) | 652 | Q3CString KCodecs::uudecode( const QByteArray& in ) |
654 | { | 653 | { |
655 | QByteArray out; | 654 | QByteArray out; |
656 | uudecode( in, out ); | 655 | uudecode( in, out ); |
657 | return QCString( out.data(), out.size()+1 ); | 656 | return Q3CString( out.data(), out.size()+1 ); |
658 | } | 657 | } |
659 | 658 | ||
660 | void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) | 659 | void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) |
661 | { | 660 | { |
662 | out.resize( 0 ); | 661 | out.resize( 0 ); |
663 | if( in.isEmpty() ) | 662 | if( in.isEmpty() ) |
@@ -702,31 +701,31 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) | |||
702 | while (didx < end-2) | 701 | while (didx < end-2) |
703 | { | 702 | { |
704 | A = UUDecMap[(unsigned char) data[sidx]]; | 703 | A = UUDecMap[(unsigned char) data[sidx]]; |
705 | B = UUDecMap[(unsigned char) data[sidx+1]]; | 704 | B = UUDecMap[(unsigned char) data[sidx+1]]; |
706 | C = UUDecMap[(unsigned char) data[sidx+2]]; | 705 | C = UUDecMap[(unsigned char) data[sidx+2]]; |
707 | D = UUDecMap[(unsigned char) data[sidx+3]]; | 706 | D = UUDecMap[(unsigned char) data[sidx+3]]; |
708 | out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); | 707 | out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) ); |
709 | out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); | 708 | out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) ); |
710 | out.at(didx++) = ( ((C << 6) & 255) | (D & 077) ); | 709 | out[didx++] = ( ((C << 6) & 255) | (D & 077) ); |
711 | sidx += 4; | 710 | sidx += 4; |
712 | } | 711 | } |
713 | } | 712 | } |
714 | 713 | ||
715 | if (didx < end) | 714 | if (didx < end) |
716 | { | 715 | { |
717 | A = UUDecMap[(unsigned char) data[sidx]]; | 716 | A = UUDecMap[(unsigned char) data[sidx]]; |
718 | B = UUDecMap[(unsigned char) data[sidx+1]]; | 717 | B = UUDecMap[(unsigned char) data[sidx+1]]; |
719 | out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); | 718 | out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) ); |
720 | } | 719 | } |
721 | 720 | ||
722 | if (didx < end) | 721 | if (didx < end) |
723 | { | 722 | { |
724 | B = UUDecMap[(unsigned char) data[sidx+1]]; | 723 | B = UUDecMap[(unsigned char) data[sidx+1]]; |
725 | C = UUDecMap[(unsigned char) data[sidx+2]]; | 724 | C = UUDecMap[(unsigned char) data[sidx+2]]; |
726 | out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); | 725 | out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) ); |
727 | } | 726 | } |
728 | 727 | ||
729 | // skip padding | 728 | // skip padding |
730 | while (sidx < len && data[sidx] != '\n' && data[sidx] != '\r') | 729 | while (sidx < len && data[sidx] != '\n' && data[sidx] != '\r') |
731 | sidx++; | 730 | sidx++; |
732 | 731 | ||
@@ -758,24 +757,24 @@ KMD5::KMD5(const char *in, int len) | |||
758 | KMD5::KMD5(const QByteArray& in) | 757 | KMD5::KMD5(const QByteArray& in) |
759 | { | 758 | { |
760 | init(); | 759 | init(); |
761 | update( in ); | 760 | update( in ); |
762 | } | 761 | } |
763 | 762 | ||
764 | KMD5::KMD5(const QCString& in) | 763 | KMD5::KMD5(const Q3CString& in) |
765 | { | 764 | { |
766 | init(); | 765 | init(); |
767 | update( in ); | 766 | update( in ); |
768 | } | 767 | } |
769 | 768 | ||
770 | void KMD5::update(const QByteArray& in) | 769 | void KMD5::update(const QByteArray& in) |
771 | { | 770 | { |
772 | update(in.data(), int(in.size())); | 771 | update(in.data(), int(in.size())); |
773 | } | 772 | } |
774 | 773 | ||
775 | void KMD5::update(const QCString& in) | 774 | void KMD5::update(const Q3CString& in) |
776 | { | 775 | { |
777 | update(in.data(), int(in.length())); | 776 | update(in.data(), int(in.length())); |
778 | } | 777 | } |
779 | 778 | ||
780 | void KMD5::update(const unsigned char* in, int len) | 779 | void KMD5::update(const unsigned char* in, int len) |
781 | { | 780 | { |
@@ -870,13 +869,13 @@ void KMD5::finalize () | |||
870 | bool KMD5::verify( const KMD5::Digest& digest) | 869 | bool KMD5::verify( const KMD5::Digest& digest) |
871 | { | 870 | { |
872 | finalize(); | 871 | finalize(); |
873 | return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest))); | 872 | return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest))); |
874 | } | 873 | } |
875 | 874 | ||
876 | bool KMD5::verify( const QCString& hexdigest) | 875 | bool KMD5::verify( const Q3CString& hexdigest) |
877 | { | 876 | { |
878 | finalize(); | 877 | finalize(); |
879 | return (0 == strcmp(hexDigest().data(), hexdigest)); | 878 | return (0 == strcmp(hexDigest().data(), hexdigest)); |
880 | } | 879 | } |
881 | 880 | ||
882 | const KMD5::Digest& KMD5::rawDigest() | 881 | const KMD5::Digest& KMD5::rawDigest() |
@@ -889,36 +888,36 @@ void KMD5::rawDigest( KMD5::Digest& bin ) | |||
889 | { | 888 | { |
890 | finalize(); | 889 | finalize(); |
891 | memcpy( bin, m_digest, 16 ); | 890 | memcpy( bin, m_digest, 16 ); |
892 | } | 891 | } |
893 | 892 | ||
894 | 893 | ||
895 | QCString KMD5::hexDigest() | 894 | Q3CString KMD5::hexDigest() |
896 | { | 895 | { |
897 | QCString s(33); | 896 | Q3CString s(33); |
898 | 897 | ||
899 | finalize(); | 898 | finalize(); |
900 | sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", | 899 | sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", |
901 | m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5], | 900 | m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5], |
902 | m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11], | 901 | m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11], |
903 | m_digest[12], m_digest[13], m_digest[14], m_digest[15]); | 902 | m_digest[12], m_digest[13], m_digest[14], m_digest[15]); |
904 | 903 | ||
905 | return s; | 904 | return s; |
906 | } | 905 | } |
907 | 906 | ||
908 | void KMD5::hexDigest(QCString& s) | 907 | void KMD5::hexDigest(Q3CString& s) |
909 | { | 908 | { |
910 | finalize(); | 909 | finalize(); |
911 | s.resize(33); | 910 | s.resize(33); |
912 | sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", | 911 | sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", |
913 | m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5], | 912 | m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5], |
914 | m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11], | 913 | m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11], |
915 | m_digest[12], m_digest[13], m_digest[14], m_digest[15]); | 914 | m_digest[12], m_digest[13], m_digest[14], m_digest[15]); |
916 | } | 915 | } |
917 | 916 | ||
918 | QCString KMD5::base64Digest() | 917 | Q3CString KMD5::base64Digest() |
919 | { | 918 | { |
920 | QByteArray ba(16); | 919 | QByteArray ba(16); |
921 | 920 | ||
922 | finalize(); | 921 | finalize(); |
923 | memcpy(ba.data(), m_digest, 16); | 922 | memcpy(ba.data(), m_digest, 16); |
924 | return KCodecs::base64Encode(ba); | 923 | return KCodecs::base64Encode(ba); |
@@ -953,13 +952,13 @@ void KMD5::transform( const unsigned char block[64] ) | |||
953 | Q_UINT32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16]; | 952 | Q_UINT32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16]; |
954 | 953 | ||
955 | decode (x, block, 64); | 954 | decode (x, block, 64); |
956 | //memcpy( x, block, 64 ); | 955 | //memcpy( x, block, 64 ); |
957 | 956 | ||
958 | //US Q_ASSERT(!m_finalized); // not just a user error, since the method is private | 957 | //US Q_ASSERT(!m_finalized); // not just a user error, since the method is private |
959 | ASSERT(!m_finalized); // not just a user error, since the method is private | 958 | Q_ASSERT(!m_finalized); // not just a user error, since the method is private |
960 | 959 | ||
961 | /* Round 1 */ | 960 | /* Round 1 */ |
962 | FF (a, b, c, d, x[ 0], KMD5_S11, 0xd76aa478); /* 1 */ | 961 | FF (a, b, c, d, x[ 0], KMD5_S11, 0xd76aa478); /* 1 */ |
963 | FF (d, a, b, c, x[ 1], KMD5_S12, 0xe8c7b756); /* 2 */ | 962 | FF (d, a, b, c, x[ 1], KMD5_S12, 0xe8c7b756); /* 2 */ |
964 | FF (c, d, a, b, x[ 2], KMD5_S13, 0x242070db); /* 3 */ | 963 | FF (c, d, a, b, x[ 2], KMD5_S13, 0x242070db); /* 3 */ |
965 | FF (b, c, d, a, x[ 3], KMD5_S14, 0xc1bdceee); /* 4 */ | 964 | 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 @@ | |||
36 | 36 | ||
37 | #define KBase64 KCodecs | 37 | #define KBase64 KCodecs |
38 | 38 | ||
39 | #include <qglobal.h> | 39 | #include <qglobal.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | #include <qiodevice.h> | 41 | #include <qiodevice.h> |
42 | //Added by qt3to4: | ||
43 | #include <Q3CString> | ||
42 | 44 | ||
43 | /** | 45 | /** |
44 | * A wrapper class for the most commonly used encoding and | 46 | * A wrapper class for the most commonly used encoding and |
45 | * decoding algorithms. Currently there is support for encoding | 47 | * decoding algorithms. Currently there is support for encoding |
46 | * and decoding input using base64, uu and the quoted-printable | 48 | * and decoding input using base64, uu and the quoted-printable |
47 | * specifications. | 49 | * specifications. |
@@ -78,13 +80,13 @@ public: | |||
78 | * @param in data to be encoded. | 80 | * @param in data to be encoded. |
79 | * @param useCRLF if true the input data is expected to have | 81 | * @param useCRLF if true the input data is expected to have |
80 | * CRLF line breaks and the output will have CRLF line | 82 | * CRLF line breaks and the output will have CRLF line |
81 | * breaks, too. | 83 | * breaks, too. |
82 | * @return quoted-printable encoded data. | 84 | * @return quoted-printable encoded data. |
83 | */ | 85 | */ |
84 | static QCString quotedPrintableEncode(const QByteArray & in, | 86 | static Q3CString quotedPrintableEncode(const QByteArray & in, |
85 | bool useCRLF = true); | 87 | bool useCRLF = true); |
86 | 88 | ||
87 | /** | 89 | /** |
88 | * @overload | 90 | * @overload |
89 | * | 91 | * |
90 | * Same as above except it accepts a null terminated | 92 | * Same as above except it accepts a null terminated |
@@ -93,13 +95,13 @@ public: | |||
93 | * @param str data to be encoded. | 95 | * @param str data to be encoded. |
94 | * @param useCRLF if true the input data is expected to have | 96 | * @param useCRLF if true the input data is expected to have |
95 | * CRLF line breaks and the output will have CRLF line | 97 | * CRLF line breaks and the output will have CRLF line |
96 | * breaks, too. | 98 | * breaks, too. |
97 | * @return quoted-printable encoded data. | 99 | * @return quoted-printable encoded data. |
98 | */ | 100 | */ |
99 | static QCString quotedPrintableEncode(const QCString & str, | 101 | static Q3CString quotedPrintableEncode(const Q3CString & str, |
100 | bool useCRLF = true); | 102 | bool useCRLF = true); |
101 | 103 | ||
102 | /** | 104 | /** |
103 | * Encodes the given data using the quoted-printable algorithm. | 105 | * Encodes the given data using the quoted-printable algorithm. |
104 | * | 106 | * |
105 | * Use this function if you want the result of the encoding | 107 | * Use this function if you want the result of the encoding |
@@ -126,24 +128,24 @@ public: | |||
126 | * | 128 | * |
127 | * Accepts data with CRLF or standard unix line breaks. | 129 | * Accepts data with CRLF or standard unix line breaks. |
128 | * | 130 | * |
129 | * @param in the data to be decoded. | 131 | * @param in the data to be decoded. |
130 | * @return decoded data. | 132 | * @return decoded data. |
131 | */ | 133 | */ |
132 | static QCString quotedPrintableDecode(const QByteArray & in); | 134 | static Q3CString quotedPrintableDecode(const QByteArray & in); |
133 | 135 | ||
134 | /** | 136 | /** |
135 | * @overload | 137 | * @overload |
136 | * | 138 | * |
137 | * Same as above except it accepts a null terminated | 139 | * Same as above except it accepts a null terminated |
138 | * string instead an array. | 140 | * string instead an array. |
139 | * | 141 | * |
140 | * @param str the data to be decoded. | 142 | * @param str the data to be decoded. |
141 | * @return decoded data. | 143 | * @return decoded data. |
142 | */ | 144 | */ |
143 | static QCString quotedPrintableDecode(const QCString & str); | 145 | static Q3CString quotedPrintableDecode(const Q3CString & str); |
144 | 146 | ||
145 | /** | 147 | /** |
146 | * Decodes a quoted-printable encoded data. | 148 | * Decodes a quoted-printable encoded data. |
147 | * | 149 | * |
148 | * Accepts data with CRLF or standard unix line breaks. | 150 | * Accepts data with CRLF or standard unix line breaks. |
149 | * Use this function if you want the result of the decoding | 151 | * Use this function if you want the result of the decoding |
@@ -172,24 +174,24 @@ public: | |||
172 | * line is longer than 45 octets (60 characters), excluding the | 174 | * line is longer than 45 octets (60 characters), excluding the |
173 | * line terminator. | 175 | * line terminator. |
174 | * | 176 | * |
175 | * @param in the data to be uuencoded | 177 | * @param in the data to be uuencoded |
176 | * @return a uuencoded data. | 178 | * @return a uuencoded data. |
177 | */ | 179 | */ |
178 | static QCString uuencode( const QByteArray& in ); | 180 | static Q3CString uuencode( const QByteArray& in ); |
179 | 181 | ||
180 | /** | 182 | /** |
181 | * @overload | 183 | * @overload |
182 | * | 184 | * |
183 | * Same as the above functions except it accepts | 185 | * Same as the above functions except it accepts |
184 | * a null terminated string instead an array. | 186 | * a null terminated string instead an array. |
185 | * | 187 | * |
186 | * @param str the string to be uuencoded. | 188 | * @param str the string to be uuencoded. |
187 | * @return the encoded string. | 189 | * @return the encoded string. |
188 | */ | 190 | */ |
189 | static QCString uuencode( const QCString& str ); | 191 | static Q3CString uuencode( const Q3CString& str ); |
190 | 192 | ||
191 | /** | 193 | /** |
192 | * Encodes the given data using the uuencode algorithm. | 194 | * Encodes the given data using the uuencode algorithm. |
193 | * | 195 | * |
194 | * Use this function if you want the result of the encoding | 196 | * Use this function if you want the result of the encoding |
195 | * to be placed in another array and cut down the number of | 197 | * to be placed in another array and cut down the number of |
@@ -212,24 +214,24 @@ public: | |||
212 | * the utilities in unix and unix-like OS will be | 214 | * the utilities in unix and unix-like OS will be |
213 | * automatically ignored. | 215 | * automatically ignored. |
214 | * | 216 | * |
215 | * @param in the data uuencoded data to be decoded. | 217 | * @param in the data uuencoded data to be decoded. |
216 | * @return a decoded string. | 218 | * @return a decoded string. |
217 | */ | 219 | */ |
218 | static QCString uudecode( const QByteArray& in ); | 220 | static Q3CString uudecode( const QByteArray& in ); |
219 | 221 | ||
220 | /** | 222 | /** |
221 | * @overload | 223 | * @overload |
222 | * | 224 | * |
223 | * Same as the above functions except it accepts | 225 | * Same as the above functions except it accepts |
224 | * a null terminated string instead an array. | 226 | * a null terminated string instead an array. |
225 | * | 227 | * |
226 | * @param str the string to be decoded. | 228 | * @param str the string to be decoded. |
227 | * @return a uudecoded string. | 229 | * @return a uudecoded string. |
228 | */ | 230 | */ |
229 | static QCString uudecode( const QCString& str ); | 231 | static Q3CString uudecode( const Q3CString& str ); |
230 | 232 | ||
231 | /** | 233 | /** |
232 | * Decodes the given data using the uudecode algorithm. | 234 | * Decodes the given data using the uudecode algorithm. |
233 | * | 235 | * |
234 | * Use this function if you want the result of the decoding | 236 | * Use this function if you want the result of the decoding |
235 | * to be placed in another array which cuts down the number | 237 | * to be placed in another array which cuts down the number |
@@ -260,25 +262,25 @@ public: | |||
260 | * | 262 | * |
261 | * @param in the data to be encoded. | 263 | * @param in the data to be encoded. |
262 | * @param insertLFs limit the number of characters per line. | 264 | * @param insertLFs limit the number of characters per line. |
263 | * | 265 | * |
264 | * @return a base64 encoded string. | 266 | * @return a base64 encoded string. |
265 | */ | 267 | */ |
266 | static QCString base64Encode( const QByteArray& in, bool insertLFs = false); | 268 | static Q3CString base64Encode( const QByteArray& in, bool insertLFs = false); |
267 | 269 | ||
268 | /** | 270 | /** |
269 | * @overload | 271 | * @overload |
270 | * | 272 | * |
271 | * Same as the above functions except it accepts | 273 | * Same as the above functions except it accepts |
272 | * a null terminated string instead an array. | 274 | * a null terminated string instead an array. |
273 | * | 275 | * |
274 | * @param str the string to be encoded. | 276 | * @param str the string to be encoded. |
275 | * @param insertLFs limit the number of characters per line. | 277 | * @param insertLFs limit the number of characters per line. |
276 | * @return the decoded string. | 278 | * @return the decoded string. |
277 | */ | 279 | */ |
278 | static QCString base64Encode( const QCString& str, bool insertLFs = false ); | 280 | static Q3CString base64Encode( const Q3CString& str, bool insertLFs = false ); |
279 | 281 | ||
280 | /** | 282 | /** |
281 | * Encodes the given data using the base64 algorithm. | 283 | * Encodes the given data using the base64 algorithm. |
282 | * | 284 | * |
283 | * Use this function if you want the result of the encoding | 285 | * Use this function if you want the result of the encoding |
284 | * to be placed in another array which cuts down the number | 286 | * to be placed in another array which cuts down the number |
@@ -305,24 +307,24 @@ public: | |||
305 | * Decodes the given data that was encoded using the | 307 | * Decodes the given data that was encoded using the |
306 | * base64 algorithm. | 308 | * base64 algorithm. |
307 | * | 309 | * |
308 | * @param in the base64-encoded data to be decoded. | 310 | * @param in the base64-encoded data to be decoded. |
309 | * @return the decoded data. | 311 | * @return the decoded data. |
310 | */ | 312 | */ |
311 | static QCString base64Decode( const QByteArray& in ); | 313 | static Q3CString base64Decode( const QByteArray& in ); |
312 | 314 | ||
313 | /** | 315 | /** |
314 | * @overload | 316 | * @overload |
315 | * | 317 | * |
316 | * Same as the above functions except it accepts | 318 | * Same as the above functions except it accepts |
317 | * a null terminated string instead an array. | 319 | * a null terminated string instead an array. |
318 | * | 320 | * |
319 | * @param str the base64-encoded string. | 321 | * @param str the base64-encoded string. |
320 | * @return the decoded string. | 322 | * @return the decoded string. |
321 | */ | 323 | */ |
322 | static QCString base64Decode( const QCString& str ); | 324 | static Q3CString base64Decode( const Q3CString& str ); |
323 | 325 | ||
324 | /** | 326 | /** |
325 | * Decodes the given data that was encoded with the base64 | 327 | * Decodes the given data that was encoded with the base64 |
326 | * algorithm. | 328 | * algorithm. |
327 | * | 329 | * |
328 | * Use this function if you want the result of the decoding | 330 | * Use this function if you want the result of the decoding |
@@ -428,13 +430,13 @@ public: | |||
428 | 430 | ||
429 | /** | 431 | /** |
430 | * @overload | 432 | * @overload |
431 | * | 433 | * |
432 | * Same as above except it accepts a QByteArray as its argument. | 434 | * Same as above except it accepts a QByteArray as its argument. |
433 | */ | 435 | */ |
434 | KMD5(const QCString& a ); | 436 | KMD5(const Q3CString& a ); |
435 | 437 | ||
436 | /** | 438 | /** |
437 | * Updates the message to be digested. Be sure to add all data | 439 | * Updates the message to be digested. Be sure to add all data |
438 | * before you read the digest. After reading the digest, you | 440 | * before you read the digest. After reading the digest, you |
439 | * can <b>not</b> add more data! | 441 | * can <b>not</b> add more data! |
440 | * | 442 | * |
@@ -457,13 +459,13 @@ public: | |||
457 | 459 | ||
458 | /** | 460 | /** |
459 | * @overload | 461 | * @overload |
460 | * | 462 | * |
461 | * @param in message to be added to the digest (QByteArray). | 463 | * @param in message to be added to the digest (QByteArray). |
462 | */ | 464 | */ |
463 | void update(const QCString& in ); | 465 | void update(const Q3CString& in ); |
464 | 466 | ||
465 | /** | 467 | /** |
466 | * @overload | 468 | * @overload |
467 | * | 469 | * |
468 | * reads the data from an I/O device, i.e. from a file (QFile). | 470 | * reads the data from an I/O device, i.e. from a file (QFile). |
469 | * | 471 | * |
@@ -499,35 +501,35 @@ public: | |||
499 | void rawDigest( KMD5::Digest& bin ); | 501 | void rawDigest( KMD5::Digest& bin ); |
500 | 502 | ||
501 | /** | 503 | /** |
502 | * Returns the value of the calculated message digest in | 504 | * Returns the value of the calculated message digest in |
503 | * a hexadecimal representation. | 505 | * a hexadecimal representation. |
504 | */ | 506 | */ |
505 | QCString hexDigest (); | 507 | Q3CString hexDigest (); |
506 | 508 | ||
507 | /** | 509 | /** |
508 | * @overload | 510 | * @overload |
509 | */ | 511 | */ |
510 | void hexDigest(QCString&); | 512 | void hexDigest(Q3CString&); |
511 | 513 | ||
512 | /** | 514 | /** |
513 | * Returns the value of the calculated message digest in | 515 | * Returns the value of the calculated message digest in |
514 | * a base64-encoded representation. | 516 | * a base64-encoded representation. |
515 | */ | 517 | */ |
516 | QCString base64Digest (); | 518 | Q3CString base64Digest (); |
517 | 519 | ||
518 | /** | 520 | /** |
519 | * returns true if the calculated digest for the given | 521 | * returns true if the calculated digest for the given |
520 | * message matches the given one. | 522 | * message matches the given one. |
521 | */ | 523 | */ |
522 | bool verify( const KMD5::Digest& digest); | 524 | bool verify( const KMD5::Digest& digest); |
523 | 525 | ||
524 | /** | 526 | /** |
525 | * @overload | 527 | * @overload |
526 | */ | 528 | */ |
527 | bool verify(const QCString&); | 529 | bool verify(const Q3CString&); |
528 | 530 | ||
529 | protected: | 531 | protected: |
530 | /** | 532 | /** |
531 | * Performs the real update work. Note | 533 | * Performs the real update work. Note |
532 | * that length is implied to be 64. | 534 | * that length is implied to be 64. |
533 | */ | 535 | */ |
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 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include <qcolor.h> | 23 | #include <qcolor.h> |
24 | //Added by qt3to4: | ||
25 | #include <Q3ValueList> | ||
24 | 26 | ||
25 | #include <kconfig.h> | 27 | #include <kconfig.h> |
26 | #include <kstandarddirs.h> | 28 | #include <kstandarddirs.h> |
27 | #include <kglobal.h> | 29 | #include <kglobal.h> |
28 | #include <kdebug.h> | 30 | #include <kdebug.h> |
29 | 31 | ||
@@ -137,23 +139,23 @@ class KPrefsItemStringList : public KPrefsItem { | |||
137 | QStringList mDefault; | 139 | QStringList mDefault; |
138 | }; | 140 | }; |
139 | 141 | ||
140 | 142 | ||
141 | class KPrefsItemIntList : public KPrefsItem { | 143 | class KPrefsItemIntList : public KPrefsItem { |
142 | public: | 144 | public: |
143 | KPrefsItemIntList(const QString &group,const QString &name,QValueList<int> *, | 145 | KPrefsItemIntList(const QString &group,const QString &name,Q3ValueList<int> *, |
144 | const QValueList<int> &defaultValue=QValueList<int>()); | 146 | const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); |
145 | virtual ~KPrefsItemIntList() {} | 147 | virtual ~KPrefsItemIntList() {} |
146 | 148 | ||
147 | void setDefault(); | 149 | void setDefault(); |
148 | void readConfig(KConfig *); | 150 | void readConfig(KConfig *); |
149 | void writeConfig(KConfig *); | 151 | void writeConfig(KConfig *); |
150 | 152 | ||
151 | private: | 153 | private: |
152 | QValueList<int> *mReference; | 154 | Q3ValueList<int> *mReference; |
153 | QValueList<int> mDefault; | 155 | Q3ValueList<int> mDefault; |
154 | }; | 156 | }; |
155 | 157 | ||
156 | 158 | ||
157 | KPrefsItemBool::KPrefsItemBool(const QString &group,const QString &name, | 159 | KPrefsItemBool::KPrefsItemBool(const QString &group,const QString &name, |
158 | bool *reference,bool defaultValue) : | 160 | bool *reference,bool defaultValue) : |
159 | KPrefsItem(group,name) | 161 | KPrefsItem(group,name) |
@@ -361,13 +363,13 @@ void KPrefsItemStringList::readConfig(KConfig *config) | |||
361 | config->setGroup(mGroup); | 363 | config->setGroup(mGroup); |
362 | *mReference = config->readListEntry(mName); | 364 | *mReference = config->readListEntry(mName); |
363 | } | 365 | } |
364 | 366 | ||
365 | 367 | ||
366 | KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name, | 368 | KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name, |
367 | QValueList<int> *reference,const QValueList<int> &defaultValue) : | 369 | Q3ValueList<int> *reference,const Q3ValueList<int> &defaultValue) : |
368 | KPrefsItem(group,name) | 370 | KPrefsItem(group,name) |
369 | { | 371 | { |
370 | mReference = reference; | 372 | mReference = reference; |
371 | mDefault = defaultValue; | 373 | mDefault = defaultValue; |
372 | } | 374 | } |
373 | 375 | ||
@@ -502,11 +504,11 @@ void KPrefs::addItemPassword(const QString &key,QString *reference,const QString | |||
502 | void KPrefs::addItemStringList(const QString &key,QStringList *reference, | 504 | void KPrefs::addItemStringList(const QString &key,QStringList *reference, |
503 | const QStringList &defaultValue) | 505 | const QStringList &defaultValue) |
504 | { | 506 | { |
505 | addItem(new KPrefsItemStringList(*mCurrentGroup,key,reference,defaultValue)); | 507 | addItem(new KPrefsItemStringList(*mCurrentGroup,key,reference,defaultValue)); |
506 | } | 508 | } |
507 | 509 | ||
508 | void KPrefs::addItemIntList(const QString &key,QValueList<int> *reference, | 510 | void KPrefs::addItemIntList(const QString &key,Q3ValueList<int> *reference, |
509 | const QValueList<int> &defaultValue) | 511 | const Q3ValueList<int> &defaultValue) |
510 | { | 512 | { |
511 | addItem(new KPrefsItemIntList(*mCurrentGroup,key,reference,defaultValue)); | 513 | addItem(new KPrefsItemIntList(*mCurrentGroup,key,reference,defaultValue)); |
512 | } | 514 | } |
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 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef _KPREFS_H | 20 | #ifndef _KPREFS_H |
21 | #define _KPREFS_H | 21 | #define _KPREFS_H |
22 | // $Id$ | 22 | // $Id$ |
23 | 23 | ||
24 | #include <qptrlist.h> | 24 | #include <q3ptrlist.h> |
25 | #include <qcolor.h> | 25 | #include <qcolor.h> |
26 | #include <qfont.h> | 26 | #include <qfont.h> |
27 | #include <qsize.h> | 27 | #include <qsize.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | //Added by qt3to4: | ||
30 | #include <Q3ValueList> | ||
29 | 31 | ||
30 | class KConfig; | 32 | class KConfig; |
31 | 33 | ||
32 | /** | 34 | /** |
33 | @short Class for storing a preferences setting | 35 | @short Class for storing a preferences setting |
34 | @author Cornelius Schumacher | 36 | @author Cornelius Schumacher |
@@ -280,14 +282,14 @@ class KPrefs { | |||
280 | @param reference Pointer to the variable, which is set by readConfig() | 282 | @param reference Pointer to the variable, which is set by readConfig() |
281 | and setDefaults() calls and read by writeConfig() calls. | 283 | and setDefaults() calls and read by writeConfig() calls. |
282 | @param defaultValue Default value, which is used by setDefaults() and | 284 | @param defaultValue Default value, which is used by setDefaults() and |
283 | when the config file does not yet contain the key of | 285 | when the config file does not yet contain the key of |
284 | this item. | 286 | this item. |
285 | */ | 287 | */ |
286 | void addItemIntList(const QString &key,QValueList<int> *reference, | 288 | void addItemIntList(const QString &key,Q3ValueList<int> *reference, |
287 | const QValueList<int> &defaultValue=QValueList<int>()); | 289 | const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); |
288 | 290 | ||
289 | protected: | 291 | protected: |
290 | /** | 292 | /** |
291 | Implemented by subclasses that use special defaults. | 293 | Implemented by subclasses that use special defaults. |
292 | */ | 294 | */ |
293 | virtual void usrSetDefaults() {}; | 295 | virtual void usrSetDefaults() {}; |
@@ -307,10 +309,10 @@ class KPrefs { | |||
307 | 309 | ||
308 | private: | 310 | private: |
309 | static QString *mCurrentGroup; | 311 | static QString *mCurrentGroup; |
310 | 312 | ||
311 | KConfig *mConfig; // pointer to KConfig object | 313 | KConfig *mConfig; // pointer to KConfig object |
312 | 314 | ||
313 | QPtrList<KPrefsItem> mItems; | 315 | Q3PtrList<KPrefsItem> mItems; |
314 | }; | 316 | }; |
315 | 317 | ||
316 | #endif | 318 | #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 | |||
560 | /** | 560 | /** |
561 | * Creates a new shortcut with the given Qt key code | 561 | * Creates a new shortcut with the given Qt key code |
562 | * as the only key sequence. | 562 | * as the only key sequence. |
563 | * @param keyQt the qt keycode | 563 | * @param keyQt the qt keycode |
564 | * @see Qt::Key | 564 | * @see Qt::Key |
565 | */ | 565 | */ |
566 | KShortcut( int keyQt ) {} | 566 | KShortcut( int /*keyQt */) {} |
567 | 567 | ||
568 | /** | 568 | /** |
569 | * Creates a new shortcut that contains only the given qt key | 569 | * Creates a new shortcut that contains only the given qt key |
570 | * sequence. | 570 | * sequence. |
571 | * @param keySeq the qt key sequence to add | 571 | * @param keySeq the qt key sequence to add |
572 | */ | 572 | */ |
@@ -596,22 +596,22 @@ class KShortcut | |||
596 | * Creates a new key sequence that contains the given key sequence. | 596 | * Creates a new key sequence that contains the given key sequence. |
597 | * The description consists of semicolon-separated keys as | 597 | * The description consists of semicolon-separated keys as |
598 | * used in @ref KKeySequence::KKeySequence(const QString&). | 598 | * used in @ref KKeySequence::KKeySequence(const QString&). |
599 | * @param shortcut the description of the key | 599 | * @param shortcut the description of the key |
600 | * @see KKeySequence::KKeySequence(const QString&) | 600 | * @see KKeySequence::KKeySequence(const QString&) |
601 | */ | 601 | */ |
602 | KShortcut( const char* shortcut ) {} | 602 | KShortcut( const char* /*shortcut */) {} |
603 | 603 | ||
604 | /** | 604 | /** |
605 | * Creates a new key sequence that contains the given key sequence. | 605 | * Creates a new key sequence that contains the given key sequence. |
606 | * The description consists of semicolon-separated keys as | 606 | * The description consists of semicolon-separated keys as |
607 | * used in @ref KKeySequence::KKeySequence(const QString&). | 607 | * used in @ref KKeySequence::KKeySequence(const QString&). |
608 | * @param shortcut the description of the key | 608 | * @param shortcut the description of the key |
609 | * @see KKeySequence::KKeySequence(const QString&) | 609 | * @see KKeySequence::KKeySequence(const QString&) |
610 | */ | 610 | */ |
611 | KShortcut( const QString& shortcut ) {} | 611 | KShortcut( const QString& /*shortcut */) {} |
612 | ~KShortcut() {} | 612 | ~KShortcut() {} |
613 | 613 | ||
614 | /** | 614 | /** |
615 | * Clears the shortcut. The shortcut is null after calling this | 615 | * Clears the shortcut. The shortcut is null after calling this |
616 | * function. | 616 | * function. |
617 | * @see isNull() | 617 | * @see isNull() |
@@ -813,13 +813,13 @@ class KShortcut | |||
813 | */ | 813 | */ |
814 | //USQString toString() const; | 814 | //USQString toString() const; |
815 | 815 | ||
816 | /** | 816 | /** |
817 | * @internal | 817 | * @internal |
818 | */ | 818 | */ |
819 | QString toStringInternal( const KShortcut* pcutDefault = 0 ) const | 819 | QString toStringInternal( const KShortcut* /*pcutDefault*/ = 0 ) const |
820 | { | 820 | { |
821 | return "EMPTY IMPL."; | 821 | return "EMPTY IMPL."; |
822 | } | 822 | } |
823 | 823 | ||
824 | /** | 824 | /** |
825 | * Returns a null shortcut. | 825 | * 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 @@ | |||
34 | //US #endif | 34 | //US #endif |
35 | //US#include <sys/types.h> | 35 | //US#include <sys/types.h> |
36 | //US#include <dirent.h> | 36 | //US#include <dirent.h> |
37 | //US#include <pwd.h> | 37 | //US#include <pwd.h> |
38 | 38 | ||
39 | #include <qregexp.h> | 39 | #include <qregexp.h> |
40 | #include <qasciidict.h> | 40 | #include <q3asciidict.h> |
41 | #include <qdict.h> | 41 | #include <q3dict.h> |
42 | #include <qdir.h> | 42 | #include <qdir.h> |
43 | #include <qfileinfo.h> | 43 | #include <qfileinfo.h> |
44 | #include <qstring.h> | 44 | #include <qstring.h> |
45 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
46 | #include <qapplication.h> | 46 | #include <qapplication.h> |
47 | 47 | ||
48 | #include <qstringlist.h> | 48 | #include <qstringlist.h> |
49 | //Added by qt3to4: | ||
50 | #include <Q3CString> | ||
49 | 51 | ||
50 | #include "kstandarddirs.h" | 52 | #include "kstandarddirs.h" |
51 | #include "kconfig.h" | 53 | #include "kconfig.h" |
52 | #include "kdebug.h" | 54 | #include "kdebug.h" |
53 | //US #include "kinstance.h" | 55 | //US #include "kinstance.h" |
54 | #include "kshell.h" | 56 | #include "kshell.h" |
@@ -56,21 +58,21 @@ | |||
56 | //US#include <unistd.h> | 58 | //US#include <unistd.h> |
57 | 59 | ||
58 | //US | 60 | //US |
59 | QString KStandardDirs::mAppDir = QString::null; | 61 | QString KStandardDirs::mAppDir = QString::null; |
60 | 62 | ||
61 | 63 | ||
62 | template class QDict<QStringList>; | 64 | template class Q3Dict<QStringList>; |
63 | 65 | ||
64 | #if 0 | 66 | #if 0 |
65 | #include <qtextedit.h> | 67 | #include <q3textedit.h> |
66 | void ddd( QString op ) | 68 | void ddd( QString op ) |
67 | { | 69 | { |
68 | static QTextEdit * dot = 0; | 70 | static Q3TextEdit * dot = 0; |
69 | if ( ! dot ) | 71 | if ( ! dot ) |
70 | dot = new QTextEdit(); | 72 | dot = new Q3TextEdit(); |
71 | 73 | ||
72 | dot->show(); | 74 | dot->show(); |
73 | 75 | ||
74 | dot->append( op ); | 76 | dot->append( op ); |
75 | 77 | ||
76 | } | 78 | } |
@@ -82,13 +84,13 @@ public: | |||
82 | : restrictionsActive(false), | 84 | : restrictionsActive(false), |
83 | dataRestrictionActive(false) | 85 | dataRestrictionActive(false) |
84 | { } | 86 | { } |
85 | 87 | ||
86 | bool restrictionsActive; | 88 | bool restrictionsActive; |
87 | bool dataRestrictionActive; | 89 | bool dataRestrictionActive; |
88 | QAsciiDict<bool> restrictions; | 90 | Q3AsciiDict<bool> restrictions; |
89 | QStringList xdgdata_prefixes; | 91 | QStringList xdgdata_prefixes; |
90 | QStringList xdgconf_prefixes; | 92 | QStringList xdgconf_prefixes; |
91 | }; | 93 | }; |
92 | 94 | ||
93 | static const char* const types[] = {"html", "icon", "apps", "sound", | 95 | static const char* const types[] = {"html", "icon", "apps", "sound", |
94 | "data", "locale", "services", "mime", | 96 | "data", "locale", "services", "mime", |
@@ -442,13 +444,13 @@ static void lookupDirectory(const QString& path, const QString &relPart, | |||
442 | 444 | ||
443 | /*US | 445 | /*US |
444 | if (!recursive && !regexp.exactMatch(fn)) | 446 | if (!recursive && !regexp.exactMatch(fn)) |
445 | continue; // No match | 447 | continue; // No match |
446 | */ | 448 | */ |
447 | //US this should do the same: | 449 | //US this should do the same: |
448 | int pos = regexp.match(fn); | 450 | int pos = regexp.exactMatch(fn); |
449 | if (!recursive && !pos == 0) | 451 | if (!recursive && !pos == 0) |
450 | continue; // No match | 452 | continue; // No match |
451 | 453 | ||
452 | QString pathfn = path + fn; | 454 | QString pathfn = path + fn; |
453 | /*US | 455 | /*US |
454 | if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) { | 456 | if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) { |
@@ -479,13 +481,13 @@ static void lookupDirectory(const QString& path, const QString &relPart, | |||
479 | 481 | ||
480 | /*US | 482 | /*US |
481 | if (!regexp.exactMatch(fn)) | 483 | if (!regexp.exactMatch(fn)) |
482 | continue; // No match | 484 | continue; // No match |
483 | */ | 485 | */ |
484 | //US this should do the same: | 486 | //US this should do the same: |
485 | pos = regexp.match(fn); | 487 | pos = regexp.exactMatch(fn); |
486 | if (!pos == 0) | 488 | if (!pos == 0) |
487 | continue; // No match | 489 | continue; // No match |
488 | } | 490 | } |
489 | 491 | ||
490 | //US if ( S_ISREG( buff.st_mode)) | 492 | //US if ( S_ISREG( buff.st_mode)) |
491 | if ( pathfnInfo.isFile()) | 493 | if ( pathfnInfo.isFile()) |
@@ -1105,13 +1107,13 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) | |||
1105 | 1107 | ||
1106 | while( i < len ) | 1108 | while( i < len ) |
1107 | { | 1109 | { |
1108 | //US struct stat st; | 1110 | //US struct stat st; |
1109 | int pos = target.find('/', i); | 1111 | int pos = target.find('/', i); |
1110 | base += target.mid(i - 1, pos - i + 1); | 1112 | base += target.mid(i - 1, pos - i + 1); |
1111 | QCString baseEncoded = QFile::encodeName(base); | 1113 | Q3CString baseEncoded = QFile::encodeName(base); |
1112 | // bail out if we encountered a problem | 1114 | // bail out if we encountered a problem |
1113 | //US if (stat(baseEncoded, &st) != 0) | 1115 | //US if (stat(baseEncoded, &st) != 0) |
1114 | QFileInfo baseEncodedInfo(baseEncoded); | 1116 | QFileInfo baseEncodedInfo(baseEncoded); |
1115 | if (!baseEncodedInfo.exists()) | 1117 | if (!baseEncodedInfo.exists()) |
1116 | { | 1118 | { |
1117 | // Directory does not exist.... | 1119 | // Directory does not exist.... |
@@ -1205,13 +1207,13 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) | |||
1205 | 1207 | ||
1206 | QString readEnvPath(const char *env) | 1208 | QString readEnvPath(const char *env) |
1207 | { | 1209 | { |
1208 | //#ifdef _WIN32_ | 1210 | //#ifdef _WIN32_ |
1209 | // return ""; | 1211 | // return ""; |
1210 | //#else | 1212 | //#else |
1211 | QCString c_path; | 1213 | Q3CString c_path; |
1212 | if ( getenv(env) != NULL ) | 1214 | if ( getenv(env) != NULL ) |
1213 | c_path = QString ( getenv(env) ); | 1215 | c_path = QString ( getenv(env) ); |
1214 | if (c_path.isEmpty()) | 1216 | if (c_path.isEmpty()) |
1215 | return QString::null; | 1217 | return QString::null; |
1216 | return QFile::decodeName(c_path); | 1218 | return QFile::decodeName(c_path); |
1217 | //#endif | 1219 | //#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 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef SSK_KSTDDIRS_H | 23 | #ifndef SSK_KSTDDIRS_H |
24 | #define SSK_KSTDDIRS_H | 24 | #define SSK_KSTDDIRS_H |
25 | 25 | ||
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qdict.h> | 27 | #include <q3dict.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | 30 | ||
31 | class KConfig; | 31 | class KConfig; |
32 | class KStandardDirsPrivate; | 32 | class KStandardDirsPrivate; |
33 | 33 | ||
@@ -571,17 +571,17 @@ public: | |||
571 | 571 | ||
572 | private: | 572 | private: |
573 | 573 | ||
574 | QStringList prefixes; | 574 | QStringList prefixes; |
575 | 575 | ||
576 | // Directory dictionaries | 576 | // Directory dictionaries |
577 | QDict<QStringList> absolutes; | 577 | Q3Dict<QStringList> absolutes; |
578 | QDict<QStringList> relatives; | 578 | Q3Dict<QStringList> relatives; |
579 | 579 | ||
580 | mutable QDict<QStringList> dircache; | 580 | mutable Q3Dict<QStringList> dircache; |
581 | mutable QDict<QString> savelocations; | 581 | mutable Q3Dict<QString> savelocations; |
582 | 582 | ||
583 | // Disallow assignment and copy-construction | 583 | // Disallow assignment and copy-construction |
584 | KStandardDirs( const KStandardDirs& ); | 584 | KStandardDirs( const KStandardDirs& ); |
585 | KStandardDirs& operator= ( const KStandardDirs& ); | 585 | KStandardDirs& operator= ( const KStandardDirs& ); |
586 | 586 | ||
587 | bool addedCustoms; | 587 | bool addedCustoms; |