Commit 8a58a2fe authored by Friedemann Kleint's avatar Friedemann Kleint

Header cleaning mainly in find/cpaster.

parent c750facb
......@@ -38,6 +38,9 @@
#include <coreplugin/messagemanager.h>
#include <coreplugin/messageoutputwindow.h>
#include <QtGui/QListWidget>
#include <QtNetwork/QNetworkReply>
using namespace CodePaster;
using namespace Core;
......
......@@ -32,10 +32,13 @@
#include "protocol.h"
#include <QtGui/QListWidget>
#include <QtNetwork/QHttp>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
QT_BEGIN_NAMESPACE
class QListWidget;
class QNetworkReply;
QT_END_NAMESPACE
namespace CodePaster {
......
......@@ -39,6 +39,7 @@
#include <QtGui/QGroupBox>
#include <QtGui/QFormLayout>
#include <QtGui/QVBoxLayout>
#include <QtGui/QLabel>
#include <QtCore/QDebug>
#include <QtCore/QVariant>
......
......@@ -30,14 +30,8 @@
#ifndef CODEPASTERSETTINGSPAGE_H
#define CODEPASTERSETTINGSPAGE_H
#include "ui_settingspage.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtCore/QStringList>
#include <QtCore/QUrl>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
......
......@@ -36,16 +36,15 @@
#include "codepasterprotocol.h"
#include "pastebindotcomprotocol.h"
#include "pastebindotcaprotocol.h"
#include "settingspage.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/filemanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/messageoutputwindow.h>
#include <coreplugin/uniqueidmanager.h>
#include <texteditor/itexteditor.h>
......@@ -55,9 +54,7 @@
#include <QtGui/QApplication>
#include <QtGui/QClipboard>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
#include <QtGui/QMainWindow>
#include <QtGui/QListWidget>
using namespace CodePaster;
using namespace Core;
......
......@@ -30,22 +30,18 @@
#ifndef CODEPASTERPLUGIN_H
#define CODEPASTERPLUGIN_H
#include "settingspage.h"
#include "protocol.h"
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icorelistener.h>
#include <extensionsystem/iplugin.h>
#include <QtCore/QObject>
#include <QtCore/QList>
QT_BEGIN_NAMESPACE
class QListWidget;
class QAction;
QT_END_NAMESPACE
namespace CodePaster {
class Protocol;
namespace CodePaster {
class SettingsPage;
class CustomFetcher;
class CustomPoster;
......
......@@ -30,6 +30,8 @@
#include "pastebindotcaprotocol.h"
#include "cgi.h"
#include <QtNetwork/QNetworkReply>
using namespace Core;
PasteBinDotCaProtocol::PasteBinDotCaProtocol()
......
......@@ -33,7 +33,6 @@
#include "protocol.h"
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QHttp>
class PasteBinDotCaProtocol : public Protocol
......
......@@ -29,16 +29,10 @@
#include "pastebindotcomprotocol.h"
#include "pastebindotcomsettings.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/messageoutputwindow.h>
#include <QDebug>
#include <QtNetwork/QHttp>
#include <QtGui/QApplication>
#include <QtGui/QClipboard>
#include <QtCore/QDebug>
#include <QtNetwork/QNetworkReply>
using namespace Core;
......
......@@ -33,7 +33,6 @@
#include "protocol.h"
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QHttp>
class PasteBinDotComSettings;
......
......@@ -29,11 +29,12 @@
#include "pasteview.h"
#include <QFontMetrics>
#include <QPainter>
#include <QScrollBar>
#include <QPushButton>
#include <QSettings>
#include <QtGui/QFontMetrics>
#include <QtGui/QPainter>
#include <QtGui/QScrollBar>
#include <QtGui/QPushButton>
#include <QtCore/QSettings>
#include <QtCore/QByteArray>
class ColumnIndicatorTextEdit : public QTextEdit
{
......
......@@ -30,17 +30,16 @@
#ifndef PASTEVIEW_H
#define PASTEVIEW_H
#include "splitter.h"
#include "ui_pasteview.h"
#include "splitter.h"
#include <QDialog>
#include <QByteArray>
#include <QtGui/QDialog>
class PasteView : public QDialog
{
Q_OBJECT
public:
PasteView(QWidget *parent);
explicit PasteView(QWidget *parent);
~PasteView();
int show(const QString &user, const QString &description, const QString &comment,
......
......@@ -30,13 +30,8 @@
#ifndef PROTOCOL_H
#define PROTOCOL_H
#include "settingspage.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtCore/QObject>
#include <QtCore/QString>
QT_BEGIN_NAMESPACE
class QListWidget;
QT_END_NAMESPACE
......
......@@ -35,8 +35,6 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtCore/QStringList>
#include <QtCore/QUrl>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class QSettings;
......
......@@ -739,11 +739,11 @@ void FakeVimPluginPrivate::windowCommand(int key)
void FakeVimPluginPrivate::find(bool reverse)
{
if (Find::Internal::FindPlugin *plugin = Find::Internal::FindPlugin::instance()) {
if (Find::FindPlugin *plugin = Find::FindPlugin::instance()) {
plugin->setUseFakeVim(true);
plugin->openFindToolBar(reverse
? Find::Internal::FindPlugin::FindBackward
: Find::Internal::FindPlugin::FindForward);
? Find::FindPlugin::FindBackward
: Find::FindPlugin::FindForward);
}
}
......@@ -847,8 +847,8 @@ void FakeVimPluginPrivate::setUseFakeVim(const QVariant &value)
{
//qDebug() << "SET USE FAKEVIM" << value;
bool on = value.toBool();
if (Find::Internal::FindPlugin::instance())
Find::Internal::FindPlugin::instance()->setUseFakeVim(on);
if (Find::FindPlugin::instance())
Find::FindPlugin::instance()->setUseFakeVim(on);
if (on) {
Core::EditorManager::instance()->showEditorStatusBar(
QLatin1String(Constants::MINI_BUFFER),
......
......@@ -36,6 +36,7 @@
#include <QtCore/QDebug>
#include <QtGui/QApplication>
#include <QtGui/QWidget>
using namespace Core;
using namespace Find;
......
......@@ -33,7 +33,6 @@
#include "ifindsupport.h"
#include <QtCore/QPointer>
#include <QtGui/QWidget>
namespace Find {
namespace Internal {
......
This diff is collapsed.
......@@ -30,22 +30,25 @@
#ifndef FINDPLUGIN_H
#define FINDPLUGIN_H
#include "ifindfilter.h"
#include "find_global.h"
#include <extensionsystem/iplugin.h>
#include <QtCore/QHash>
#include <QtCore/QStringList>
#include <QtGui/QAction>
#include <QtGui/QTextDocument>
#include <QtGui/QStringListModel>
QT_BEGIN_NAMESPACE
class QStringListModel;
QT_END_NAMESPACE
namespace Find {
namespace Internal {
class IFindFilter;
struct FindPluginPrivate;
namespace Internal {
class FindToolBar;
class FindToolWindow;
class CurrentDocumentFind;
} // namespace Internal
class FIND_EXPORT FindPlugin : public ExtensionSystem::IPlugin
{
......@@ -69,8 +72,8 @@ public:
QTextDocument::FindFlags findFlags() const;
void updateFindCompletion(const QString &text);
void updateReplaceCompletion(const QString &text);
QStringListModel *findCompletionModel() { return m_findCompletionModel; }
QStringListModel *replaceCompletionModel() { return m_replaceCompletionModel; }
QStringListModel *findCompletionModel() const;
QStringListModel *replaceCompletionModel() const;
void setUseFakeVim(bool on);
void openFindToolBar(FindDirection direction);
......@@ -96,22 +99,9 @@ private:
void readSettings();
//variables
static FindPlugin *m_instance;
QHash<IFindFilter *, QAction *> m_filterActions;
CurrentDocumentFind *m_currentDocumentFind;
FindToolBar *m_findToolBar;
FindToolWindow *m_findDialog;
QTextDocument::FindFlags m_findFlags;
QStringListModel *m_findCompletionModel;
QStringListModel *m_replaceCompletionModel;
QStringList m_findCompletions;
QStringList m_replaceCompletions;
QAction *m_openFindDialog;
FindPluginPrivate *d;
};
} // namespace Internal
} // namespace Find
#endif // FINDPLUGIN_H
......@@ -36,7 +36,10 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/findplaceholder.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/stylehelper.h>
#include <QtCore/QDebug>
......@@ -51,6 +54,7 @@
#include <QtGui/QToolButton>
#include <QtGui/QPainter>
#include <QtGui/QPixmapCache>
#include <QtGui/QStringListModel>
Q_DECLARE_METATYPE(QStringList)
Q_DECLARE_METATYPE(Find::IFindFilter*)
......
......@@ -31,29 +31,27 @@
#define FINDTOOLBAR_H
#include "ui_findwidget.h"
#include "ifindfilter.h"
#include "currentdocumentfind.h"
#include <coreplugin/findplaceholder.h>
#include <utils/styledbar.h>
#include <QtCore/QTimer>
#include <QtGui/QStringListModel>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
namespace Core {
class FindToolBarPlaceHolder;
}
namespace Find {
namespace Internal {
class FindPlugin;
namespace Internal {
class FindToolBar : public Utils::StyledBar
{
Q_OBJECT
public:
FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumentFind);
explicit FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumentFind);
~FindToolBar();
void readSettings();
......
......@@ -34,6 +34,8 @@
#include <QtCore/QSettings>
#include <QtGui/QMainWindow>
#include <QtGui/QStringListModel>
#include <QtGui/QCompleter>
using namespace Find;
using namespace Find::Internal;
......
......@@ -34,20 +34,20 @@
#include "ifindfilter.h"
#include <QtCore/QList>
#include <QtGui/QCompleter>
#include <QtGui/QWidget>
namespace Find {
namespace Internal {
QT_FORWARD_DECLARE_CLASS(QCompleter)
namespace Find {
class FindPlugin;
namespace Internal {
class FindToolWindow : public QDialog
{
Q_OBJECT
public:
FindToolWindow(FindPlugin *plugin);
explicit FindToolWindow(FindPlugin *plugin);
~FindToolWindow();
void setFindFilters(const QList<IFindFilter *> &filters);
......@@ -70,7 +70,7 @@ private:
FindPlugin *m_plugin;
QList<IFindFilter *> m_filters;
QCompleter *m_findCompleter;
QList<QWidget *> m_configWidgets;
QWidgetList m_configWidgets;
IFindFilter *m_currentFilter;
};
......
......@@ -30,9 +30,9 @@
#ifndef SEARCHRESULTTREEITEMS_H
#define SEARCHRESULTTREEITEMS_H
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/qnamespace.h>
namespace Find {
namespace Internal {
......
......@@ -33,6 +33,7 @@
#include "searchresulttreeitemdelegate.h"
#include <QtGui/QHeaderView>
#include <QtGui/QKeyEvent>
using namespace Find::Internal;
......
......@@ -31,7 +31,6 @@
#define SEARCHRESULTTREEVIEW_H
#include <QtGui/QTreeView>
#include <QtGui/QKeyEvent>
namespace Find {
namespace Internal {
......@@ -43,7 +42,7 @@ class SearchResultTreeView : public QTreeView
Q_OBJECT
public:
SearchResultTreeView(QWidget *parent = 0);
explicit SearchResultTreeView(QWidget *parent = 0);
void setAutoExpandResults(bool expand);
void setTextEditorFont(const QFont &font);
......
This diff is collapsed.
......@@ -31,20 +31,19 @@
#define SEARCHRESULTWINDOW_H
#include "find_global.h"
#include "searchresulttreeview.h"
#include <coreplugin/ioutputpane.h>
#include <QtCore/QVariant>
#include <coreplugin/ioutputpane.h>
QT_BEGIN_NAMESPACE
class QStackedWidget;
class QListWidget;
class QToolButton;
class QLabel;
class QFont;
QT_END_NAMESPACE
namespace Find {
namespace Internal {
class SearchResultTreeView;
}
class SearchResultWindow;
struct FIND_EXPORT SearchResultItem
......@@ -70,6 +69,7 @@ signals:
friend class SearchResultWindow;
};
struct SearchResultWindowPrivate;
class FIND_EXPORT SearchResultWindow : public Core::IOutputPane
{
Q_OBJECT
......@@ -81,7 +81,7 @@ public:
};
SearchResultWindow();
~SearchResultWindow();
virtual ~SearchResultWindow();
QWidget *outputWidget(QWidget *);
QList<QWidget*> toolBarWidgets() const;
......@@ -127,18 +127,7 @@ private:
void writeSettings();
QList<SearchResultItem> checkedItems() const;
Internal::SearchResultTreeView *m_searchResultTreeView;
QListWidget *m_noMatchesFoundDisplay;
QToolButton *m_expandCollapseToolButton;
QLabel *m_replaceLabel;
QLineEdit *m_replaceTextEdit;
QToolButton *m_replaceButton;
static const bool m_initiallyExpand = false;
QStackedWidget *m_widget;
SearchResult *m_currentSearch;
QList<SearchResultItem> m_items;
bool m_isShowingReplaceUI;
bool m_focusReplaceEdit;
SearchResultWindowPrivate *d;
};
} // namespace Find
......
......@@ -33,8 +33,7 @@
#include "locator_global.h"
#include "ilocatorfilter.h"
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QStringList>
namespace Locator {
......@@ -51,6 +50,10 @@ protected:
virtual void updateFiles();
void generateFileNames();
inline QStringList &files() { return m_files; }
inline const QStringList &files() const { return m_files; }
private:
QStringList m_files;
QStringList m_fileNames;
QStringList m_previousResultPaths;
......
......@@ -58,7 +58,7 @@ QByteArray DirectoryFilter::saveState() const
out << m_filters;
out << shortcutString();
out << isIncludedByDefault();
out << m_files;
out << files();
return value;
}
......@@ -76,7 +76,7 @@ bool DirectoryFilter::restoreState(const QByteArray &state)
in >> m_filters;
in >> shortcut;
in >> defaultFilter;
in >> m_files;
in >> files();
setShortcutString(shortcut);
setIncludedByDefault(defaultFilter);
......@@ -184,14 +184,14 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
future.setProgressRange(0, MAX);
if (m_directories.count() < 1) {
QMutexLocker locker(&m_lock);
m_files.clear();
files().clear();
generateFileNames();
future.setProgressValueAndText(MAX, tr("%1 filter update: 0 files").arg(m_name));
return;
}
int progress = 0;
int MAX_PER = MAX;
QStringList files;
QStringList filesFound;
QStack<QDir> dirs;
QStack<int> progressValues;
QStack<bool> processedValues;
......@@ -209,7 +209,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
while (!dirs.isEmpty() && !future.isCanceled()) {
if (future.isProgressUpdateNeeded()) {
future.setProgressValueAndText(progress,
tr("%1 filter update: %n files", 0, files.size()).arg(m_name));
tr("%1 filter update: %n files", 0, filesFound.size()).arg(m_name));
}
QDir dir = dirs.pop();
int dirProgressMax = progressValues.pop();
......@@ -225,7 +225,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
QDir::Files|QDir::Hidden,
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
foreach (const QString &file, fileEntries)
files.append(dir.path()+ QLatin1Char('/') +file);
filesFound.append(dir.path()+ QLatin1Char('/') +file);
progress += dirProgressMax;
} else {
int subProgress = dirProgressMax/(subDirs.size()+1);
......@@ -246,7 +246,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
if (!future.isCanceled()) {
QMutexLocker locker(&m_lock);
m_files = files;
files() = filesFound;
generateFileNames();
future.setProgressValue(MAX);
} else {
......
......@@ -38,8 +38,6 @@
#include <QtCore/QByteArray>
#include <QtCore/QFutureInterface>
#include <QtCore/QMutex>
#include <QtGui/QWidget>
#include <QtGui/QDialog>
namespace Locator {
namespace Internal {
......
......@@ -30,6 +30,7 @@
#include "filesystemfilter.h"
#include "locatorwidget.h"
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QDir>
......
......@@ -33,13 +33,15 @@
#include "ilocatorfilter.h"
#include "ui_filesystemfilter.h"
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QByteArray>
#include <QtCore/QFutureInterface>
namespace Core {
class EditorManager;
}
namespace Locator {
namespace Internal {
......
......@@ -53,6 +53,7 @@ QT_END_NAMESPACE
#include <QtCore/QFile>
#include <QtCore/QTimer>
#include <QtCore/QSettings>
#include <QtCore/QEvent>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QContextMenuEvent>
......
......@@ -32,7 +32,6 @@
#include "locatorplugin.h"
#include <QtCore/QEvent>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
......@@ -59,7 +58,7 @@ class LocatorWidget
Q_OBJECT
public:
LocatorWidget(LocatorPlugin *qop);
explicit LocatorWidget(LocatorPlugin *qop);
void updateFilterList();
......
......@@ -29,6 +29,9 @@
#include "opendocumentsfilter.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
Q_DECLARE_METATYPE(Core::IEditor*);
using namespace Core;
......
......@@ -32,15 +32,16 @@
#include "ilocatorfilter.h"
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QByteArray>
#include <QtCore/QFutureInterface>
#include <QtGui/QWidget>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/editormanager/ieditor.h>
namespace Core {
class EditorManager;
}
namespace Locator {
namespace Internal {
......@@ -50,7 +51,7 @@ class OpenDocumentsFilter : public Locator::ILocatorFilter
Q_OBJECT
public:
OpenDocumentsFilter(Core::EditorManager *editorManager);
explicit OpenDocumentsFilter(Core::EditorManager *editorManager);
QString displayName() const { return tr("Open documents"); }
QString id() const { return "Open documents"; }
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Medium; }
......
......@@ -58,13 +58,13 @@ void AllProjectsFilter::updateFiles()