Commit 23624321 authored by hjk's avatar hjk
Browse files

Fixes: some ICore::instance() related cleanup

parent bc0717d0
......@@ -45,8 +45,8 @@ using namespace Core;
using namespace Find;
using namespace Find::Internal;
CurrentDocumentFind::CurrentDocumentFind(ICore *core)
: m_core(core), m_currentFind(0)
CurrentDocumentFind::CurrentDocumentFind()
: m_currentFind(0)
{
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*)));
......
......@@ -36,8 +36,6 @@
#include "ifindfilter.h"
#include <coreplugin/icore.h>
#include <QtCore/QPointer>
#include <QtGui/QWidget>
......@@ -49,7 +47,7 @@ class CurrentDocumentFind : public QObject
Q_OBJECT
public:
CurrentDocumentFind(Core::ICore *core);
CurrentDocumentFind();
void resetIncrementalSearch();
void clearResults();
......@@ -83,7 +81,6 @@ private slots:
private:
void removeFindSupportConnections();
Core::ICore *m_core;
QPointer<IFindSupport> m_currentFind;
QPointer<QWidget> m_currentWidget;
};
......
......@@ -77,14 +77,13 @@ FindPlugin::~FindPlugin()
bool FindPlugin::initialize(const QStringList &, QString *)
{
Core::ICore *core = Core::ICore::instance();
setupMenu();
m_currentDocumentFind = new CurrentDocumentFind(core);
m_currentDocumentFind = new CurrentDocumentFind;
m_findToolBar = new FindToolBar(this, m_currentDocumentFind);
m_findDialog = new FindToolWindow(this);
SearchResultWindow *searchResultWindow = new SearchResultWindow(core);
SearchResultWindow *searchResultWindow = new SearchResultWindow;
addAutoReleasedObject(searchResultWindow);
return true;
}
......@@ -126,8 +125,7 @@ void FindPlugin::openFindFilter()
void FindPlugin::setupMenu()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
......@@ -150,8 +148,7 @@ void FindPlugin::setupMenu()
void FindPlugin::setupFilterMenuItems()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::instance()->actionManager();
QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
Core::Command *cmd;
......
......@@ -34,6 +34,8 @@
#include "searchresultwindow.h"
#include "searchresulttreemodel.h"
#include <coreplugin/icore.h>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QSettings>
......@@ -46,10 +48,9 @@ using namespace Find::Internal;
static const QString SETTINGSKEYSECTIONNAME("SearchResults");
static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
SearchResultWindow::SearchResultWindow(Core::ICore *core) :
m_core(core),
m_widget(new QStackedWidget())
SearchResultWindow::SearchResultWindow()
{
m_widget = new QStackedWidget;
m_widget->setWindowTitle(name());
m_searchResultTreeView = new SearchResultTreeView(m_widget);
......@@ -173,8 +174,8 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
void SearchResultWindow::readSettings(void)
{
if (m_core && m_core->settings()) {
QSettings *s = m_core->settings();
QSettings *s = Core::ICore::instance()->settings();
if (s) {
s->beginGroup(SETTINGSKEYSECTIONNAME);
m_expandCollapseToolButton->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, m_initiallyExpand).toBool());
s->endGroup();
......@@ -183,8 +184,8 @@ void SearchResultWindow::readSettings(void)
void SearchResultWindow::writeSettings(void)
{
if (m_core && m_core->settings()) {
QSettings *s = m_core->settings();
QSettings *s = Core::ICore::instance()->settings();
if (s) {
s->beginGroup(SETTINGSKEYSECTIONNAME);
s->setValue(SETTINGSKEYEXPANDRESULTS, m_expandCollapseToolButton->isChecked());
s->endGroup();
......
......@@ -38,7 +38,6 @@
#include "searchresulttreeview.h"
#include <coreplugin/ioutputpane.h>
#include <coreplugin/icore.h>
#include <QtCore/QThread>
#include <QtCore/QStringList>
......@@ -65,7 +64,7 @@ class FIND_EXPORT SearchResultWindow : public Core::IOutputPane
Q_OBJECT
public:
SearchResultWindow(Core::ICore *core);
SearchResultWindow();
~SearchResultWindow();
QWidget *outputWidget(QWidget *);
......@@ -97,7 +96,6 @@ private:
Internal::SearchResultTreeView *m_searchResultTreeView;
QListWidget *m_noMatchesFoundDisplay;
Core::ICore *m_core;
QToolButton *m_expandCollapseToolButton;
static const bool m_initiallyExpand = false;
QStackedWidget *m_widget;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment