diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 0f3bfdfc..bf11bb5e 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -188,8 +188,6 @@ check_function_exists(mkstemp HAVE_MKSTEMP) # kdecore/fakes.cpp check_function_exists(mkdtemp HAVE_MKDTEMP) # kdecore/fakes.cpp check_function_exists(strlcpy HAVE_STRLCPY) # kdecore/fakes.cpp check_function_exists(strlcat HAVE_STRLCAT) # kdecore/fakes.cpp -check_function_exists(strcasestr HAVE_STRCASESTR) # kdecore/fakes.cpp -check_symbol_exists(strcasestr string.h HAVE_STRCASESTR_PROTO) check_function_exists(setenv HAVE_SETENV) # kdecore/fakes.cpp check_function_exists(seteuid HAVE_SETEUID) # kdecore/fakes.cpp check_function_exists(setmntent HAVE_SETMNTENT) # solid, kio, kdecore diff --git a/config.h.cmake b/config.h.cmake index 66d04ca3..c376e4e4 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -68,7 +68,6 @@ #cmakedefine HAVE_SETMNTENT 1 #cmakedefine HAVE_STRLCPY 1 #cmakedefine HAVE_STRLCAT 1 -#cmakedefine HAVE_STRCASESTR 1 #cmakedefine HAVE_STRTOLL 1 #cmakedefine HAVE_UNSETENV 1 #cmakedefine HAVE_USLEEP 1 diff --git a/kdecore/auth/backends/dbus/DBusBackend.h b/kdecore/auth/backends/dbus/DBusBackend.h index 799d7b7f..0ec2c6c7 100644 --- a/kdecore/auth/backends/dbus/DBusBackend.h +++ b/kdecore/auth/backends/dbus/DBusBackend.h @@ -22,7 +22,7 @@ #include "AuthBackend.h" -class QByteArray; +#include namespace KAuth { diff --git a/kdecore/compression/kfilterbase.h b/kdecore/compression/kfilterbase.h index b4d10a82..02bae812 100644 --- a/kdecore/compression/kfilterbase.h +++ b/kdecore/compression/kfilterbase.h @@ -24,8 +24,6 @@ #include -class QIODevice; - /** * This is the base class for compression filters * such as gzip and bzip2. It's pretty much internal. diff --git a/kdecore/compression/kfilterdev.h b/kdecore/compression/kfilterdev.h index bbad5197..5da2b3b9 100644 --- a/kdecore/compression/kfilterdev.h +++ b/kdecore/compression/kfilterdev.h @@ -21,7 +21,6 @@ #include #include -class QFile; class KFilterBase; /** diff --git a/kdecore/fakes.cpp b/kdecore/fakes.cpp index fc544433..9c82a4dc 100644 --- a/kdecore/fakes.cpp +++ b/kdecore/fakes.cpp @@ -423,106 +423,6 @@ KDECORE_EXPORT unsigned long strlcat(char *dst, const char *src, unsigned long s } #endif /* !HAVE_STRLCAT */ -#ifndef HAVE_STRCASESTR -/* - * My personal strstr() implementation that beats most other algorithms. - * Until someone tells me otherwise, I assume that this is the - * fastest implementation of strstr() in C. - * I deliberately chose not to comment it. You should have at least - * as much fun trying to understand it, as I had to write it :-). - * - * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ - -#include - -KDECORE_EXPORT char *strcasestr (phaystack, pneedle) - const char *phaystack; - const char *pneedle; -{ - register const unsigned char *haystack, *needle; - register unsigned b, c; - - haystack = (const unsigned char *) phaystack; - needle = (const unsigned char *) pneedle; - - b = tolower (*needle); - if (b != '\0') - { - haystack--; /* possible ANSI violation */ - do - { - c = *++haystack; - if (c == '\0') - goto ret0; - } - while (tolower (c) != (int) b); - - c = tolower (*++needle); - if (c == '\0') - goto foundneedle; - ++needle; - goto jin; - - for (;;) - { - register unsigned a; - register const unsigned char *rhaystack, *rneedle; - - do - { - a = *++haystack; - if (a == '\0') - goto ret0; - if (tolower (a) == (int) b) - break; - a = *++haystack; - if (a == '\0') - goto ret0; -shloop: - ; - } - while (tolower (a) != (int) b); - -jin: a = *++haystack; - if (a == '\0') - goto ret0; - - if (tolower (a) != (int) c) - goto shloop; - - rhaystack = haystack-- + 1; - rneedle = needle; - a = tolower (*rneedle); - - if (tolower (*rhaystack) == (int) a) - do - { - if (a == '\0') - goto foundneedle; - ++rhaystack; - a = tolower (*++needle); - if (tolower (*rhaystack) != (int) a) - break; - if (a == '\0') - goto foundneedle; - ++rhaystack; - a = tolower (*++needle); - } - while (tolower (*rhaystack) == (int) a); - - needle = rneedle; /* took the register-poor approach */ - - if (a == '\0') - break; - } - } -foundneedle: - return (char*) haystack; -ret0: - return 0; -} -#endif /* !HAVE_STRCASESTR */ - #ifndef HAVE_TRUNC #include /* floor */ diff --git a/kdecore/io/kdirwatch.cpp b/kdecore/io/kdirwatch.cpp index 20d31bed..2d842651 100644 --- a/kdecore/io/kdirwatch.cpp +++ b/kdecore/io/kdirwatch.cpp @@ -429,7 +429,7 @@ bool KDirWatchPrivate::useQFSWatch(Entry* e) kDebug(7001) << "fsWatcher->addPath" << e->path; if (!fsWatcher) { - fsWatcher = new KFileSystemWatcher(); + fsWatcher = new QFileSystemWatcher(); connect(fsWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(fswEventReceived(QString))); connect(fsWatcher, SIGNAL(fileChanged(QString)), this, SLOT(fswEventReceived(QString))); } diff --git a/kdecore/io/kdirwatch_p.h b/kdecore/io/kdirwatch_p.h index 970cce8d..59517052 100644 --- a/kdecore/io/kdirwatch_p.h +++ b/kdecore/io/kdirwatch_p.h @@ -35,9 +35,6 @@ #include #include -class QFileSystemWatcher; -class QSocketNotifier; - #ifdef HAVE_FAM #include #include @@ -53,8 +50,6 @@ class QSocketNotifier; #ifndef QT_NO_FILESYSTEMWATCHER #include - -typedef QFileSystemWatcher KFileSystemWatcher; #endif /* KDirWatchPrivate is a singleton and does the watching @@ -188,7 +183,7 @@ public: #endif #ifndef QT_NO_FILESYSTEMWATCHER - KFileSystemWatcher *fsWatcher; + QFileSystemWatcher *fsWatcher; bool useQFSWatch(Entry* e); #endif diff --git a/kdecore/io/klockfile.h b/kdecore/io/klockfile.h index 91aaa6d3..a630d118 100644 --- a/kdecore/io/klockfile.h +++ b/kdecore/io/klockfile.h @@ -23,7 +23,7 @@ #include #include -class QString; +#include /** * \class KLockFile klockfile.h diff --git a/kdecore/io/kurl.h b/kdecore/io/kurl.h index a09ae0fb..8c8f7719 100644 --- a/kdecore/io/kurl.h +++ b/kdecore/io/kurl.h @@ -26,9 +26,8 @@ #include #include - -class QStringList; -class QMimeData; +#include +#include class KUrlPrivate; diff --git a/kdecore/kdefakes.h.cmake b/kdecore/kdefakes.h.cmake index 723485c3..516fa74f 100644 --- a/kdecore/kdefakes.h.cmake +++ b/kdecore/kdefakes.h.cmake @@ -27,10 +27,8 @@ You should include this file in any .cpp file that uses any one of these functions: strlcat, strlcpy, - strcasestr, setenv, unsetenv, usleep, initgroups, - random, srandom (this is for KRandom itself, prefer using KRandom in any other code) mkdtemp (this is for KTempDir itself, prefer using KTempDir everywhere else) mkstemp, mkstemps (prefer to use QTemporaryfile instead) trunc @@ -39,136 +37,59 @@ #cmakedefine HAVE_STRLCAT_PROTO 1 #if !defined(HAVE_STRLCAT_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -unsigned long strlcat(char*, const char*, unsigned long); -#ifdef __cplusplus -} -#endif +extern "C++" unsigned long strlcat(char*, const char*, unsigned long); #endif #cmakedefine HAVE_STRLCPY_PROTO 1 #if !defined(HAVE_STRLCPY_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -unsigned long strlcpy(char*, const char*, unsigned long); -#ifdef __cplusplus -} -#endif -#endif - -#cmakedefine HAVE_STRCASESTR_PROTO 1 -#if !defined(HAVE_STRCASESTR_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -char *strcasestr(const char *str1, const char *str2); -#ifdef __cplusplus -} -#endif +extern "C++" unsigned long strlcpy(char*, const char*, unsigned long); #endif #cmakedefine HAVE_SETENV_PROTO 1 #if !defined(HAVE_SETENV_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int setenv (const char *, const char *, int); -#ifdef __cplusplus -} -#endif +extern "C++" int setenv (const char *, const char *, int); #endif #cmakedefine HAVE_UNSETENV_PROTO 1 #if !defined(HAVE_UNSETENV_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int unsetenv (const char *); -#ifdef __cplusplus -} -#endif +extern "C++" int unsetenv (const char *); #endif #cmakedefine HAVE_USLEEP_PROTO 1 #if !defined(HAVE_USLEEP_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int usleep (unsigned int); -#ifdef __cplusplus -} -#endif +extern "C++" int usleep (unsigned int); #endif #cmakedefine HAVE_INITGROUPS_PROTO 1 #if !defined(HAVE_INITGROUPS_PROTO) #include -#ifdef __cplusplus -extern "C" { -#endif -int initgroups(const char *, gid_t); -#ifdef __cplusplus -} -#endif +extern "C++" int initgroups(const char *, gid_t); #endif #cmakedefine HAVE_MKDTEMP_PROTO 1 #if !defined(HAVE_MKDTEMP_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -char *mkdtemp(char *); -#ifdef __cplusplus -} -#endif +extern "C++" char *mkdtemp(char *); #endif #cmakedefine HAVE_MKSTEMPS_PROTO 1 #if !defined(HAVE_MKSTEMPS_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int mkstemps(char *, int); -#ifdef __cplusplus -} -#endif +extern "C++" int mkstemps(char *, int); #endif #cmakedefine HAVE_MKSTEMP_PROTO 1 #if !defined(HAVE_MKSTEMP_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int mkstemp(char *); -#ifdef __cplusplus -} -#endif +extern "C++" int mkstemp(char *); #endif #cmakedefine HAVE_TRUNC 1 #if !defined(HAVE_TRUNC) -#ifdef __cplusplus -extern "C" { -#endif -double trunc(double); -#ifdef __cplusplus -} -#endif +extern "C++" double trunc(double); #endif #cmakedefine HAVE_GETGROUPLIST 1 #if !defined(HAVE_GETGROUPLIST) #include /* for gid_t */ -#ifdef __cplusplus -extern "C" { -#endif -int getgrouplist(const char *, gid_t , gid_t *, int *); -#ifdef __cplusplus -} -#endif +extern "C++" int getgrouplist(const char *, gid_t , gid_t *, int *); #endif diff --git a/kdecore/kernel/kaboutdata.h b/kdecore/kernel/kaboutdata.h index f4799966..e8217f0f 100644 --- a/kdecore/kernel/kaboutdata.h +++ b/kdecore/kernel/kaboutdata.h @@ -28,8 +28,8 @@ #include #include -template class QList; -class QVariant; +#include + class KAboutData; /** diff --git a/kdecore/kernel/kcmdlineargs.h b/kdecore/kernel/kcmdlineargs.h index d5948ed7..ee3fe23d 100644 --- a/kdecore/kernel/kcmdlineargs.h +++ b/kdecore/kernel/kcmdlineargs.h @@ -21,13 +21,10 @@ #include -template class QList; -class QString; -class QStringList; -class QByteArray; -class QDataStream; -class KUrl; +#include +#include +class KUrl; class KCmdLineArgs; class KCmdLineArgsPrivate; class KCmdLineArgsStatic; diff --git a/kdecore/kernel/kcomponentdata.h b/kdecore/kernel/kcomponentdata.h index 72b7f1cf..a3dc0c7f 100644 --- a/kdecore/kernel/kcomponentdata.h +++ b/kdecore/kernel/kcomponentdata.h @@ -21,8 +21,6 @@ #include -class QByteArray; -class QString; class KAboutData; class KStandardDirs; class KComponentDataPrivate; diff --git a/kdecore/localization/klocale.h b/kdecore/localization/klocale.h index cad548cc..a92b7da3 100644 --- a/kdecore/localization/klocale.h +++ b/kdecore/localization/klocale.h @@ -24,16 +24,13 @@ #include #include -class QStringList; -class QTextCodec; -class QDate; -class QTime; -class QDateTime; +#include +#include +#include class KDateTime; class KCalendarSystem; class KCurrencyCode; - class KLocalePrivate; /** diff --git a/kdecore/services/kmimetype.cpp b/kdecore/services/kmimetype.cpp index d1264ff0..c7b55480 100644 --- a/kdecore/services/kmimetype.cpp +++ b/kdecore/services/kmimetype.cpp @@ -33,12 +33,13 @@ #include #include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include extern int servicesDebugArea(); diff --git a/kdecore/services/ktraderparse.cpp b/kdecore/services/ktraderparse.cpp index 34de906e..7c539d7c 100644 --- a/kdecore/services/ktraderparse.cpp +++ b/kdecore/services/ktraderparse.cpp @@ -32,8 +32,6 @@ void KTraderParse_mainParse( const char *_code ); #include #include -#include - namespace KTraderParse { diff --git a/kdecore/sycoca/ksycoca_p.h b/kdecore/sycoca/ksycoca_p.h index 905b8e41..50095cbd 100644 --- a/kdecore/sycoca/ksycoca_p.h +++ b/kdecore/sycoca/ksycoca_p.h @@ -23,8 +23,9 @@ #include "ksycocafactory.h" #include -class QFile; -class QDataStream; +#include +#include + class KSycocaAbstractDevice; class KSycocaPrivate diff --git a/kdecore/text/kstringhandler.h b/kdecore/text/kstringhandler.h index 34def334..6919778a 100644 --- a/kdecore/text/kstringhandler.h +++ b/kdecore/text/kstringhandler.h @@ -23,12 +23,9 @@ #include -#include - -class QChar; -class QRegExp; -class QString; -class QStringList; +#include +#include +#include /** * This namespace contains utility functions for handling strings. diff --git a/kdeui/kernel/kglobalsettings.h b/kdeui/kernel/kglobalsettings.h index 2dee7a23..dc7feb7a 100644 --- a/kdeui/kernel/kglobalsettings.h +++ b/kdeui/kernel/kglobalsettings.h @@ -21,7 +21,13 @@ #include #include #include +#include +#include #include +#include +#include +#include + #define KDE_DEFAULT_SINGLECLICK true #define KDE_DEFAULT_SMOOTHSCROLL true @@ -60,12 +66,6 @@ class KUrl; -class QColor; -class QFont; -class QPoint; -class QRect; -class QWidget; - /** * Access the KDE global configuration. *