Commit a31b1ef5 authored by Andre Hartmann's avatar Andre Hartmann Committed by André Hartmann

Locator: Whitespace fixes.

Change-Id: I8ae3c7b28586d8248a677c9f1f365cacf0709240
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent d87f10a9
......@@ -73,7 +73,7 @@ QList<Locator::FilterEntry> CommandLocator::matchesFor(QFutureInterface<Locator:
const QChar ampersand = QLatin1Char('&');
const Qt::CaseSensitivity caseSensitivity_ = caseSensitivity(entry);
const int count = d->commands.size();
for (int i = 0; i < count; i++) {
for (int i = 0; i < count; i++) {
if (future.isCanceled())
break;
if (d->commands.at(i)->isActive()) {
......
......@@ -65,7 +65,7 @@ QList<FilterEntry> ExecuteFilter::matchesFor(QFutureInterface<Locator::FilterEnt
value.append(FilterEntry(this, entry, QVariant()));
QList<FilterEntry> others;
const Qt::CaseSensitivity caseSensitivityForPrefix = caseSensitivity(entry);
foreach (const QString& i, m_commandHistory) {
foreach (const QString &i, m_commandHistory) {
if (future.isCanceled())
break;
if (i == entry) // avoid repeated entry
......
......@@ -120,7 +120,7 @@ QString ILocatorFilter::trimWildcards(const QString &str)
{
if (str.isEmpty())
return str;
int first = 0, last = str.size()-1;
int first = 0, last = str.size() - 1;
const QChar asterisk = QLatin1Char('*');
const QChar question = QLatin1Char('?');
while (first < str.size() && (str.at(first) == asterisk || str.at(first) == question))
......@@ -129,7 +129,7 @@ QString ILocatorFilter::trimWildcards(const QString &str)
--last;
if (first > last)
return QString();
return str.mid(first, last-first+1);
return str.mid(first, last - first + 1);
}
Qt::CaseSensitivity ILocatorFilter::caseSensitivity(const QString &str)
......
......@@ -58,7 +58,7 @@ QList<FilterEntry> LocatorFiltersFilter::matchesFor(QFutureInterface<Locator::Fi
if (!entry.isEmpty())
return entries;
QMap<QString, ILocatorFilter*> uniqueFilters;
QMap<QString, ILocatorFilter *> uniqueFilters;
foreach (ILocatorFilter *filter, m_plugin->filters()) {
const QString filterId = filter->shortcutString() + QLatin1Char(',') + filter->displayName();
uniqueFilters.insert(filterId, filter);
......@@ -82,7 +82,7 @@ QList<FilterEntry> LocatorFiltersFilter::matchesFor(QFutureInterface<Locator::Fi
void LocatorFiltersFilter::accept(FilterEntry selection) const
{
ILocatorFilter *filter = selection.internalData.value<ILocatorFilter*>();
ILocatorFilter *filter = selection.internalData.value<ILocatorFilter *>();
if (filter)
m_locatorWidget->show(filter->shortcutString() + QLatin1Char(' '),
filter->shortcutString().length() + 1);
......
......@@ -48,7 +48,7 @@ public:
LocatorManager(Internal::LocatorWidget *locatorWidget);
~LocatorManager();
static LocatorManager* instance() { return m_instance; }
static LocatorManager *instance() { return m_instance; }
void show(const QString &text, int selectionStart = -1, int selectionLength = 0);
......
......@@ -213,7 +213,7 @@ void LocatorPlugin::saveSettings()
/*!
Return all filters, including the ones created by the user.
*/
QList<ILocatorFilter*> LocatorPlugin::filters()
QList<ILocatorFilter *> LocatorPlugin::filters()
{
return m_filters;
}
......@@ -222,12 +222,12 @@ 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 *> LocatorPlugin::customFilters()
{
return m_customFilters;
}
void LocatorPlugin::setFilters(QList<ILocatorFilter*> f)
void LocatorPlugin::setFilters(QList<ILocatorFilter *> f)
{
m_filters = f;
m_locatorWidget->updateFilterList();
......@@ -254,7 +254,7 @@ void LocatorPlugin::setRefreshInterval(int interval)
m_refreshTimer.start();
}
void LocatorPlugin::refresh(QList<ILocatorFilter*> filters)
void LocatorPlugin::refresh(QList<ILocatorFilter *> filters)
{
if (filters.isEmpty())
filters = m_filters;
......
......@@ -66,15 +66,15 @@ public:
void extensionsInitialized();
bool delayedInitialize();
QList<ILocatorFilter*> filters();
QList<ILocatorFilter*> customFilters();
void setFilters(QList<ILocatorFilter*> f);
void setCustomFilters(QList<ILocatorFilter*> f);
QList<ILocatorFilter *> filters();
QList<ILocatorFilter *> customFilters();
void setFilters(QList<ILocatorFilter *> f);
void setCustomFilters(QList<ILocatorFilter *> f);
int refreshInterval();
void setRefreshInterval(int interval);
public slots:
void refresh(QList<ILocatorFilter*> filters = QList<ILocatorFilter*>());
void refresh(QList<ILocatorFilter *> filters = QList<ILocatorFilter *>());
void saveSettings();
void openLocator();
......@@ -91,8 +91,8 @@ private:
SettingsPage *m_settingsPage;
bool m_settingsInitialized;
QList<ILocatorFilter*> m_filters;
QList<ILocatorFilter*> m_customFilters;
QList<ILocatorFilter *> m_filters;
QList<ILocatorFilter *> m_customFilters;
int m_refreshInterval;
QTimer m_refreshTimer;
OpenDocumentsFilter *m_openDocumentsFilter;
......
......@@ -96,7 +96,7 @@ public:
void updatePreferredSize();
QSize preferredSize() const { return m_preferredSize; }
void focusOutEvent (QFocusEvent * event) {
void focusOutEvent (QFocusEvent *event) {
if (event->reason() == Qt::ActiveWindowFocusReason)
hide();
QTreeView::focusOutEvent(event);
......@@ -397,7 +397,7 @@ bool LocatorWidget::eventFilter(QObject *obj, QEvent *event)
}
}
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
QFocusEvent *fev = static_cast<QFocusEvent*>(event);
QFocusEvent *fev = static_cast<QFocusEvent *>(event);
if (fev->reason() != Qt::ActiveWindowFocusReason
|| (fev->reason() == Qt::ActiveWindowFocusReason && !m_completionList->isActiveWindow())) {
m_completionList->hide();
......@@ -454,9 +454,9 @@ void LocatorWidget::showPopupNow()
showCompletionList();
}
QList<ILocatorFilter*> LocatorWidget::filtersFor(const QString &text, QString &searchText)
QList<ILocatorFilter *> LocatorWidget::filtersFor(const QString &text, QString &searchText)
{
QList<ILocatorFilter*> filters = m_locatorPlugin->filters();
QList<ILocatorFilter *> filters = m_locatorPlugin->filters();
const int whiteSpace = text.indexOf(QLatin1Char(' '));
QString prefix;
if (whiteSpace >= 0)
......@@ -474,7 +474,7 @@ QList<ILocatorFilter*> LocatorWidget::filtersFor(const QString &text, QString &s
return prefixFilters;
}
searchText = text;
QList<ILocatorFilter*> activeFilters;
QList<ILocatorFilter *> activeFilters;
foreach (ILocatorFilter *filter, filters)
if (filter->isIncludedByDefault())
activeFilters << filter;
......@@ -485,7 +485,7 @@ void LocatorWidget::updateCompletionList(const QString &text)
{
m_updateRequested = true;
QString searchText;
const QList<ILocatorFilter*> filters = filtersFor(text, searchText);
const QList<ILocatorFilter *> filters = filtersFor(text, searchText);
// cancel the old future
m_entriesWatcher->future().cancel();
......@@ -562,9 +562,9 @@ void LocatorWidget::show(const QString &text, int selectionStart, int selectionL
void LocatorWidget::filterSelected()
{
QString searchText = tr("<type here>");
QAction *action = qobject_cast<QAction*>(sender());
QAction *action = qobject_cast<QAction *>(sender());
QTC_ASSERT(action, return);
ILocatorFilter *filter = action->data().value<ILocatorFilter*>();
ILocatorFilter *filter = action->data().value<ILocatorFilter *>();
QTC_ASSERT(filter, return);
QString currentText = m_fileLineEdit->text().trimmed();
// add shortcut string at front or replace existing shortcut string
......@@ -572,7 +572,7 @@ void LocatorWidget::filterSelected()
searchText = currentText;
foreach (ILocatorFilter *otherfilter, m_locatorPlugin->filters()) {
if (currentText.startsWith(otherfilter->shortcutString() + QLatin1Char(' '))) {
searchText = currentText.mid(otherfilter->shortcutString().length()+1);
searchText = currentText.mid(otherfilter->shortcutString().length() + 1);
break;
}
}
......
......@@ -74,7 +74,7 @@ private:
Ui::SettingsWidget m_ui;
LocatorPlugin *m_plugin;
QWidget* m_page;
QWidget *m_page;
QList<ILocatorFilter *> m_filters;
QList<ILocatorFilter *> m_addedFilters;
QList<ILocatorFilter *> m_removedFilters;
......
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