FakeVim: 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: I41dd2d402b2f5e7c677ddd461a0eeb1c28d98c35
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-02-04 11:00:26 +02:00
committed by hjk
parent 0b0e6506d3
commit 7789201aea

View File

@@ -1394,7 +1394,7 @@ void FakeVimPluginPrivate::showSettingsDialog()
void FakeVimPluginPrivate::triggerAction(Id id) void FakeVimPluginPrivate::triggerAction(Id id)
{ {
Core::Command *cmd = ActionManager::command(id); Command *cmd = ActionManager::command(id);
QTC_ASSERT(cmd, qDebug() << "UNKNOWN CODE: " << id.name(); return); QTC_ASSERT(cmd, qDebug() << "UNKNOWN CODE: " << id.name(); return);
QAction *action = cmd->action(); QAction *action = cmd->action();
QTC_ASSERT(action, return); QTC_ASSERT(action, return);
@@ -1403,7 +1403,7 @@ void FakeVimPluginPrivate::triggerAction(Id id)
void FakeVimPluginPrivate::setActionChecked(Id id, bool check) void FakeVimPluginPrivate::setActionChecked(Id id, bool check)
{ {
Core::Command *cmd = ActionManager::command(id); Command *cmd = ActionManager::command(id);
QTC_ASSERT(cmd, return); QTC_ASSERT(cmd, return);
QAction *action = cmd->action(); QAction *action = cmd->action();
QTC_ASSERT(action, return); QTC_ASSERT(action, return);
@@ -1709,7 +1709,7 @@ void FakeVimPluginPrivate::foldGoTo(int count, bool current)
void FakeVimPluginPrivate::jumpToGlobalMark(QChar mark, bool backTickMode, void FakeVimPluginPrivate::jumpToGlobalMark(QChar mark, bool backTickMode,
const QString &fileName) const QString &fileName)
{ {
Core::IEditor *iedit = Core::EditorManager::openEditor(fileName); IEditor *iedit = EditorManager::openEditor(fileName);
if (!iedit) if (!iedit)
return; return;
FakeVimHandler *handler = m_editorToHandler.value(iedit, 0); FakeVimHandler *handler = m_editorToHandler.value(iedit, 0);
@@ -1853,8 +1853,8 @@ void FakeVimPluginPrivate::setUseFakeVim(const QVariant &value)
{ {
//qDebug() << "SET USE FAKEVIM" << value; //qDebug() << "SET USE FAKEVIM" << value;
bool on = value.toBool(); bool on = value.toBool();
if (Core::FindPlugin::instance()) if (FindPlugin::instance())
Core::FindPlugin::instance()->setUseFakeVim(on); FindPlugin::instance()->setUseFakeVim(on);
setUseFakeVimInternal(on); setUseFakeVimInternal(on);
setShowRelativeLineNumbers(theFakeVimSetting(ConfigRelativeNumber)->value()); setShowRelativeLineNumbers(theFakeVimSetting(ConfigRelativeNumber)->value());
} }
@@ -2050,7 +2050,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
const QString &id = it.key(); const QString &id = it.key();
QRegExp re = it.value(); QRegExp re = it.value();
if (!re.pattern().isEmpty() && re.indexIn(cmd.cmd) != -1) { if (!re.pattern().isEmpty() && re.indexIn(cmd.cmd) != -1) {
triggerAction(Core::Id::fromString(id)); triggerAction(Id::fromString(id));
return; return;
} }
} }
@@ -2188,7 +2188,7 @@ void FakeVimPluginPrivate::highlightMatches(const QString &needle)
{ {
foreach (IEditor *editor, EditorManager::visibleEditors()) { foreach (IEditor *editor, EditorManager::visibleEditors()) {
QWidget *w = editor->widget(); QWidget *w = editor->widget();
Core::IFindSupport *find = Aggregation::query<Core::IFindSupport>(w); IFindSupport *find = Aggregation::query<IFindSupport>(w);
if (find != 0) if (find != 0)
find->highlightAll(needle, FindRegularExpression | FindCaseSensitively); find->highlightAll(needle, FindRegularExpression | FindCaseSensitively);
} }
@@ -2272,8 +2272,8 @@ void FakeVimPlugin::extensionsInitialized()
void FakeVimPlugin::setupTest(QString *title, FakeVimHandler **handler, QWidget **edit) void FakeVimPlugin::setupTest(QString *title, FakeVimHandler **handler, QWidget **edit)
{ {
*title = QString::fromLatin1("test.cpp"); *title = QString::fromLatin1("test.cpp");
Core::IEditor *iedit = Core::EditorManager::openEditorWithContents(Core::Id(), title); IEditor *iedit = EditorManager::openEditorWithContents(Id(), title);
Core::EditorManager::activateEditor(iedit); EditorManager::activateEditor(iedit);
*edit = iedit->widget(); *edit = iedit->widget();
*handler = d->m_editorToHandler.value(iedit, 0); *handler = d->m_editorToHandler.value(iedit, 0);
(*handler)->setupWidget(); (*handler)->setupWidget();