Commit f0d4ebde authored by hjk's avatar hjk Committed by Eike Ziller
Browse files

Core: Rename LocatorPlugin to Locator



Change-Id: I010447247c57e437057672f1295a611718b5598a
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent c959fc5f
......@@ -39,7 +39,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/find/findplugin.h>
#include <coreplugin/locator/locatorplugin.h>
#include <coreplugin/locator/locator.h>
#include <utils/savefile.h>
......@@ -55,13 +55,13 @@ CorePlugin::CorePlugin() : m_editMode(0), m_designMode(0)
qRegisterMetaType<Core::Id>();
m_mainWindow = new MainWindow;
m_findPlugin = new FindPlugin;
m_locatorPlugin = new LocatorPlugin;
m_locator = new Locator;
}
CorePlugin::~CorePlugin()
{
delete m_findPlugin;
delete m_locatorPlugin;
delete m_locator;
if (m_editMode) {
removeObject(m_editMode);
......@@ -107,7 +107,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
Utils::SaveFile::initializeUmask();
m_findPlugin->initialize(arguments, errorMessage);
m_locatorPlugin->initialize(this, arguments, errorMessage);
m_locator->initialize(this, arguments, errorMessage);
return success;
}
......@@ -119,13 +119,13 @@ void CorePlugin::extensionsInitialized()
addObject(m_designMode);
m_mainWindow->extensionsInitialized();
m_findPlugin->extensionsInitialized();
m_locatorPlugin->extensionsInitialized();
m_locator->extensionsInitialized();
}
bool CorePlugin::delayedInitialize()
{
HelpManager::setupHelpManager();
m_locatorPlugin->delayedInitialize();
m_locator->delayedInitialize();
return true;
}
......
......@@ -41,7 +41,7 @@ namespace Internal {
class EditMode;
class MainWindow;
class LocatorPlugin;
class Locator;
class CorePlugin : public ExtensionSystem::IPlugin
{
......@@ -74,7 +74,7 @@ private:
EditMode *m_editMode;
DesignMode *m_designMode;
FindPlugin *m_findPlugin;
LocatorPlugin *m_locatorPlugin;
Locator *m_locator;
};
} // namespace Internal
......
......@@ -257,8 +257,8 @@ QtcPlugin {
"locatorfiltersfilter.h",
"locatormanager.cpp",
"locatormanager.h",
"locatorplugin.cpp",
"locatorplugin.h",
"locator.cpp",
"locator.h",
"locatorsearchutils.cpp",
"locatorsearchutils.h",
"locatorwidget.cpp",
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
#include "locatorplugin.h"
#include "locator.h"
#include "locatorconstants.h"
#include "locatorfiltersfilter.h"
#include "locatormanager.h"
......@@ -68,7 +68,7 @@ namespace {
}
}
LocatorPlugin::LocatorPlugin()
Locator::Locator()
: m_settingsInitialized(false)
{
m_corePlugin = 0;
......@@ -76,7 +76,7 @@ LocatorPlugin::LocatorPlugin()
connect(&m_refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
}
LocatorPlugin::~LocatorPlugin()
Locator::~Locator()
{
m_corePlugin->removeObject(m_openDocumentsFilter);
m_corePlugin->removeObject(m_fileSystemFilter);
......@@ -89,7 +89,7 @@ LocatorPlugin::~LocatorPlugin()
qDeleteAll(m_customFilters);
}
void LocatorPlugin::initialize(CorePlugin *corePlugin, const QStringList &, QString *)
void Locator::initialize(CorePlugin *corePlugin, const QStringList &, QString *)
{
m_corePlugin = corePlugin;
......@@ -129,7 +129,7 @@ void LocatorPlugin::initialize(CorePlugin *corePlugin, const QStringList &, QStr
m_corePlugin->addAutoReleasedObject(new LocatorFiltersFilter(this, m_locatorWidget));
}
void LocatorPlugin::updatePlaceholderText(Command *command)
void Locator::updatePlaceholderText(Command *command)
{
if (!command)
command = qobject_cast<Command *>(sender());
......@@ -141,25 +141,25 @@ void LocatorPlugin::updatePlaceholderText(Command *command)
command->keySequence().toString(QKeySequence::NativeText)));
}
void LocatorPlugin::openLocator()
void Locator::openLocator()
{
m_locatorWidget->show(QString());
}
void LocatorPlugin::extensionsInitialized()
void Locator::extensionsInitialized()
{
m_filters = ExtensionSystem::PluginManager::getObjects<ILocatorFilter>();
qSort(m_filters.begin(), m_filters.end(), filterLessThan);
setFilters(m_filters);
}
bool LocatorPlugin::delayedInitialize()
bool Locator::delayedInitialize()
{
loadSettings();
return true;
}
void LocatorPlugin::loadSettings()
void Locator::loadSettings()
{
QSettings *qs = ICore::settings();
......@@ -180,7 +180,7 @@ void LocatorPlugin::loadSettings()
m_settingsInitialized = true;
}
void LocatorPlugin::saveSettings()
void Locator::saveSettings()
{
if (m_settingsInitialized) {
SettingsDatabase *s = ICore::settingsDatabase();
......@@ -206,7 +206,7 @@ void LocatorPlugin::saveSettings()
/*!
Return all filters, including the ones created by the user.
*/
QList<ILocatorFilter *> LocatorPlugin::filters()
QList<ILocatorFilter *> Locator::filters()
{
return m_filters;
}
......@@ -215,28 +215,28 @@ QList<ILocatorFilter *> LocatorPlugin::filters()
This returns a subset of all the filters, that contains only the filters that
have been created by the user at some point (maybe in a previous session).
*/
QList<ILocatorFilter *> LocatorPlugin::customFilters()
QList<ILocatorFilter *> Locator::customFilters()
{
return m_customFilters;
}
void LocatorPlugin::setFilters(QList<ILocatorFilter *> f)
void Locator::setFilters(QList<ILocatorFilter *> f)
{
m_filters = f;
m_locatorWidget->updateFilterList();
}
void LocatorPlugin::setCustomFilters(QList<ILocatorFilter *> filters)
void Locator::setCustomFilters(QList<ILocatorFilter *> filters)
{
m_customFilters = filters;
}
int LocatorPlugin::refreshInterval()
int Locator::refreshInterval()
{
return m_refreshTimer.interval() / 60000;
}
void LocatorPlugin::setRefreshInterval(int interval)
void Locator::setRefreshInterval(int interval)
{
if (interval < 1) {
m_refreshTimer.stop();
......@@ -247,7 +247,7 @@ void LocatorPlugin::setRefreshInterval(int interval)
m_refreshTimer.start();
}
void LocatorPlugin::refresh(QList<ILocatorFilter *> filters)
void Locator::refresh(QList<ILocatorFilter *> filters)
{
if (filters.isEmpty())
filters = m_filters;
......
......@@ -49,13 +49,13 @@ class OpenDocumentsFilter;
class FileSystemFilter;
class SettingsPage;
class LocatorPlugin : public QObject
class Locator : public QObject
{
Q_OBJECT
public:
LocatorPlugin();
~LocatorPlugin();
Locator();
~Locator();
void initialize(CorePlugin *corePlugin, const QStringList &arguments, QString *errorMessage);
void extensionsInitialized();
......@@ -102,7 +102,7 @@ private:
};
template <typename S>
void LocatorPlugin::loadSettingsHelper(S *settings)
void Locator::loadSettingsHelper(S *settings)
{
settings->beginGroup(QLatin1String("QuickOpen"));
m_refreshTimer.setInterval(settings->value(QLatin1String("RefreshInterval"), 60).toInt() * 60000);
......
HEADERS += \
$$PWD/locatorplugin.h \
$$PWD/locator.h \
$$PWD/commandlocator.h \
$$PWD/locatorwidget.h \
$$PWD/locatorfiltersfilter.h \
......@@ -15,7 +15,7 @@ HEADERS += \
$$PWD/locatorsearchutils.h
SOURCES += \
$$PWD/locatorplugin.cpp \
$$PWD/locator.cpp \
$$PWD/commandlocator.cpp \
$$PWD/locatorwidget.cpp \
$$PWD/locatorfiltersfilter.cpp \
......
......@@ -28,7 +28,7 @@
****************************************************************************/
#include "locatorplugin.h"
#include "locator.h"
#include "basefilefilter.h"
#include "locatorfiltertest.h"
......@@ -80,7 +80,7 @@ public:
Q_DECLARE_METATYPE(ReferenceData)
Q_DECLARE_METATYPE(QList<ReferenceData>)
void Core::Internal::LocatorPlugin::test_basefilefilter()
void Core::Internal::Locator::test_basefilefilter()
{
QFETCH(QStringList, testFiles);
QFETCH(QList<ReferenceData>, referenceDataList);
......@@ -97,7 +97,7 @@ void Core::Internal::LocatorPlugin::test_basefilefilter()
}
}
void Core::Internal::LocatorPlugin::test_basefilefilter_data()
void Core::Internal::Locator::test_basefilefilter_data()
{
QTest::addColumn<QStringList>("testFiles");
QTest::addColumn<QList<ReferenceData> >("referenceDataList");
......
......@@ -27,8 +27,8 @@
**
****************************************************************************/
#include "locator.h"
#include "locatorfiltersfilter.h"
#include "locatorplugin.h"
#include "locatorwidget.h"
#include <coreplugin/coreconstants.h>
......@@ -38,7 +38,7 @@ using namespace Core::Internal;
Q_DECLARE_METATYPE(ILocatorFilter*)
LocatorFiltersFilter::LocatorFiltersFilter(LocatorPlugin *plugin,
LocatorFiltersFilter::LocatorFiltersFilter(Locator *plugin,
LocatorWidget *locatorWidget):
m_plugin(plugin),
m_locatorWidget(locatorWidget),
......
......@@ -37,7 +37,7 @@
namespace Core {
namespace Internal {
class LocatorPlugin;
class Locator;
class LocatorWidget;
/*!
......@@ -49,7 +49,7 @@ class LocatorFiltersFilter : public ILocatorFilter
Q_OBJECT
public:
LocatorFiltersFilter(LocatorPlugin *plugin,
LocatorFiltersFilter(Locator *plugin,
LocatorWidget *locatorWidget);
// ILocatorFilter
......@@ -58,7 +58,7 @@ public:
void refresh(QFutureInterface<void> &future);
private:
LocatorPlugin *m_plugin;
Locator *m_plugin;
LocatorWidget *m_locatorWidget;
QIcon m_icon;
};
......
......@@ -27,8 +27,8 @@
**
****************************************************************************/
#include "locator.h"
#include "locatorwidget.h"
#include "locatorplugin.h"
#include "locatorconstants.h"
#include "locatorsearchutils.h"
#include "ilocatorfilter.h"
......@@ -217,7 +217,7 @@ void CompletionList::updatePreferredSize()
// =========== LocatorWidget ===========
LocatorWidget::LocatorWidget(LocatorPlugin *qop) :
LocatorWidget::LocatorWidget(Locator *qop) :
m_locatorPlugin(qop),
m_locatorModel(new LocatorModel(this)),
m_completionList(new CompletionList(this)),
......
......@@ -30,7 +30,7 @@
#ifndef LOCATORWIDGET_H
#define LOCATORWIDGET_H
#include "locatorplugin.h"
#include "locator.h"
#include <QWidget>
......@@ -58,7 +58,7 @@ class LocatorWidget
Q_OBJECT
public:
explicit LocatorWidget(LocatorPlugin *qop);
explicit LocatorWidget(Locator *qop);
void updateFilterList();
......@@ -85,7 +85,7 @@ private:
void updateCompletionList(const QString &text);
QList<ILocatorFilter*> filtersFor(const QString &text, QString &searchText);
LocatorPlugin *m_locatorPlugin;
Locator *m_locatorPlugin;
LocatorModel *m_locatorModel;
CompletionList *m_completionList;
......
......@@ -30,7 +30,7 @@
#include "settingspage.h"
#include "locatorconstants.h"
#include "locatorplugin.h"
#include "locator.h"
#include "ilocatorfilter.h"
#include "directoryfilter.h"
......@@ -44,7 +44,7 @@ Q_DECLARE_METATYPE(Core::ILocatorFilter*)
using namespace Core;
using namespace Core::Internal;
SettingsPage::SettingsPage(LocatorPlugin *plugin)
SettingsPage::SettingsPage(Locator *plugin)
: m_plugin(plugin), m_widget(0)
{
setId(Constants::FILTER_OPTIONS_PAGE);
......
......@@ -47,14 +47,14 @@ class ILocatorFilter;
namespace Internal {
class LocatorPlugin;
class Locator;
class SettingsPage : public Core::IOptionsPage
{
Q_OBJECT
public:
explicit SettingsPage(LocatorPlugin *plugin);
explicit SettingsPage(Locator *plugin);
QWidget *widget();
void apply();
......@@ -73,7 +73,7 @@ private:
void requestRefresh();
Ui::LocatorSettingsWidget m_ui;
LocatorPlugin *m_plugin;
Locator *m_plugin;
QPointer<QWidget> m_widget;
QList<ILocatorFilter *> m_filters;
QList<ILocatorFilter *> m_addedFilters;
......
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