forked from qt-creator/qt-creator
VCS: 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: I061c7bdcade96961aed226a8348f8ab07ee95f5f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
6bbee89653
commit
620d1c36e5
@@ -724,7 +724,7 @@ QString BranchModel::toolTip(const QString &sha) const
|
||||
QStringList arguments(QLatin1String("-n1"));
|
||||
arguments << sha;
|
||||
if (!m_client->synchronousLog(m_workingDirectory, arguments, &output, &errorMessage,
|
||||
VcsBase::VcsBasePlugin::SuppressCommandLogging)) {
|
||||
VcsBasePlugin::SuppressCommandLogging)) {
|
||||
return errorMessage;
|
||||
}
|
||||
return output;
|
||||
|
||||
@@ -312,7 +312,7 @@ void QueryContext::startQuery(const QString &query)
|
||||
{
|
||||
QStringList arguments = m_baseArguments;
|
||||
arguments.push_back(query);
|
||||
VcsBase::VcsOutputWindow::appendCommand(
|
||||
VcsOutputWindow::appendCommand(
|
||||
m_process.workingDirectory(), Utils::FileName::fromString(m_binary), arguments);
|
||||
m_timer.start();
|
||||
m_process.start(m_binary, arguments);
|
||||
@@ -323,7 +323,7 @@ void QueryContext::errorTermination(const QString &msg)
|
||||
{
|
||||
m_progress.reportCanceled();
|
||||
m_progress.reportFinished();
|
||||
VcsBase::VcsOutputWindow::appendError(msg);
|
||||
VcsOutputWindow::appendError(msg);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ void QueryContext::processError(QProcess::ProcessError e)
|
||||
if (e == QProcess::FailedToStart)
|
||||
errorTermination(msg);
|
||||
else
|
||||
VcsBase::VcsOutputWindow::appendError(msg);
|
||||
VcsOutputWindow::appendError(msg);
|
||||
}
|
||||
|
||||
void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||
@@ -361,7 +361,7 @@ void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||
|
||||
void QueryContext::readyReadStandardError()
|
||||
{
|
||||
VcsBase::VcsOutputWindow::appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
|
||||
VcsOutputWindow::appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
|
||||
}
|
||||
|
||||
void QueryContext::readyReadStandardOutput()
|
||||
@@ -597,7 +597,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters,
|
||||
.arg(QString::fromLocal8Bit(line))
|
||||
.arg(error.errorString());
|
||||
qWarning() << errorMessage;
|
||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
res = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ void GerritPlugin::updateActions(bool hasTopLevel)
|
||||
m_pushToGerritCommand->action()->setEnabled(hasTopLevel);
|
||||
}
|
||||
|
||||
void GerritPlugin::addToLocator(Core::CommandLocator *locator)
|
||||
void GerritPlugin::addToLocator(CommandLocator *locator)
|
||||
{
|
||||
locator->appendCommand(m_gerritCommand);
|
||||
locator->appendCommand(m_pushToGerritCommand);
|
||||
@@ -439,7 +439,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
|
||||
QString repository;
|
||||
bool verifiedRepository = false;
|
||||
if (!m_dialog.isNull() && !m_parameters.isNull() && QFile::exists(m_dialog->repositoryPath()))
|
||||
repository = Core::VcsManager::findTopLevelForDirectory(m_dialog->repositoryPath());
|
||||
repository = VcsManager::findTopLevelForDirectory(m_dialog->repositoryPath());
|
||||
|
||||
if (!repository.isEmpty()) {
|
||||
// Check if remote from a working dir is the same as remote from patch
|
||||
@@ -550,7 +550,7 @@ QString GerritPlugin::findLocalRepository(QString project, const QString &branch
|
||||
} // branchRegexp or file name match
|
||||
} // for repositories
|
||||
// No match, do we have a projects folder?
|
||||
if (Core::DocumentManager::useProjectsDirectory())
|
||||
if (DocumentManager::useProjectsDirectory())
|
||||
return DocumentManager::projectsDirectory();
|
||||
|
||||
return QDir::currentPath();
|
||||
|
||||
@@ -112,7 +112,7 @@ QString GitEditorWidget::changeUnderCursor(const QTextCursor &c) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
VcsBase::BaseAnnotationHighlighter *GitEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const
|
||||
BaseAnnotationHighlighter *GitEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const
|
||||
{
|
||||
return new GitAnnotationHighlighter(changes);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ void GitEditorWidget::setPlainTextFiltered(const QString &text)
|
||||
// If desired, filter out the date from annotation
|
||||
switch (contentType())
|
||||
{
|
||||
case VcsBase::AnnotateOutput: {
|
||||
case AnnotateOutput: {
|
||||
const bool omitAnnotationDate = plugin->settings().boolValue(GitSettings::omitAnnotationDateKey);
|
||||
if (omitAnnotationDate)
|
||||
modText = removeAnnotationDate(text);
|
||||
@@ -244,7 +244,7 @@ void GitEditorWidget::stageDiffChunk()
|
||||
{
|
||||
const QAction *a = qobject_cast<QAction *>(sender());
|
||||
QTC_ASSERT(a, return);
|
||||
const VcsBase::DiffChunk chunk = qvariant_cast<VcsBase::DiffChunk>(a->data());
|
||||
const DiffChunk chunk = qvariant_cast<DiffChunk>(a->data());
|
||||
return applyDiffChunk(chunk, false);
|
||||
}
|
||||
|
||||
@@ -252,11 +252,11 @@ void GitEditorWidget::unstageDiffChunk()
|
||||
{
|
||||
const QAction *a = qobject_cast<QAction *>(sender());
|
||||
QTC_ASSERT(a, return);
|
||||
const VcsBase::DiffChunk chunk = qvariant_cast<VcsBase::DiffChunk>(a->data());
|
||||
const DiffChunk chunk = qvariant_cast<DiffChunk>(a->data());
|
||||
return applyDiffChunk(chunk, true);
|
||||
}
|
||||
|
||||
void GitEditorWidget::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert)
|
||||
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
||||
{
|
||||
QTemporaryFile patchFile;
|
||||
if (!patchFile.open())
|
||||
@@ -288,7 +288,7 @@ void GitEditorWidget::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool rever
|
||||
|
||||
void GitEditorWidget::init()
|
||||
{
|
||||
VcsBase::VcsBaseEditorWidget::init();
|
||||
VcsBaseEditorWidget::init();
|
||||
Core::Id editorId = textDocument()->id();
|
||||
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID)
|
||||
textDocument()->setSyntaxHighlighter(new GitSubmitHighlighter);
|
||||
@@ -296,7 +296,7 @@ void GitEditorWidget::init()
|
||||
textDocument()->setSyntaxHighlighter(new GitRebaseHighlighter);
|
||||
}
|
||||
|
||||
void GitEditorWidget::addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk)
|
||||
void GitEditorWidget::addDiffActions(QMenu *menu, const DiffChunk &chunk)
|
||||
{
|
||||
menu->addSeparator();
|
||||
|
||||
@@ -356,7 +356,7 @@ bool GitEditorWidget::isValidRevision(const QString &revision) const
|
||||
void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change)
|
||||
{
|
||||
m_currentChange = change;
|
||||
if (contentType() != VcsBase::OtherContent) {
|
||||
if (contentType() != OtherContent) {
|
||||
menu->addAction(tr("Cherry-Pick Change %1").arg(change), this, SLOT(cherryPickChange()));
|
||||
menu->addAction(tr("Revert Change %1").arg(change), this, SLOT(revertChange()));
|
||||
menu->addAction(tr("Checkout Change %1").arg(change), this, SLOT(checkoutChange()));
|
||||
|
||||
@@ -103,23 +103,23 @@ const char RC_GIT_MIME_XML[] = ":/git/Git.mimetypes.xml";
|
||||
|
||||
const VcsBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
VcsBase::OtherContent,
|
||||
OtherContent,
|
||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_ID,
|
||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME,
|
||||
"text/vnd.qtcreator.git.commandlog"},
|
||||
{ VcsBase::LogOutput,
|
||||
{ LogOutput,
|
||||
Git::Constants::GIT_LOG_EDITOR_ID,
|
||||
Git::Constants::GIT_LOG_EDITOR_DISPLAY_NAME,
|
||||
"text/vnd.qtcreator.git.log"},
|
||||
{ VcsBase::AnnotateOutput,
|
||||
{ AnnotateOutput,
|
||||
Git::Constants::GIT_BLAME_EDITOR_ID,
|
||||
Git::Constants::GIT_BLAME_EDITOR_DISPLAY_NAME,
|
||||
"text/vnd.qtcreator.git.annotation"},
|
||||
{ VcsBase::OtherContent,
|
||||
{ OtherContent,
|
||||
Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID,
|
||||
Git::Constants::GIT_COMMIT_TEXT_EDITOR_DISPLAY_NAME,
|
||||
"text/vnd.qtcreator.git.commit"},
|
||||
{ VcsBase::OtherContent,
|
||||
{ OtherContent,
|
||||
Git::Constants::GIT_REBASE_EDITOR_ID,
|
||||
Git::Constants::GIT_REBASE_EDITOR_DISPLAY_NAME,
|
||||
"text/vnd.qtcreator.git.rebase"},
|
||||
@@ -186,10 +186,10 @@ ParameterAction *GitPlugin::createParameterAction(ActionContainer *ac,
|
||||
bool addToLocator, const QKeySequence &keys)
|
||||
{
|
||||
auto action = new ParameterAction(defaultText, parameterText, ParameterAction::EnabledWithParameter, this);
|
||||
Core::Command *command = ActionManager::registerAction(action, id, context);
|
||||
Command *command = ActionManager::registerAction(action, id, context);
|
||||
if (!keys.isEmpty())
|
||||
command->setDefaultKeySequence(keys);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
command->setAttribute(Command::CA_UpdateText);
|
||||
ac->addAction(command);
|
||||
if (addToLocator)
|
||||
m_commandLocator->appendCommand(command);
|
||||
@@ -227,7 +227,7 @@ QAction *GitPlugin::createRepositoryAction(ActionContainer *ac,
|
||||
const QKeySequence &keys)
|
||||
{
|
||||
auto action = new QAction(text, this);
|
||||
Core::Command *command = ActionManager::registerAction(action, id, context);
|
||||
Command *command = ActionManager::registerAction(action, id, context);
|
||||
if (!keys.isEmpty())
|
||||
command->setDefaultKeySequence(keys);
|
||||
if (ac)
|
||||
@@ -293,12 +293,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new GitSubmitEditor(&submitParameters); }));
|
||||
|
||||
auto cloneWizardFactory = new VcsBase::BaseCheckoutWizardFactory;
|
||||
auto cloneWizardFactory = new BaseCheckoutWizardFactory;
|
||||
cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
cloneWizardFactory->setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
||||
cloneWizardFactory->setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
||||
cloneWizardFactory->setDisplayName(tr("Git Repository Clone"));
|
||||
cloneWizardFactory->setWizardCreator([this] (const Utils::FileName &path, QWidget *parent) {
|
||||
cloneWizardFactory->setWizardCreator([this] (const FileName &path, QWidget *parent) {
|
||||
return new CloneWizard(path, parent);
|
||||
});
|
||||
addAutoReleasedObject(cloneWizardFactory);
|
||||
@@ -310,7 +310,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
//register actions
|
||||
ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||
|
||||
Core::ActionContainer *gitContainer = ActionManager::createMenu("Git");
|
||||
ActionContainer *gitContainer = ActionManager::createMenu("Git");
|
||||
gitContainer->menu()->setTitle(tr("&Git"));
|
||||
toolsContainer->addMenu(gitContainer);
|
||||
m_menuAction = gitContainer->menu()->menuAction();
|
||||
@@ -624,7 +624,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
context, false, SLOT(startChangeRelatedAction()));
|
||||
|
||||
m_createRepositryAction = new QAction(tr("Create Repository..."), this);
|
||||
Core::Command *createRepositoryCommand = ActionManager::registerAction(
|
||||
Command *createRepositoryCommand = ActionManager::registerAction(
|
||||
m_createRepositryAction, "Git.CreateRepository", globalcontext);
|
||||
connect(m_createRepositryAction, SIGNAL(triggered()), this, SLOT(createRepository()));
|
||||
gitContainer->addAction(createRepositoryCommand);
|
||||
@@ -632,8 +632,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
// Submit editor
|
||||
Context submitContext(Constants::GITSUBMITEDITOR_ID);
|
||||
m_submitCurrentAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
Core::Command *command = ActionManager::registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
Command *command = ActionManager::registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
||||
command->setAttribute(Command::CA_UpdateText);
|
||||
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
||||
|
||||
m_diffSelectedFilesAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||
|
||||
@@ -52,10 +52,10 @@ using namespace VcsBase;
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class GitSubmitFileModel : public VcsBase::SubmitFileModel
|
||||
class GitSubmitFileModel : public SubmitFileModel
|
||||
{
|
||||
public:
|
||||
GitSubmitFileModel(QObject *parent = 0) : VcsBase::SubmitFileModel(parent)
|
||||
GitSubmitFileModel(QObject *parent = 0) : SubmitFileModel(parent)
|
||||
{ }
|
||||
|
||||
void updateSelections(SubmitFileModel *source)
|
||||
@@ -124,7 +124,7 @@ private:
|
||||
* option for staged files. So, we sort apart the diff file lists
|
||||
* according to a type flag we add to the model. */
|
||||
|
||||
GitSubmitEditor::GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters) :
|
||||
GitSubmitEditor::GitSubmitEditor(const VcsBaseSubmitEditorParameters *parameters) :
|
||||
VcsBaseSubmitEditor(parameters, new GitSubmitEditorWidget),
|
||||
m_model(0),
|
||||
m_commitEncoding(0),
|
||||
@@ -178,14 +178,14 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
|
||||
it != d.files.constEnd(); ++it) {
|
||||
const FileStates state = it->first;
|
||||
const QString file = it->second;
|
||||
VcsBase::CheckMode checkMode;
|
||||
CheckMode checkMode;
|
||||
if (state & UnmergedFile) {
|
||||
checkMode = VcsBase::Uncheckable;
|
||||
checkMode = Uncheckable;
|
||||
w->setHasUnmerged(true);
|
||||
} else if (state & StagedFile) {
|
||||
checkMode = VcsBase::Checked;
|
||||
checkMode = Checked;
|
||||
} else {
|
||||
checkMode = VcsBase::Unchecked;
|
||||
checkMode = Unchecked;
|
||||
}
|
||||
m_model->addFile(file, CommitData::stateDisplayName(state), checkMode,
|
||||
QVariant(static_cast<int>(state)));
|
||||
|
||||
Reference in New Issue
Block a user