forked from qt-creator/qt-creator
Misc: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I919da493d0629b719d328e5e71c96a29d230dfd1
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -99,7 +99,7 @@ QWidget *GeneralSettingsPage::widget()
|
||||
m_ui->helpStartComboBox->setCurrentIndex(m_startOption);
|
||||
|
||||
m_contextOption = HelpManager::customValue(QLatin1String("ContextHelpOption"),
|
||||
Core::HelpManager::SideBySideIfPossible).toInt();
|
||||
HelpManager::SideBySideIfPossible).toInt();
|
||||
m_ui->contextHelpComboBox->setCurrentIndex(m_contextOption);
|
||||
|
||||
connect(m_ui->currentPageButton, &QPushButton::clicked,
|
||||
@@ -182,7 +182,7 @@ void GeneralSettingsPage::apply()
|
||||
m_contextOption = helpOption;
|
||||
HelpManager::setCustomValue(QLatin1String("ContextHelpOption"), helpOption);
|
||||
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
QSettings *settings = ICore::settings();
|
||||
settings->beginGroup(QLatin1String(Help::Constants::ID_MODE_HELP));
|
||||
settings->setValue(QLatin1String("ContextHelpOption"), helpOption);
|
||||
settings->endGroup();
|
||||
@@ -217,7 +217,7 @@ void GeneralSettingsPage::importBookmarks()
|
||||
{
|
||||
m_ui->errorLabel->setVisible(false);
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName(Core::ICore::dialogParent(),
|
||||
QString fileName = QFileDialog::getOpenFileName(ICore::dialogParent(),
|
||||
tr("Import Bookmarks"), QDir::currentPath(), tr("Files (*.xbel)"));
|
||||
|
||||
if (fileName.isEmpty())
|
||||
@@ -239,7 +239,7 @@ void GeneralSettingsPage::exportBookmarks()
|
||||
{
|
||||
m_ui->errorLabel->setVisible(false);
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName(Core::ICore::dialogParent(),
|
||||
QString fileName = QFileDialog::getSaveFileName(ICore::dialogParent(),
|
||||
tr("Save File"), QLatin1String("untitled.xbel"), tr("Files (*.xbel)"));
|
||||
|
||||
QLatin1String suffix(".xbel");
|
||||
|
||||
@@ -41,7 +41,7 @@ HelpViewerFindSupport::HelpViewerFindSupport(HelpViewer *viewer)
|
||||
{
|
||||
}
|
||||
|
||||
Core::FindFlags HelpViewerFindSupport::supportedFindFlags() const
|
||||
FindFlags HelpViewerFindSupport::supportedFindFlags() const
|
||||
{
|
||||
return FindBackward | FindCaseSensitively;
|
||||
}
|
||||
@@ -52,23 +52,23 @@ QString HelpViewerFindSupport::currentFindString() const
|
||||
return m_viewer->selectedText();
|
||||
}
|
||||
|
||||
Core::IFindSupport::Result HelpViewerFindSupport::findIncremental(const QString &txt,
|
||||
Core::FindFlags findFlags)
|
||||
IFindSupport::Result HelpViewerFindSupport::findIncremental(const QString &txt,
|
||||
FindFlags findFlags)
|
||||
{
|
||||
QTC_ASSERT(m_viewer, return NotFound);
|
||||
findFlags &= ~FindBackward;
|
||||
return find(txt, findFlags, true) ? Found : NotFound;
|
||||
}
|
||||
|
||||
Core::IFindSupport::Result HelpViewerFindSupport::findStep(const QString &txt,
|
||||
Core::FindFlags findFlags)
|
||||
IFindSupport::Result HelpViewerFindSupport::findStep(const QString &txt,
|
||||
FindFlags findFlags)
|
||||
{
|
||||
QTC_ASSERT(m_viewer, return NotFound);
|
||||
return find(txt, findFlags, false) ? Found : NotFound;
|
||||
}
|
||||
|
||||
bool HelpViewerFindSupport::find(const QString &txt,
|
||||
Core::FindFlags findFlags, bool incremental)
|
||||
FindFlags findFlags, bool incremental)
|
||||
{
|
||||
QTC_ASSERT(m_viewer, return false);
|
||||
bool wrapped = false;
|
||||
|
||||
@@ -139,7 +139,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
|
||||
void HelpIndexFilter::accept(LocatorFilterEntry selection) const
|
||||
{
|
||||
const QString &key = selection.displayName;
|
||||
const QMap<QString, QUrl> &links = Core::HelpManager::linksForKeyword(key);
|
||||
const QMap<QString, QUrl> &links = HelpManager::linksForKeyword(key);
|
||||
|
||||
if (links.size() == 1)
|
||||
emit linkActivated(links.begin().value());
|
||||
|
||||
@@ -149,7 +149,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
addAutoReleasedObject(m_generalSettingsPage = new GeneralSettingsPage());
|
||||
addAutoReleasedObject(m_searchTaskHandler = new SearchTaskHandler);
|
||||
|
||||
m_centralWidget = new Help::Internal::CentralWidget(modecontext);
|
||||
m_centralWidget = new CentralWidget(modecontext);
|
||||
connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
|
||||
SLOT(updateSideBarSource(QUrl)));
|
||||
connect(m_centralWidget, &CentralWidget::closeButtonClicked,
|
||||
@@ -302,7 +302,7 @@ void HelpPlugin::saveExternalWindowSettings()
|
||||
if (!m_externalWindow)
|
||||
return;
|
||||
m_externalWindowState = m_externalWindow->geometry();
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
QSettings *settings = ICore::settings();
|
||||
settings->setValue(QLatin1String(kExternalWindowStateKey),
|
||||
qVariantFromValue(m_externalWindowState));
|
||||
}
|
||||
@@ -331,7 +331,7 @@ void HelpPlugin::createRightPaneContextViewer()
|
||||
{
|
||||
if (m_rightPaneSideBarWidget)
|
||||
return;
|
||||
m_rightPaneSideBarWidget = createHelpWidget(Core::Context(Constants::C_HELP_SIDEBAR),
|
||||
m_rightPaneSideBarWidget = createHelpWidget(Context(Constants::C_HELP_SIDEBAR),
|
||||
HelpWidget::SideBarWidget);
|
||||
}
|
||||
|
||||
@@ -340,10 +340,10 @@ HelpViewer *HelpPlugin::externalHelpViewer()
|
||||
if (m_externalWindow)
|
||||
return m_externalWindow->currentViewer();
|
||||
doSetupIfNeeded();
|
||||
m_externalWindow = createHelpWidget(Core::Context(Constants::C_HELP_EXTERNAL),
|
||||
m_externalWindow = createHelpWidget(Context(Constants::C_HELP_EXTERNAL),
|
||||
HelpWidget::ExternalWindow);
|
||||
if (m_externalWindowState.isNull()) {
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
QSettings *settings = ICore::settings();
|
||||
m_externalWindowState = settings->value(QLatin1String(kExternalWindowStateKey)).toRect();
|
||||
}
|
||||
if (m_externalWindowState.isNull())
|
||||
@@ -413,7 +413,7 @@ void HelpPlugin::activateHelpMode()
|
||||
void HelpPlugin::showLinkInHelpMode(const QUrl &source)
|
||||
{
|
||||
activateHelpMode();
|
||||
Core::ICore::raiseWindow(m_mode->widget());
|
||||
ICore::raiseWindow(m_mode->widget());
|
||||
m_centralWidget->setSource(source);
|
||||
m_centralWidget->setFocus();
|
||||
}
|
||||
@@ -421,7 +421,7 @@ void HelpPlugin::showLinkInHelpMode(const QUrl &source)
|
||||
void HelpPlugin::showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key)
|
||||
{
|
||||
activateHelpMode();
|
||||
Core::ICore::raiseWindow(m_mode->widget());
|
||||
ICore::raiseWindow(m_mode->widget());
|
||||
m_centralWidget->showTopicChooser(links, key);
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ void HelpPlugin::setupHelpEngineIfNeeded()
|
||||
{
|
||||
LocalHelpManager::setEngineNeedsUpdate();
|
||||
if (ModeManager::currentMode() == m_mode
|
||||
|| contextHelpOption() == Core::HelpManager::ExternalHelpAlways)
|
||||
|| contextHelpOption() == HelpManager::ExternalHelpAlways)
|
||||
LocalHelpManager::setupGuiHelpEngine();
|
||||
}
|
||||
|
||||
@@ -500,24 +500,24 @@ bool HelpPlugin::canShowHelpSideBySide() const
|
||||
return true;
|
||||
}
|
||||
|
||||
HelpViewer *HelpPlugin::viewerForHelpViewerLocation(Core::HelpManager::HelpViewerLocation location)
|
||||
HelpViewer *HelpPlugin::viewerForHelpViewerLocation(HelpManager::HelpViewerLocation location)
|
||||
{
|
||||
Core::HelpManager::HelpViewerLocation actualLocation = location;
|
||||
if (location == Core::HelpManager::SideBySideIfPossible)
|
||||
actualLocation = canShowHelpSideBySide() ? Core::HelpManager::SideBySideAlways
|
||||
: Core::HelpManager::HelpModeAlways;
|
||||
HelpManager::HelpViewerLocation actualLocation = location;
|
||||
if (location == HelpManager::SideBySideIfPossible)
|
||||
actualLocation = canShowHelpSideBySide() ? HelpManager::SideBySideAlways
|
||||
: HelpManager::HelpModeAlways;
|
||||
|
||||
if (actualLocation == Core::HelpManager::ExternalHelpAlways)
|
||||
if (actualLocation == HelpManager::ExternalHelpAlways)
|
||||
return externalHelpViewer();
|
||||
|
||||
if (actualLocation == Core::HelpManager::SideBySideAlways) {
|
||||
if (actualLocation == HelpManager::SideBySideAlways) {
|
||||
createRightPaneContextViewer();
|
||||
RightPaneWidget::instance()->setWidget(m_rightPaneSideBarWidget);
|
||||
RightPaneWidget::instance()->setShown(true);
|
||||
return m_rightPaneSideBarWidget->currentViewer();
|
||||
}
|
||||
|
||||
QTC_CHECK(actualLocation == Core::HelpManager::HelpModeAlways);
|
||||
QTC_CHECK(actualLocation == HelpManager::HelpModeAlways);
|
||||
|
||||
activateHelpMode(); // should trigger an createPage...
|
||||
HelpViewer *viewer = m_centralWidget->currentViewer();
|
||||
@@ -567,7 +567,7 @@ void HelpPlugin::showContextHelp()
|
||||
// Find out what to show
|
||||
QMap<QString, QUrl> links;
|
||||
QString idFromContext;
|
||||
if (IContext *context = Core::ICore::currentContextObject()) {
|
||||
if (IContext *context = ICore::currentContextObject()) {
|
||||
idFromContext = context->contextHelpId();
|
||||
links = HelpManager::linksForIdentifier(idFromContext);
|
||||
// Maybe the id is already an URL
|
||||
@@ -597,7 +597,7 @@ void HelpPlugin::showContextHelp()
|
||||
viewer->scrollToAnchor(source.fragment());
|
||||
}
|
||||
viewer->setFocus();
|
||||
Core::ICore::raiseWindow(viewer);
|
||||
ICore::raiseWindow(viewer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -624,7 +624,7 @@ void HelpPlugin::highlightSearchTermsInContextHelp()
|
||||
m_contextHelpHighlightId.clear();
|
||||
}
|
||||
|
||||
void HelpPlugin::handleHelpRequest(const QUrl &url, Core::HelpManager::HelpViewerLocation location)
|
||||
void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocation location)
|
||||
{
|
||||
if (HelpViewer::launchWithExternalApp(url))
|
||||
return;
|
||||
@@ -648,7 +648,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, Core::HelpManager::HelpViewe
|
||||
HelpViewer *viewer = viewerForHelpViewerLocation(location);
|
||||
QTC_ASSERT(viewer, return);
|
||||
viewer->setSource(newUrl);
|
||||
Core::ICore::raiseWindow(viewer);
|
||||
ICore::raiseWindow(viewer);
|
||||
}
|
||||
|
||||
void HelpPlugin::slotOpenSupportPage()
|
||||
@@ -672,15 +672,15 @@ void HelpPlugin::doSetupIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
Core::HelpManager::HelpViewerLocation HelpPlugin::contextHelpOption() const
|
||||
HelpManager::HelpViewerLocation HelpPlugin::contextHelpOption() const
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
QSettings *settings = ICore::settings();
|
||||
const QString key = QLatin1String(Help::Constants::ID_MODE_HELP) + QLatin1String("/ContextHelpOption");
|
||||
if (settings->contains(key))
|
||||
return Core::HelpManager::HelpViewerLocation(
|
||||
settings->value(key, Core::HelpManager::SideBySideIfPossible).toInt());
|
||||
return HelpManager::HelpViewerLocation(
|
||||
settings->value(key, HelpManager::SideBySideIfPossible).toInt());
|
||||
|
||||
const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
|
||||
return Core::HelpManager::HelpViewerLocation(engine.customValue(QLatin1String("ContextHelpOption"),
|
||||
Core::HelpManager::SideBySideIfPossible).toInt());
|
||||
return HelpManager::HelpViewerLocation(engine.customValue(QLatin1String("ContextHelpOption"),
|
||||
HelpManager::SideBySideIfPossible).toInt());
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ bool QtWebKitHelpWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
if (QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event)) {
|
||||
if (keyEvent->key() == Qt::Key_Slash)
|
||||
Core::FindPlugin::instance()->openFindToolBar(Core::FindPlugin::FindForwardDirection);
|
||||
FindPlugin::instance()->openFindToolBar(FindPlugin::FindForwardDirection);
|
||||
}
|
||||
}
|
||||
return QWebView::eventFilter(obj, event);
|
||||
@@ -569,7 +569,7 @@ void QtWebKitHelpViewer::setOpenInNewPageActionVisible(bool visible)
|
||||
m_webView->setOpenInNewPageActionVisible(visible);
|
||||
}
|
||||
|
||||
bool QtWebKitHelpViewer::findText(const QString &text, Core::FindFlags flags,
|
||||
bool QtWebKitHelpViewer::findText(const QString &text, FindFlags flags,
|
||||
bool incremental, bool fromSearch, bool *wrapped)
|
||||
{
|
||||
Q_UNUSED(incremental);
|
||||
@@ -577,9 +577,9 @@ bool QtWebKitHelpViewer::findText(const QString &text, Core::FindFlags flags,
|
||||
if (wrapped)
|
||||
*wrapped = false;
|
||||
QWebPage::FindFlags options;
|
||||
if (flags & Core::FindBackward)
|
||||
if (flags & FindBackward)
|
||||
options |= QWebPage::FindBackward;
|
||||
if (flags & Core::FindCaseSensitively)
|
||||
if (flags & FindCaseSensitively)
|
||||
options |= QWebPage::FindCaseSensitively;
|
||||
|
||||
bool found = m_webView->findText(text, options);
|
||||
|
||||
Reference in New Issue
Block a user