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:
Orgad Shaneh
2015-02-03 23:56:02 +02:00
committed by hjk
parent 2f1509aa58
commit 74ed591db3
61 changed files with 247 additions and 248 deletions

View File

@@ -166,7 +166,7 @@ static bool parseTaskFile(QString *errorString, const QString &base, const QStri
// TaskListPlugin
// --------------------------------------------------------------------------
Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &fileName)
IDocument *TaskListPlugin::openTasks(const QString &base, const QString &fileName)
{
foreach (TaskFile *doc, m_openFiles) {
if (doc->filePath().toString() == fileName)
@@ -178,7 +178,7 @@ Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &f
QString errorString;
if (!file->open(&errorString, fileName)) {
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), errorString);
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), errorString);
delete file;
return 0;
}
@@ -186,7 +186,7 @@ Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &f
m_openFiles.append(file);
// Register with filemanager:
Core::DocumentManager::addDocument(file);
DocumentManager::addDocument(file);
return file;
}
@@ -203,13 +203,13 @@ bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMess
//: Category under which tasklist tasks are listed in Issues view
TaskHub::addCategory(Constants::TASKLISTTASK_ID, tr("My Tasks"));
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
if (!MimeDatabase::addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
return false;
m_fileFactory = new IDocumentFactory;
m_fileFactory->addMimeType(QLatin1String("text/x-tasklist"));
m_fileFactory->setOpener([this](const QString &fileName) -> IDocument * {
ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject();
Project *project = ProjectTree::currentProject();
return this->openTasks(project ? project->projectDirectory().toString() : QString(), fileName);
});