Rename SettingsPage -> LocatorSettingsPage

Change-Id: I05ed009c597032ab1242ca2d69d7b0f7bd6da558
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-01-22 12:32:05 +01:00
parent e57bb77360
commit b85229f372
7 changed files with 32 additions and 32 deletions

View File

@@ -280,9 +280,9 @@ QtcPlugin {
"locatorwidget.h", "locatorwidget.h",
"opendocumentsfilter.cpp", "opendocumentsfilter.cpp",
"opendocumentsfilter.h", "opendocumentsfilter.h",
"settingspage.cpp", "locatorsettingspage.cpp",
"settingspage.h", "locatorsettingspage.h",
"settingspage.ui", "locatorsettingspage.ui",
"images/locator.png", "images/locator.png",
"images/reload.png", "images/reload.png",
] ]

View File

@@ -35,7 +35,7 @@
#include "locatorwidget.h" #include "locatorwidget.h"
#include "opendocumentsfilter.h" #include "opendocumentsfilter.h"
#include "filesystemfilter.h" #include "filesystemfilter.h"
#include "settingspage.h" #include "locatorsettingspage.h"
#include <coreplugin/coreplugin.h> #include <coreplugin/coreplugin.h>
#include <coreplugin/statusbarwidget.h> #include <coreplugin/statusbarwidget.h>
@@ -86,7 +86,7 @@ void Locator::initialize(CorePlugin *corePlugin, const QStringList &, QString *)
{ {
m_corePlugin = corePlugin; m_corePlugin = corePlugin;
m_settingsPage = new SettingsPage(this); m_settingsPage = new LocatorSettingsPage(this);
m_corePlugin->addObject(m_settingsPage); m_corePlugin->addObject(m_settingsPage);
m_locatorWidget = new LocatorWidget(this); m_locatorWidget = new LocatorWidget(this);

View File

@@ -49,7 +49,7 @@ class CorePlugin;
class LocatorWidget; class LocatorWidget;
class OpenDocumentsFilter; class OpenDocumentsFilter;
class FileSystemFilter; class FileSystemFilter;
class SettingsPage; class LocatorSettingsPage;
class Locator : public QObject class Locator : public QObject
{ {
@@ -86,7 +86,7 @@ private:
void loadSettingsHelper(S *settings); void loadSettingsHelper(S *settings);
LocatorWidget *m_locatorWidget; LocatorWidget *m_locatorWidget;
SettingsPage *m_settingsPage; LocatorSettingsPage *m_settingsPage;
bool m_settingsInitialized; bool m_settingsInitialized;
QList<ILocatorFilter *> m_filters; QList<ILocatorFilter *> m_filters;

View File

@@ -3,7 +3,6 @@ HEADERS += \
$$PWD/commandlocator.h \ $$PWD/commandlocator.h \
$$PWD/locatorwidget.h \ $$PWD/locatorwidget.h \
$$PWD/locatorfiltersfilter.h \ $$PWD/locatorfiltersfilter.h \
$$PWD/settingspage.h \
$$PWD/ilocatorfilter.h \ $$PWD/ilocatorfilter.h \
$$PWD/opendocumentsfilter.h \ $$PWD/opendocumentsfilter.h \
$$PWD/filesystemfilter.h \ $$PWD/filesystemfilter.h \
@@ -12,7 +11,8 @@ HEADERS += \
$$PWD/locatormanager.h \ $$PWD/locatormanager.h \
$$PWD/basefilefilter.h \ $$PWD/basefilefilter.h \
$$PWD/executefilter.h \ $$PWD/executefilter.h \
$$PWD/locatorsearchutils.h $$PWD/locatorsearchutils.h \
$$PWD/locatorsettingspage.h
SOURCES += \ SOURCES += \
$$PWD/locator.cpp \ $$PWD/locator.cpp \
@@ -21,18 +21,18 @@ SOURCES += \
$$PWD/locatorfiltersfilter.cpp \ $$PWD/locatorfiltersfilter.cpp \
$$PWD/opendocumentsfilter.cpp \ $$PWD/opendocumentsfilter.cpp \
$$PWD/filesystemfilter.cpp \ $$PWD/filesystemfilter.cpp \
$$PWD/settingspage.cpp \
$$PWD/directoryfilter.cpp \ $$PWD/directoryfilter.cpp \
$$PWD/locatormanager.cpp \ $$PWD/locatormanager.cpp \
$$PWD/basefilefilter.cpp \ $$PWD/basefilefilter.cpp \
$$PWD/ilocatorfilter.cpp \ $$PWD/ilocatorfilter.cpp \
$$PWD/executefilter.cpp \ $$PWD/executefilter.cpp \
$$PWD/locatorsearchutils.cpp $$PWD/locatorsearchutils.cpp \
$$PWD/locatorsettingspage.cpp
FORMS += \ FORMS += \
$$PWD/settingspage.ui \
$$PWD/filesystemfilter.ui \ $$PWD/filesystemfilter.ui \
$$PWD/directoryfilter.ui $$PWD/directoryfilter.ui \
$$PWD/locatorsettingspage.ui
RESOURCES += \ RESOURCES += \
$$PWD/locator.qrc $$PWD/locator.qrc

View File

@@ -28,7 +28,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "settingspage.h" #include "locatorsettingspage.h"
#include "locatorconstants.h" #include "locatorconstants.h"
#include "locator.h" #include "locator.h"
@@ -45,7 +45,7 @@ Q_DECLARE_METATYPE(Core::ILocatorFilter*)
using namespace Core; using namespace Core;
using namespace Core::Internal; using namespace Core::Internal;
SettingsPage::SettingsPage(Locator *plugin) LocatorSettingsPage::LocatorSettingsPage(Locator *plugin)
: m_plugin(plugin), m_widget(0) : m_plugin(plugin), m_widget(0)
{ {
setId(Constants::FILTER_OPTIONS_PAGE); setId(Constants::FILTER_OPTIONS_PAGE);
@@ -55,7 +55,7 @@ SettingsPage::SettingsPage(Locator *plugin)
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON)); setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
} }
QWidget *SettingsPage::widget() QWidget *LocatorSettingsPage::widget()
{ {
if (!m_widget) { if (!m_widget) {
m_widget = new QWidget; m_widget = new QWidget;
@@ -81,7 +81,7 @@ QWidget *SettingsPage::widget()
return m_widget; return m_widget;
} }
void SettingsPage::apply() void LocatorSettingsPage::apply()
{ {
// Delete removed filters and clear added filters // Delete removed filters and clear added filters
qDeleteAll(m_removedFilters); qDeleteAll(m_removedFilters);
@@ -97,7 +97,7 @@ void SettingsPage::apply()
saveFilterStates(); saveFilterStates();
} }
void SettingsPage::finish() void LocatorSettingsPage::finish()
{ {
// If settings were applied, this shouldn't change anything. Otherwise it // If settings were applied, this shouldn't change anything. Otherwise it
// makes sure the filter states aren't changed permanently. // makes sure the filter states aren't changed permanently.
@@ -115,26 +115,26 @@ void SettingsPage::finish()
delete m_widget; delete m_widget;
} }
void SettingsPage::requestRefresh() void LocatorSettingsPage::requestRefresh()
{ {
if (!m_refreshFilters.isEmpty()) if (!m_refreshFilters.isEmpty())
m_plugin->refresh(m_refreshFilters); m_plugin->refresh(m_refreshFilters);
} }
void SettingsPage::saveFilterStates() void LocatorSettingsPage::saveFilterStates()
{ {
m_filterStates.clear(); m_filterStates.clear();
foreach (ILocatorFilter *filter, m_filters) foreach (ILocatorFilter *filter, m_filters)
m_filterStates.insert(filter, filter->saveState()); m_filterStates.insert(filter, filter->saveState());
} }
void SettingsPage::restoreFilterStates() void LocatorSettingsPage::restoreFilterStates()
{ {
foreach (ILocatorFilter *filter, m_filterStates.keys()) foreach (ILocatorFilter *filter, m_filterStates.keys())
filter->restoreState(m_filterStates.value(filter)); filter->restoreState(m_filterStates.value(filter));
} }
void SettingsPage::updateFilterList() void LocatorSettingsPage::updateFilterList()
{ {
m_ui.filterList->clear(); m_ui.filterList->clear();
foreach (ILocatorFilter *filter, m_filters) { foreach (ILocatorFilter *filter, m_filters) {
@@ -154,7 +154,7 @@ void SettingsPage::updateFilterList()
m_ui.filterList->setCurrentRow(0); m_ui.filterList->setCurrentRow(0);
} }
void SettingsPage::updateButtonStates() void LocatorSettingsPage::updateButtonStates()
{ {
QListWidgetItem *item = m_ui.filterList->currentItem(); QListWidgetItem *item = m_ui.filterList->currentItem();
ILocatorFilter *filter = (item ? item->data(Qt::UserRole).value<ILocatorFilter *>() : 0); ILocatorFilter *filter = (item ? item->data(Qt::UserRole).value<ILocatorFilter *>() : 0);
@@ -162,7 +162,7 @@ void SettingsPage::updateButtonStates()
m_ui.removeButton->setEnabled(filter && m_customFilters.contains(filter)); m_ui.removeButton->setEnabled(filter && m_customFilters.contains(filter));
} }
void SettingsPage::configureFilter(QListWidgetItem *item) void LocatorSettingsPage::configureFilter(QListWidgetItem *item)
{ {
if (!item) if (!item)
item = m_ui.filterList->currentItem(); item = m_ui.filterList->currentItem();
@@ -179,7 +179,7 @@ void SettingsPage::configureFilter(QListWidgetItem *item)
updateFilterList(); updateFilterList();
} }
void SettingsPage::addCustomFilter() void LocatorSettingsPage::addCustomFilter()
{ {
ILocatorFilter *filter = new DirectoryFilter( ILocatorFilter *filter = new DirectoryFilter(
Id(Constants::CUSTOM_FILTER_BASEID).withSuffix(m_customFilters.size() + 1)); Id(Constants::CUSTOM_FILTER_BASEID).withSuffix(m_customFilters.size() + 1));
@@ -193,7 +193,7 @@ void SettingsPage::addCustomFilter()
} }
} }
void SettingsPage::removeCustomFilter() void LocatorSettingsPage::removeCustomFilter()
{ {
QListWidgetItem *item = m_ui.filterList->currentItem(); QListWidgetItem *item = m_ui.filterList->currentItem();
QTC_ASSERT(item, return); QTC_ASSERT(item, return);

View File

@@ -28,10 +28,10 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef SETTINGSPAGE_H #ifndef LOCATORSETTINGSPAGE_H
#define SETTINGSPAGE_H #define LOCATORSETTINGSPAGE_H
#include "ui_settingspage.h" #include "ui_locatorsettingspage.h"
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
@@ -50,12 +50,12 @@ namespace Internal {
class Locator; class Locator;
class SettingsPage : public IOptionsPage class LocatorSettingsPage : public IOptionsPage
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SettingsPage(Locator *plugin); explicit LocatorSettingsPage(Locator *plugin);
QWidget *widget(); QWidget *widget();
void apply(); void apply();
@@ -87,4 +87,4 @@ private:
} // namespace Internal } // namespace Internal
} // namespace Core } // namespace Core
#endif // SETTINGSPAGE_H #endif // LOCATORSETTINGSPAGE_H