diff --git a/kdecore/kernel/kdbusconnectionpool.cpp b/kdecore/kernel/kdbusconnectionpool.cpp index 514ba7bb..3fff0697 100644 --- a/kdecore/kernel/kdbusconnectionpool.cpp +++ b/kdecore/kernel/kdbusconnectionpool.cpp @@ -20,7 +20,6 @@ */ #include "kdbusconnectionpool.h" -#include #include #include diff --git a/kdeui/itemviews/kvoidpointerfactory_p.h b/kdeui/itemviews/kvoidpointerfactory_p.h deleted file mode 100644 index 2d5f2c10..00000000 --- a/kdeui/itemviews/kvoidpointerfactory_p.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (C) 2010 Klarälvdalens Datakonsult AB, - a KDAB Group company, info@kdab.net, - author Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef KVOIDPOINTERFACTORY_P_H -#define KVOIDPOINTERFACTORY_P_H - -#include -#include -#include - -#define DEFAULT_BLOCK_SIZE 256 - -/** - * @brief A Class for managing void pointers for use in QModelIndexes. - * - * This class creates void pointers pointing to individual blocks of memory. - * The pointed-to memory contains zeros. - * - * Memory is allocated in blocks of size @p blockSize times sizeof(void*) at a time. The used - * memory is automatically freed and can be cleared manually. - * - * The void pointers should not be dereferenced, but only used as a unique - * identifier suitable for use with createIndex() and for comparison with other void pointers. - */ -template -class KVoidPointerFactory -{ - // a class with size 1. - class Bit { bool bit; }; - -public: - KVoidPointerFactory() - : m_previousPointer(0), - m_finalPointer(0) - { - } - - KVoidPointerFactory(const KVoidPointerFactory &other) - { - *this = other; - } - - KVoidPointerFactory& operator=(const KVoidPointerFactory &other) - { - m_previousPointer = other.m_previousPointer; - m_finalPointer = other.m_finalPointer; - m_blocks = other.m_blocks; - return *this; - } - - ~KVoidPointerFactory() - { - clear(); - } - - void clear() - { - typename std::vector::const_iterator it = m_blocks.begin(); - const typename std::vector::const_iterator end = m_blocks.end(); - for ( ; it != end; ++it) - { - free(*it); - } - m_blocks.clear(); - m_finalPointer = 0; - m_previousPointer = 0; - } - - void* createPointer() const - { - if (m_previousPointer == m_finalPointer) - { - static const std::size_t pointer_size = sizeof(Bit*); - Bit * const bit = static_cast(calloc(blockSize, pointer_size)); - m_blocks.push_back(bit); - m_finalPointer = bit + (blockSize * pointer_size) - 1; - m_previousPointer = bit; - return bit; - } - return ++m_previousPointer; - } - -private: - mutable std::vector m_blocks; - mutable Bit *m_previousPointer; - mutable Bit *m_finalPointer; -}; - -// Disable factory with 0 blockSize -template<> -class KVoidPointerFactory<0> -{ -public: - KVoidPointerFactory(); - - void clear(); - void* createPointer(); -}; - - -#endif diff --git a/kdeui/kernel/kapplication.h b/kdeui/kernel/kapplication.h index 075f7134..ef8f9c27 100644 --- a/kdeui/kernel/kapplication.h +++ b/kdeui/kernel/kapplication.h @@ -33,9 +33,6 @@ class KConfig; #include #endif -struct _IceConn; -#include - #define kapp KApplication::kApplication() class KApplicationPrivate; diff --git a/kioslave/http/kcookiejar/kcookieserver.h b/kioslave/http/kcookiejar/kcookieserver.h index a187d30b..0c973f00 100644 --- a/kioslave/http/kcookiejar/kcookieserver.h +++ b/kioslave/http/kcookiejar/kcookieserver.h @@ -26,13 +26,13 @@ #define KCOOKIESERVER_H #include -#include +#include #include +#include class KHttpCookieList; class KCookieJar; class KHttpCookie; -#include class RequestList; class KConfig;