Commit ec809d58 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Remove unused/unneeded includes & forward declarations

Summary:
Some people play Sudoku on the train, others play
Gredelbuil (grep, remove, build), i.e. manually cleaning up
includes and forward declarations which are not needed

Done by primitive grepping for Q/K* class names and
* removing any includes whose class does not have instances
  by a quick look in implementations in the same file
* using forward declarations instead of includes for classes
  whe possible, unless a template class (because the latter
  is quite verbose as forward declarations, the include
  nicer to read)
* removing any forward declarations which are not used in the
  same file
(one day a bot/script will steal my game and beat me, o tempores)

WRT effects on dependent code, at least kdevelop will need one or
two adaptions due to changed include visibility. That is done as
part of a similar clean-up patch, which will be either directly
pushed or also passed through review, as you prefer.

Reviewers: #kdevelop, apol

Reviewed By: #kdevelop, apol

Subscribers: apol, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D5071
parent dfd348ed
......@@ -24,8 +24,8 @@
#include <QIcon>
#include <QPixmap>
#include <QTimer>
#include <KParts/PartManager>
#include <KLocalizedString>
#include <KTextEditor/Document>
#include <ktexteditor/movinginterface.h>
......@@ -40,7 +40,6 @@
#include <interfaces/isession.h>
#include "util/debug.h"
#include "breakpoint.h"
#include <KConfigCore/KSharedConfig>
#include <KConfigGroup>
#include <QAction>
#include <QMenu>
......
......@@ -24,8 +24,7 @@
#include <QIcon>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QSplitter>
#include <QVBoxLayout>
#include <QTreeView>
#include <QHeaderView>
#include <QMenu>
......
......@@ -29,10 +29,8 @@
class QAbstractProxyModel;
class QModelIndex;
class QItemSelection;
class QTreeView;
class QMenu;
class QSplitter;
namespace KDevelop {
class IDebugController;
......
......@@ -22,7 +22,6 @@
#define KDEVPLATFORM_FRAMESTACKMODEL_H
#include <QtCore/QModelIndex>
#include <QtCore/QHash>
#include <debugger/debuggerexport.h>
#include <debugger/interfaces/idebugsession.h>
......
......@@ -35,7 +35,6 @@
#include <QApplication>
#include <QClipboard>
#include <QIcon>
#include <QResizeEvent>
#include <QAction>
#include <KStandardAction>
......
......@@ -33,7 +33,6 @@
#include "../breakpoint/breakpoint.h"
#include "../breakpoint/breakpointmodel.h"
class QModelIndex;
namespace KDevelop {
class IDebugSession;
......
......@@ -23,8 +23,6 @@
#include "ivariablecontroller.h"
#include "util/debug.h"
#include <QApplication>
#include <QWidget>
#include <QFileInfo>
......
......@@ -24,7 +24,6 @@
#include <debugger/debuggerexport.h>
#include <QtCore/QObject>
#include <QtCore/QAbstractItemModel>
#include <QUrl>
namespace KDevelop {
......
......@@ -26,8 +26,6 @@
#include "idebugsession.h"
class QString;
namespace KTextEditor {
class Document;
class Cursor;
......
......@@ -24,7 +24,6 @@
#include <QAbstractTableModel>
#include <QVBoxLayout>
#include <QLabel>
#include <QTableView>
#include <QHeaderView>
#include <QAction>
......
......@@ -21,7 +21,6 @@
#include "treeitem.h"
#include <QStringList>
#include <QModelIndex>
#include "debug.h"
......
......@@ -22,9 +22,7 @@
#ifndef KDEVPLATFORM_TREEITEM_H
#define KDEVPLATFORM_TREEITEM_H
#include <QtCore/QList>
#include <QtCore/QVariant>
#include <QtCore/QTimer>
#include <QtCore/QVector>
#include <QIcon>
......
......@@ -21,8 +21,6 @@
#include "treemodel.h"
//#include <QtGui>
#include <iostream>
#include "treeitem.h"
......
......@@ -31,7 +31,6 @@
#include <KTextEditor/TextHintInterface>
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <KParts/PartManager>
#include "../../interfaces/icore.h"
#include "../../interfaces/idocumentcontroller.h"
......
......@@ -24,8 +24,6 @@
#ifndef KDEVPLATFORM_VARIABLECOLLECTION_H
#define KDEVPLATFORM_VARIABLECOLLECTION_H
#include <QtCore/QAbstractItemModel>
#include <QtCore/QMap>
#include <QtCore/QPointer>
#include <KLocalizedString>
......
......@@ -25,8 +25,6 @@
#include <QCollator>
#include <QSortFilterProxyModel>
class QModelIndex;
namespace KDevelop
{
......
......@@ -24,13 +24,9 @@
#include <QWidget>
#include <QHBoxLayout>
#include <QTreeView>
#include <QApplication>
#include <QEvent>
#include <QStandardItemModel>
#include <QMouseEvent>
#include <QHeaderView>
#include <QLabel>
#include <QPushButton>
#include <QScrollBar>
#include <QSignalMapper>
......
......@@ -26,11 +26,8 @@
#include "../../util/activetooltip.h"
#include "../util/treeview.h"
#include <QPoint>
class QItemSelectionModel;
class QString;
class QResizeEvent;
class QSortFilterProxyModel;
namespace KDevelop
......
......@@ -16,9 +16,10 @@
#include "variablewidget.h"
#include <QApplication>
#include <QAction>
#include <QCursor>
#include <QClipboard>
#include <QKeyEvent>
#include <QContextMenuEvent>
#include <QMenu>
#include <QVBoxLayout>
......
......@@ -16,9 +16,7 @@
#ifndef KDEVPLATFORM_VARIABLEWIDGET_H
#define KDEVPLATFORM_VARIABLEWIDGET_H
#include <QAction>
#include <QSignalMapper>
#include <QTreeView>
#include <debugger/debuggerexport.h>
#include "../util/treeview.h"
......@@ -26,6 +24,8 @@
class KHistoryComboBox;
class QSortFilterProxyModel;
class QAction;
namespace KDevelop
{
......
......@@ -22,15 +22,13 @@
#include <QAction>
#include <QIcon>
#include <QVBoxLayout>
#include <QLabel>
#include <QComboBox>
#include <QTextEdit>
#include <QCompleter>
#include <QLayout>
#include <QTextBrowser>
#include <QAbstractItemView>
#include <QLineEdit>
#include <KToolBar>
#include <KLocalizedString>
#include <interfaces/icore.h>
......
......@@ -22,7 +22,6 @@
#include <QWidget>
#include <QAbstractListModel>
#include <KToolBar>
#include <interfaces/idocumentation.h>
#include "documentationexport.h"
......@@ -35,6 +34,7 @@ class QModelIndex;
class QLineEdit;
class ProvidersModel;
class QComboBox;
class KToolBar;
class KDEVPLATFORMDOCUMENTATION_EXPORT DocumentationView : public QWidget
{
......
......@@ -20,8 +20,8 @@
*/
#include "configpage.h"
#include <QIcon>
#include <QVBoxLayout>
#include <KConfigDialogManager>
#include <KCoreConfigSkeleton>
namespace KDevelop {
......
......@@ -22,12 +22,12 @@
#define KDEVELOP_CONFIGPAGE_H
#include <KTextEditor/ConfigPage>
#include <KCoreConfigSkeleton>
#include <KConfigDialogManager>
#include <KLocalizedString>
#include "interfacesexport.h"
class KCoreConfigSkeleton;
namespace KDevelop {
class IPlugin;
......
......@@ -29,8 +29,8 @@ Boston, MA 02110-1301, USA.
#include "context.h"
#include <QDir>
#include <QList>
#include <QMimeType>
#include <ktexteditor/document.h>
......
......@@ -33,10 +33,9 @@ Boston, MA 02110-1301, USA.
#include "interfacesexport.h"
#include <QStringList>
#include <QMimeType>
#include <QUrl>
class QMimeType;
template <typename T> class QList;
namespace KDevelop
......
......@@ -28,7 +28,6 @@
class QAction;
class QMenu;
template <typename T> class QList;
namespace KDevelop
{
......
......@@ -20,8 +20,6 @@
#include "icore.h"
#include <QAction>
#include <QXmlStreamReader>
#include <QTextEdit>
#include <QThread>
using namespace KDevelop;
......
......@@ -19,7 +19,6 @@
#ifndef KDEVPLATFORM_IASSISTANT_H
#define KDEVPLATFORM_IASSISTANT_H
#include <QtCore/QPointer>
#include <QIcon>
#include <QExplicitlySharedDataPointer>
#include "interfacesexport.h"
......
......@@ -20,7 +20,6 @@
#ifndef KDEVPLATFORM_IBUDDYDOCUMENTFINDER_H
#define KDEVPLATFORM_IBUDDYDOCUMENTFINDER_H
#include <QObject>
#include <QVector>
#include <QUrl>
......
......@@ -19,8 +19,6 @@
#include "icompletionsettings.h"
#include <QtCore/QStringList>
namespace KDevelop {
ICompletionSettings::~ICompletionSettings() {
}
......
......@@ -28,11 +28,6 @@ Boston, MA 02110-1301, USA.
class KAboutData;
namespace KParts
{
class PartManager;
}
/**
* The KDevelop namespace contains all classes provided by the KDevelop
* platform libraries.
......
......@@ -18,7 +18,6 @@
*/
#include "idocumentation.h"
#include <qtextbrowser.h>
namespace KDevelop
{
......
......@@ -20,7 +20,6 @@
#ifndef KDEVPLATFORM_IDOCUMENTATIONPROVIDER_H
#define KDEVPLATFORM_IDOCUMENTATIONPROVIDER_H
#include <QtCore/QObject>
#include "interfacesexport.h"
#include "idocumentation.h"
......
......@@ -20,7 +20,6 @@
#ifndef KDEVPLATFORM_IDOCUMENTATIONPROVIDERPROVIDER_H
#define KDEVPLATFORM_IDOCUMENTATIONPROVIDERPROVIDER_H
#include <QExplicitlySharedDataPointer>
#include <QtCore/QObject>
#include "interfacesexport.h"
......
......@@ -18,8 +18,6 @@
***************************************************************************/
#include "ipartcontroller.h"
#include <QFile>
#include <KMimeTypeTrader>
#include <KParts/Part>
#include <KParts/ReadOnlyPart>
......
......@@ -25,11 +25,6 @@
class KPluginFactory;
namespace KParts
{
class Factory;
}
namespace KTextEditor
{
class Editor;
......
......@@ -24,7 +24,6 @@
#define KDEVPLATFORM_IPLUGIN_H
#include <QtCore/QObject>
#include <QtCore/QVector>
#include <KXMLGUIClient>
......
......@@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA.
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QVariant>
#include <KPluginMetaData>
......
......@@ -22,7 +22,6 @@
#define IPROBLEM_H
#include <QExplicitlySharedDataPointer>
#include <QString>
#include <QVector>
#include <language/editor/documentrange.h>
......
......@@ -26,8 +26,6 @@
#include "iproject.h"
#include <QtDBus/QtDBus>
namespace KDevelop
{
......
......@@ -28,7 +28,6 @@
#define KDEVPLATFORM_IPROJECT_H
#include <QtCore/QObject>
#include <QUrl>
#include <KSharedConfig>
......
......@@ -27,8 +27,6 @@ Boston, MA 02110-1301, USA.
#include "interfacesexport.h"
class QItemSelectionModel;
namespace KDevelop
{
......
......@@ -21,7 +21,6 @@
#ifndef KDEVPLATFORM_IPROJECTPROVIDER_H
#define KDEVPLATFORM_IPROJECTPROVIDER_H
#include <QString>
#include <QWidget>
#include "interfacesexport.h"
......
......@@ -20,8 +20,6 @@ Boston, MA 02110-1301, USA.
#ifndef KDEVPLATFORM_IRUNCONTROLLER_H
#define KDEVPLATFORM_IRUNCONTROLLER_H
#include <QtCore/QObject>
#include <kjobtrackerinterface.h>
#include "interfacesexport.h"
......
......@@ -19,7 +19,9 @@
#include "isourceformatter.h"
#include <KLocalizedString>
#include <QVariant>
#include <QMimeType>
namespace KDevelop
{
......
......@@ -20,12 +20,12 @@
#define KDEVPLATFORM_ISOURCEFORMATTER_H
#include <QWidget>
#include <QStringList>
#include <QMimeType>
#include "interfacesexport.h"
class QUrl;
class QMimeType;
class QStringList;
namespace KDevelop
{
......
......@@ -21,12 +21,12 @@ Boston, MA 02110-1301, USA.
#ifndef KDEVPLATFORM_ISOURCEFORMATTERCONTROLLER_H
#define KDEVPLATFORM_ISOURCEFORMATTERCONTROLLER_H
#include <QMimeType>
#include <QObject>
#include "interfacesexport.h"
class QUrl;
class QMimeType;
namespace KDevelop
{
......
......@@ -25,9 +25,9 @@
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtCore/QStringList>
#include <QString>
class KJob;
class QStringList;
namespace KDevelop {
......
......@@ -22,9 +22,9 @@
#include "interfacesexport.h"
#include <QtCore/QStringList>
class KJob;
class QString;
class QStringList;
namespace KDevelop {
......
......@@ -21,14 +21,10 @@
#include "interfacesexport.h"
#include <QtCore/QStringList>
#include <QWidget>
class QAction;
template<class T>
class QExplicitlySharedDataPointer;
namespace KParts {
class MainWindow;
}
......
......@@ -22,12 +22,12 @@
#include "interfacesexport.h"
#include <QStringList>
#include <QObject>
class QMenu;
class QIcon;
class QUrl;
class QStringList;
class KConfigGroup;
namespace KDevelop
......
......@@ -21,8 +21,6 @@
#include <interfaces/icodehighlighting.h>
#include "util/debug.h"
#include <QTimer>
#include <KTextEditor/Document>
#include <KTextEditor/View>
......
......@@ -34,8 +34,6 @@
#include <ktexteditor/range.h>
#include <ktexteditor/cursor.h>
class QTimer;
typedef QPointer<KTextEditor::Document> SafeDocumentPointer;