Commit 81081262 authored by Dāvis Mosāns's avatar Dāvis Mosāns
Browse files

Cleanup headers, remove header dependency on KDELibs4Support

REVIEW: 123158
parent d33afdbd
......@@ -16,23 +16,13 @@
#include "variablewidget.h"
#include <QApplication>
#include <QLabel>
#include <QLayout>
#include <QPainter>
#include <QPushButton>
#include <QRegExp>
#include <QCursor>
#include <QHBoxLayout>
#include <QClipboard>
#include <QKeyEvent>
#include <QFocusEvent>
#include <QVBoxLayout>
#include <QMenu>
#include <QPoint>
#include <QClipboard>
#include <QVBoxLayout>
#include <kmessagebox.h>
#include <khistorycombobox.h>
#include <QLineEdit>
#include <KHistoryComboBox>
#include <KLocalizedString>
#include "../../interfaces/icore.h"
......
......@@ -16,11 +16,9 @@
#ifndef KDEVPLATFORM_VARIABLEWIDGET_H
#define KDEVPLATFORM_VARIABLEWIDGET_H
#include <QTreeView>
#include <QAction>
#include <QSignalMapper>
#include <KComboBox>
#include <QTreeView>
#include <debugger/debuggerexport.h>
#include "../util/treeview.h"
......
......@@ -19,14 +19,16 @@
#include "ipartcontroller.h"
#include <QFile>
#include <kservice.h>
#include <kmimetypetrader.h>
#include <kparts/part.h>
#include <kparts/readonlypart.h>
#include <KMimeTypeTrader>
#include <KParts/Part>
#include <KParts/ReadOnlyPart>
#include <KService>
namespace KDevelop {
IPartController::IPartController( QWidget* toplevel )
IPartController::IPartController( QWidget* toplevel )
: KParts::PartManager( toplevel, 0 )
{
}
......@@ -62,7 +64,7 @@ KPluginFactory* IPartController::findPartFactory ( const QString& mimetype, cons
KPluginLoader loader( QFile::encodeName( ptr->library() ) );
return loader.factory();
}
return 0;
}
......
......@@ -29,10 +29,11 @@
#include "iplugin.h"
#include <kmainwindow.h>
#include <kxmlguiwindow.h>
#include <kxmlguifactory.h>
#include <kactioncollection.h>
#include <KActionCollection>
#include <KMainWindow>
#include <KXmlGuiWindow>
#include <KXMLGUIFactory>
#include "icore.h"
#include "iplugincontroller.h"
#include "iprojectcontroller.h"
......
......@@ -37,7 +37,7 @@
#include <ktexteditor/view.h>
#include <ktexteditor/document.h>
#include <klocalizedstring.h>
#include <KLocalizedString>
using namespace KDevelop;
......
......@@ -24,17 +24,13 @@
#include "backgroundparser.h"
#include <QList>
#include <QFile>
#include <QTimer>
#include <QMutex>
#include <QWaitCondition>
#include <QMutexLocker>
#include <QThread>
#include <QPointer>
#include <QCoreApplication>
#include <QTimer>
#include <kconfiggroup.h>
#include <ksharedconfig.h>
#include <KConfigGroup>
#include <KSharedConfig>
#include <KLocalizedString>
#include <ktexteditor/document.h>
......
......@@ -22,27 +22,23 @@
#include <ktexteditor/document.h>
#include <ktexteditor/view.h>
#include <kparts/part.h>
#include <KMimeTypeTrader>
#include <QAction>
#include <QDialogButtonBox>
#include <QDir>
#include <QTabWidget>
#include <KMimeTypeTrader>
#include <QLabel>
#include <QMimeType>
#include <QMimeDatabase>
#include <QBoxLayout>
#include <QLayout>
#include <QSplitter>
#include <QLabel>
#include <QPushButton>
#include <QSplitter>
#include <QTemporaryFile>
#include <QTabWidget>
#include <QVBoxLayout>
#include "coderepresentation.h"
#include <interfaces/icore.h>
#include <interfaces/idocumentcontroller.h>
#include <QTemporaryFile>
#include <KActionCollection>
#include <QAction>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QVBoxLayout>
namespace KDevelop
{
......
......@@ -23,10 +23,11 @@
#include <QAction>
// KDE / KDevelop
#include <KMessageBox>
#include <KParts/MainWindow>
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <kmessagebox.h>
#include <interfaces/icore.h>
#include <interfaces/idocument.h>
#include <interfaces/iuicontroller.h>
......
......@@ -22,6 +22,7 @@
#include "documentchangeset.h"
#include "duchainchangeset.h"
#include <QTimer>
#include <KLocalizedString>
#include <interfaces/icore.h>
......@@ -29,7 +30,6 @@
#include <language/duchain/duchainlock.h>
#include <qtimer.h>
#include "applychangeswidget.h"
#include "util/debug.h"
......
......@@ -17,8 +17,10 @@
*/
#include "coderepresentation.h"
#include <QtCore/qfile.h>
#include <QFile>
#include <KTextEditor/Document>
#include <serialization/indexedstring.h>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/icore.h>
......@@ -27,23 +29,23 @@
#include <ktexteditor/configinterface.h>
namespace KDevelop {
static bool onDiskChangesForbidden = false;
QString CodeRepresentation::rangeText(const KTextEditor::Range& range) const
{
Q_ASSERT(range.end().line() < lines());
//Easier for single line ranges which should happen most of the time
if(range.onSingleLine())
return QString( line( range.start().line() ).mid( range.start().column(), range.columnWidth() ) );
//Add up al the requested lines
QString rangedText = line(range.start().line()).mid(range.start().column());
for(int i = range.start().line() + 1; i <= range.end().line(); ++i)
rangedText += '\n' + ((i == range.end().line()) ? line(i).left(range.end().column()) : line(i));
return rangedText;
}
......@@ -61,7 +63,7 @@ static void grepLine(const QString& identifier, const QString& lineText, int lin
int start = pos;
pos += identifier.length();
int end = pos;
if(!surroundedByBoundary || ( (end == lineText.length() || !lineText[end].isLetterOrNumber() || lineText[end] != '_')
&& (start-1 < 0 || !lineText[start-1].isLetterOrNumber() || lineText[start-1] != '_')) )
{
......@@ -75,7 +77,7 @@ class EditorCodeRepresentation : public DynamicCodeRepresentation {
EditorCodeRepresentation(KTextEditor::Document* document) : m_document(document) {
m_url = IndexedString(m_document->url());
}
virtual QVector< KTextEditor::Range > grep ( const QString& identifier, bool surroundedByBoundary ) const override {
QVector< KTextEditor::Range > ret;
......@@ -91,21 +93,21 @@ class EditorCodeRepresentation : public DynamicCodeRepresentation {
virtual KDevEditingTransaction::Ptr makeEditTransaction() override {
return KDevEditingTransaction::Ptr(new KDevEditingTransaction(m_document));
}
QString line(int line) const override {
if(line < 0 || line >= m_document->lines())
return QString();
return m_document->line(line);
}
virtual int lines() const override {
return m_document->lines();
}
QString text() const override {
return m_document->text();
}
bool setText(const QString& text) override {
bool ret;
{
......@@ -115,11 +117,11 @@ class EditorCodeRepresentation : public DynamicCodeRepresentation {
ModificationRevision::clearModificationCache(m_url);
return ret;
}
bool fileExists() override{
return QFile(m_document->url().path()).exists();
}
bool replace(const KTextEditor::Range& range, const QString& oldText,
const QString& newText, bool ignoreOldText) override {
QString old = m_document->text(range);
......@@ -137,11 +139,11 @@ class EditorCodeRepresentation : public DynamicCodeRepresentation {
return ret;
}
virtual QString rangeText(const KTextEditor::Range& range) const override {
return m_document->text(range);
}
private:
KTextEditor::Document* m_document;
IndexedString m_url;
......@@ -151,7 +153,7 @@ class FileCodeRepresentation : public CodeRepresentation {
public:
FileCodeRepresentation(const IndexedString& document) : m_document(document) {
QString localFile(document.toUrl().toLocalFile());
QFile file( localFile );
if ( file.open(QIODevice::ReadOnly) ) {
data = QString::fromLocal8Bit(file.readAll());
......@@ -159,14 +161,14 @@ class FileCodeRepresentation : public CodeRepresentation {
}
m_exists = file.exists();
}
QString line(int line) const override {
if(line < 0 || line >= lineData.size())
return QString();
return lineData.at(line);
}
virtual QVector< KTextEditor::Range > grep ( const QString& identifier, bool surroundedByBoundary ) const override {
QVector< KTextEditor::Range > ret;
......@@ -178,15 +180,15 @@ class FileCodeRepresentation : public CodeRepresentation {
return ret;
}
virtual int lines() const override {
return lineData.count();
}
QString text() const override {
return data;
}
bool setText(const QString& text) override {
Q_ASSERT(!onDiskChangesForbidden);
QString localFile(m_document.toUrl().toLocalFile());
......@@ -195,7 +197,7 @@ class FileCodeRepresentation : public CodeRepresentation {
if ( file.open(QIODevice::WriteOnly) )
{
QByteArray data = text.toLocal8Bit();
if(file.write(data) == data.size())
{
ModificationRevision::clearModificationCache(m_document);
......@@ -204,11 +206,11 @@ class FileCodeRepresentation : public CodeRepresentation {
}
return false;
}
bool fileExists() override{
return m_exists;
}
private:
//We use QByteArray, because the column-numbers are measured in utf-8
IndexedString m_document;
......@@ -232,7 +234,7 @@ class ArtificialStringData : public QSharedData {
const QStringList& lines() const {
return m_lineData;
}
private:
QString m_data;
QStringList m_lineData;
......@@ -243,31 +245,31 @@ class StringCodeRepresentation : public CodeRepresentation {
StringCodeRepresentation(QExplicitlySharedDataPointer<ArtificialStringData> _data) : data(_data) {
Q_ASSERT(data);
}
QString line(int line) const override {
if(line < 0 || line >= data->lines().size())
return QString();
return data->lines().at(line);
}
virtual int lines() const override {
return data->lines().count();
}
QString text() const override {
return data->data();
}
bool setText(const QString& text) override {
data->setData(text);
return true;
}
bool fileExists() override{
return false;
}
virtual QVector< KTextEditor::Range > grep ( const QString& identifier, bool surroundedByBoundary ) const override {
QVector< KTextEditor::Range > ret;
......@@ -279,7 +281,7 @@ class StringCodeRepresentation : public CodeRepresentation {
return ret;
}
private:
QExplicitlySharedDataPointer<ArtificialStringData> data;
};
......@@ -336,7 +338,7 @@ InsertArtificialCodeRepresentation::InsertArtificialCodeRepresentation(const Ind
if(QUrl(m_file.str()).isRelative())
{
m_file = IndexedString(CodeRepresentation::artificialPath(file.str()));
int idx = 0;
while(artificialStrings.contains(m_file))
{
......@@ -344,7 +346,7 @@ InsertArtificialCodeRepresentation::InsertArtificialCodeRepresentation(const Ind
m_file = IndexedString(CodeRepresentation::artificialPath(QStringLiteral("%1_%2").arg(idx).arg(file.str())));
}
}
Q_ASSERT(!artificialStrings.contains(m_file));
artificialStrings.insert(m_file, QExplicitlySharedDataPointer<ArtificialStringData>(new ArtificialStringData(text)));
......
......@@ -31,11 +31,12 @@
#include <grantlee/context.h>
#include <QUrl>
#include <KArchive>
#include <QDebug>
#include <QFile>
#include <QDir>
#include <QFile>
#include <QUrl>
#include <KArchive>
using namespace Grantlee;
......
......@@ -19,10 +19,10 @@
#include "abstractnavigationwidget.h"
#include <QtCore/QMap>
#include <QtCore/QMetaObject>
#include <QApplication>
#include <QVBoxLayout>
#include <QMetaObject>
#include <QScrollBar>
#include <QBoxLayout>
#include <QTextBrowser>
#include <KLocalizedString>
......@@ -32,8 +32,6 @@
#include "../duchain.h"
#include "../duchainlock.h"
#include "util/debug.h"
#include <qapplication.h>
#include <qevent.h>
namespace KDevelop {
......
......@@ -23,12 +23,12 @@
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QWidget>
#include <QWheelEvent>
#include "../../interfaces/quickopendataprovider.h"
#include <language/languageexport.h>
#include "abstractnavigationcontext.h"
class QWidget;
class QTextBrowser;
namespace KDevelop {
......@@ -45,9 +45,9 @@ namespace KDevelop {
virtual ~AbstractNavigationWidget();
void setContext(NavigationContextPointer context, int initBrowser = 400);
QSize sizeHint() const override;
public slots:
///Keyboard-action "next"
virtual void next() override;
......@@ -68,7 +68,7 @@ namespace KDevelop {
void embeddedWidgetAccept();
void embeddedWidgetUp();
void embeddedWidgetDown();
NavigationContextPointer context();
Q_SIGNALS:
......
/*
Copyright 2009 David Nolden <david.nolden.kdevelop@art-master.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
......@@ -18,16 +18,16 @@
#include "problemnavigationcontext.h"
#include <klocalizedstring.h>
#include <QHBoxLayout>
#include <QMenu>
#include <KLocalizedString>
#include <language/duchain/declaration.h>
#include <language/duchain/duchainlock.h>
#include <language/duchain/duchainutils.h>
#include <language/duchain/problem.h>
#include <qtextdocument.h>
#include <qboxlayout.h>
#include <interfaces/iassistant.h>
#include <QMenu>
#include <QAction>
#include <util/richtextpushbutton.h>
using namespace KDevelop;
......
......@@ -19,22 +19,24 @@
#include "useswidget.h"
#include "util/debug.h"
#include <language/duchain/duchainlock.h>
#include <language/duchain/duchain.h>
#include <language/duchain/uses.h>
#include <QVBoxLayout>
#include <QIcon>
#include <QLabel>
#include <QProgressBar>
#include <klocalizedstring.h>
#include <QResizeEvent>
#include <QToolButton>
#include <QVBoxLayout>
#include <KLocalizedString>
#include <language/duchain/duchainlock.h>
#include <language/duchain/duchain.h>
#include <language/duchain/uses.h>
#include <language/duchain/declaration.h>
#include <language/duchain/use.h>
#include <QIcon>
#include <interfaces/icore.h>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/iprojectcontroller.h>
#include <qtextdocument.h>
#include <QResizeEvent>
#include <language/duchain/duchainutils.h>
#include <language/codegen/coderepresentation.h>
#include <interfaces/iproject.h>
......
......@@ -41,7 +41,7 @@ struct HashHasher {
// #define DEFINE_PERSISTENT_SET_MAP(key, data, hasher, ) \
// typedef TemporaryDataManager<KDevVarLengthArray<type, 10> > temporaryHash ## container ## member ## Type; \
// K_GLOBAL_STATIC_WITH_ARGS(temporaryHash ## container ## member ## Type, temporaryHash ## container ## member ## Static, ( #container "::" #member )) \
// Q_GLOBAL_STATIC_WITH_ARGS(temporaryHash ## container ## member ## Type, temporaryHash ## container ## member ## Static, ( #container "::" #member )) \
// temporaryHash ## container ## member ## Type& temporaryHash ## container ## member() { \
// return *temporaryHash ## container ## member ## Static; \
// }
......
......@@ -26,9 +26,7 @@
#include <QAction>
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kaboutdata.h>
#include <KPluginFactory>
#include "interfaces/icore.h"
#include "interfaces/iuicontroller.h"
......