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
@@ -251,15 +251,15 @@ void BazaarPlugin::createMenu(const Context &context)
|
|||||||
void BazaarPlugin::createFileActions(const Context &context)
|
void BazaarPlugin::createFileActions(const Context &context)
|
||||||
{
|
{
|
||||||
m_annotateFile = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_annotateFile = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
Core::Command *command = ActionManager::registerAction(m_annotateFile, ANNOTATE, context);
|
Command *command = ActionManager::registerAction(m_annotateFile, ANNOTATE, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_annotateFile, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
|
connect(m_annotateFile, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_diffFile, DIFF, context);
|
command = ActionManager::registerAction(m_diffFile, DIFF, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+D") : tr("ALT+Z,Alt+D")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+D") : tr("ALT+Z,Alt+D")));
|
||||||
connect(m_diffFile, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
|
connect(m_diffFile, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
@@ -267,7 +267,7 @@ void BazaarPlugin::createFileActions(const Context &context)
|
|||||||
|
|
||||||
m_logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_logFile, LOG, context);
|
command = ActionManager::registerAction(m_logFile, LOG, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+L") : tr("ALT+Z,Alt+L")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+L") : tr("ALT+Z,Alt+L")));
|
||||||
connect(m_logFile, SIGNAL(triggered()), this, SLOT(logCurrentFile()));
|
connect(m_logFile, SIGNAL(triggered()), this, SLOT(logCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
@@ -275,7 +275,7 @@ void BazaarPlugin::createFileActions(const Context &context)
|
|||||||
|
|
||||||
m_statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_statusFile, STATUS, context);
|
command = ActionManager::registerAction(m_statusFile, STATUS, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+S") : tr("ALT+Z,Alt+S")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+S") : tr("ALT+Z,Alt+S")));
|
||||||
connect(m_statusFile, SIGNAL(triggered()), this, SLOT(statusCurrentFile()));
|
connect(m_statusFile, SIGNAL(triggered()), this, SLOT(statusCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
@@ -285,21 +285,21 @@ void BazaarPlugin::createFileActions(const Context &context)
|
|||||||
|
|
||||||
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_addAction, ADD, context);
|
command = ActionManager::registerAction(m_addAction, ADD, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
|
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_deleteAction, DELETE, context);
|
command = ActionManager::registerAction(m_deleteAction, DELETE, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
|
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_revertFile = new ParameterAction(tr("Revert Current File..."), tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
m_revertFile = new ParameterAction(tr("Revert Current File..."), tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_revertFile, REVERT, context);
|
command = ActionManager::registerAction(m_revertFile, REVERT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_revertFile, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
|
connect(m_revertFile, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -360,7 +360,7 @@ void BazaarPlugin::createDirectoryActions(const Context &context)
|
|||||||
{
|
{
|
||||||
auto action = new QAction(tr("Diff"), this);
|
auto action = new QAction(tr("Diff"), this);
|
||||||
m_repositoryActionList.append(action);
|
m_repositoryActionList.append(action);
|
||||||
Core::Command *command = ActionManager::registerAction(action, DIFFMULTI, context);
|
Command *command = ActionManager::registerAction(action, DIFFMULTI, context);
|
||||||
connect(action, SIGNAL(triggered()), this, SLOT(diffRepository()));
|
connect(action, SIGNAL(triggered()), this, SLOT(diffRepository()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -428,7 +428,7 @@ void BazaarPlugin::createRepositoryActions(const Context &context)
|
|||||||
{
|
{
|
||||||
auto action = new QAction(tr("Pull..."), this);
|
auto action = new QAction(tr("Pull..."), this);
|
||||||
m_repositoryActionList.append(action);
|
m_repositoryActionList.append(action);
|
||||||
Core::Command *command = ActionManager::registerAction(action, PULL, context);
|
Command *command = ActionManager::registerAction(action, PULL, context);
|
||||||
connect(action, SIGNAL(triggered()), this, SLOT(pull()));
|
connect(action, SIGNAL(triggered()), this, SLOT(pull()));
|
||||||
m_bazaarContainer->addAction(command);
|
m_bazaarContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -527,11 +527,11 @@ void BazaarPlugin::update()
|
|||||||
void BazaarPlugin::createSubmitEditorActions()
|
void BazaarPlugin::createSubmitEditorActions()
|
||||||
{
|
{
|
||||||
Context context(COMMIT_ID);
|
Context context(COMMIT_ID);
|
||||||
Core::Command *command;
|
Command *command;
|
||||||
|
|
||||||
m_editorCommit = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_editorCommit = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
command = ActionManager::registerAction(m_editorCommit, COMMIT, context);
|
command = ActionManager::registerAction(m_editorCommit, COMMIT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor()));
|
connect(m_editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor()));
|
||||||
|
|
||||||
m_editorDiff = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
m_editorDiff = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||||
@@ -743,7 +743,7 @@ bool BazaarPlugin::submitEditorAboutToClose()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
|
void BazaarPlugin::updateActions(VcsBasePlugin::ActionState as)
|
||||||
{
|
{
|
||||||
if (!enableMenuAction(as, m_menuAction)) {
|
if (!enableMenuAction(as, m_menuAction)) {
|
||||||
m_commandLocator->setEnabled(false);
|
m_commandLocator->setEnabled(false);
|
||||||
|
@@ -407,14 +407,14 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
cvsMenu->addSeparator(context);
|
cvsMenu->addSeparator(context);
|
||||||
|
|
||||||
m_updateDirectoryAction = new ParameterAction(tr("Update Directory"), tr("Update Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
|
m_updateDirectoryAction = new ParameterAction(tr("Update Directory"), tr("Update Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
|
||||||
command = Core::ActionManager::registerAction(m_updateDirectoryAction, CMD_ID_UPDATE_DIRECTORY, context);
|
command = ActionManager::registerAction(m_updateDirectoryAction, CMD_ID_UPDATE_DIRECTORY, context);
|
||||||
command->setAttribute(Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_updateDirectoryAction, SIGNAL(triggered()), this, SLOT(updateDirectory()));
|
connect(m_updateDirectoryAction, SIGNAL(triggered()), this, SLOT(updateDirectory()));
|
||||||
cvsMenu->addAction(command);
|
cvsMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_commitDirectoryAction = new ParameterAction(tr("Commit Directory"), tr("Commit Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
|
m_commitDirectoryAction = new ParameterAction(tr("Commit Directory"), tr("Commit Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
|
||||||
command = Core::ActionManager::registerAction(m_commitDirectoryAction,
|
command = ActionManager::registerAction(m_commitDirectoryAction,
|
||||||
CMD_ID_COMMIT_DIRECTORY, context);
|
CMD_ID_COMMIT_DIRECTORY, context);
|
||||||
command->setAttribute(Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_commitDirectoryAction, SIGNAL(triggered()), this, SLOT(startCommitDirectory()));
|
connect(m_commitDirectoryAction, SIGNAL(triggered()), this, SLOT(startCommitDirectory()));
|
||||||
|
@@ -38,7 +38,7 @@ using namespace Cvs::Internal;
|
|||||||
using namespace VcsBase;
|
using namespace VcsBase;
|
||||||
|
|
||||||
CvsSubmitEditor::CvsSubmitEditor(const VcsBaseSubmitEditorParameters *parameters) :
|
CvsSubmitEditor::CvsSubmitEditor(const VcsBaseSubmitEditorParameters *parameters) :
|
||||||
VcsBaseSubmitEditor(parameters, new VcsBase::SubmitEditorWidget),
|
VcsBaseSubmitEditor(parameters, new SubmitEditorWidget),
|
||||||
m_msgAdded(tr("Added")),
|
m_msgAdded(tr("Added")),
|
||||||
m_msgRemoved(tr("Removed")),
|
m_msgRemoved(tr("Removed")),
|
||||||
m_msgModified(tr("Modified"))
|
m_msgModified(tr("Modified"))
|
||||||
|
@@ -724,7 +724,7 @@ QString BranchModel::toolTip(const QString &sha) const
|
|||||||
QStringList arguments(QLatin1String("-n1"));
|
QStringList arguments(QLatin1String("-n1"));
|
||||||
arguments << sha;
|
arguments << sha;
|
||||||
if (!m_client->synchronousLog(m_workingDirectory, arguments, &output, &errorMessage,
|
if (!m_client->synchronousLog(m_workingDirectory, arguments, &output, &errorMessage,
|
||||||
VcsBase::VcsBasePlugin::SuppressCommandLogging)) {
|
VcsBasePlugin::SuppressCommandLogging)) {
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
|
@@ -312,7 +312,7 @@ void QueryContext::startQuery(const QString &query)
|
|||||||
{
|
{
|
||||||
QStringList arguments = m_baseArguments;
|
QStringList arguments = m_baseArguments;
|
||||||
arguments.push_back(query);
|
arguments.push_back(query);
|
||||||
VcsBase::VcsOutputWindow::appendCommand(
|
VcsOutputWindow::appendCommand(
|
||||||
m_process.workingDirectory(), Utils::FileName::fromString(m_binary), arguments);
|
m_process.workingDirectory(), Utils::FileName::fromString(m_binary), arguments);
|
||||||
m_timer.start();
|
m_timer.start();
|
||||||
m_process.start(m_binary, arguments);
|
m_process.start(m_binary, arguments);
|
||||||
@@ -323,7 +323,7 @@ void QueryContext::errorTermination(const QString &msg)
|
|||||||
{
|
{
|
||||||
m_progress.reportCanceled();
|
m_progress.reportCanceled();
|
||||||
m_progress.reportFinished();
|
m_progress.reportFinished();
|
||||||
VcsBase::VcsOutputWindow::appendError(msg);
|
VcsOutputWindow::appendError(msg);
|
||||||
emit finished();
|
emit finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ void QueryContext::processError(QProcess::ProcessError e)
|
|||||||
if (e == QProcess::FailedToStart)
|
if (e == QProcess::FailedToStart)
|
||||||
errorTermination(msg);
|
errorTermination(msg);
|
||||||
else
|
else
|
||||||
VcsBase::VcsOutputWindow::appendError(msg);
|
VcsOutputWindow::appendError(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||||
@@ -361,7 +361,7 @@ void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
|||||||
|
|
||||||
void QueryContext::readyReadStandardError()
|
void QueryContext::readyReadStandardError()
|
||||||
{
|
{
|
||||||
VcsBase::VcsOutputWindow::appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
|
VcsOutputWindow::appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryContext::readyReadStandardOutput()
|
void QueryContext::readyReadStandardOutput()
|
||||||
@@ -597,7 +597,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters,
|
|||||||
.arg(QString::fromLocal8Bit(line))
|
.arg(QString::fromLocal8Bit(line))
|
||||||
.arg(error.errorString());
|
.arg(error.errorString());
|
||||||
qWarning() << errorMessage;
|
qWarning() << errorMessage;
|
||||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
res = false;
|
res = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -305,7 +305,7 @@ void GerritPlugin::updateActions(bool hasTopLevel)
|
|||||||
m_pushToGerritCommand->action()->setEnabled(hasTopLevel);
|
m_pushToGerritCommand->action()->setEnabled(hasTopLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GerritPlugin::addToLocator(Core::CommandLocator *locator)
|
void GerritPlugin::addToLocator(CommandLocator *locator)
|
||||||
{
|
{
|
||||||
locator->appendCommand(m_gerritCommand);
|
locator->appendCommand(m_gerritCommand);
|
||||||
locator->appendCommand(m_pushToGerritCommand);
|
locator->appendCommand(m_pushToGerritCommand);
|
||||||
@@ -439,7 +439,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
|
|||||||
QString repository;
|
QString repository;
|
||||||
bool verifiedRepository = false;
|
bool verifiedRepository = false;
|
||||||
if (!m_dialog.isNull() && !m_parameters.isNull() && QFile::exists(m_dialog->repositoryPath()))
|
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()) {
|
if (!repository.isEmpty()) {
|
||||||
// Check if remote from a working dir is the same as remote from patch
|
// 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
|
} // branchRegexp or file name match
|
||||||
} // for repositories
|
} // for repositories
|
||||||
// No match, do we have a projects folder?
|
// No match, do we have a projects folder?
|
||||||
if (Core::DocumentManager::useProjectsDirectory())
|
if (DocumentManager::useProjectsDirectory())
|
||||||
return DocumentManager::projectsDirectory();
|
return DocumentManager::projectsDirectory();
|
||||||
|
|
||||||
return QDir::currentPath();
|
return QDir::currentPath();
|
||||||
|
@@ -112,7 +112,7 @@ QString GitEditorWidget::changeUnderCursor(const QTextCursor &c) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::BaseAnnotationHighlighter *GitEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const
|
BaseAnnotationHighlighter *GitEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const
|
||||||
{
|
{
|
||||||
return new GitAnnotationHighlighter(changes);
|
return new GitAnnotationHighlighter(changes);
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ void GitEditorWidget::setPlainTextFiltered(const QString &text)
|
|||||||
// If desired, filter out the date from annotation
|
// If desired, filter out the date from annotation
|
||||||
switch (contentType())
|
switch (contentType())
|
||||||
{
|
{
|
||||||
case VcsBase::AnnotateOutput: {
|
case AnnotateOutput: {
|
||||||
const bool omitAnnotationDate = plugin->settings().boolValue(GitSettings::omitAnnotationDateKey);
|
const bool omitAnnotationDate = plugin->settings().boolValue(GitSettings::omitAnnotationDateKey);
|
||||||
if (omitAnnotationDate)
|
if (omitAnnotationDate)
|
||||||
modText = removeAnnotationDate(text);
|
modText = removeAnnotationDate(text);
|
||||||
@@ -244,7 +244,7 @@ void GitEditorWidget::stageDiffChunk()
|
|||||||
{
|
{
|
||||||
const QAction *a = qobject_cast<QAction *>(sender());
|
const QAction *a = qobject_cast<QAction *>(sender());
|
||||||
QTC_ASSERT(a, return);
|
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);
|
return applyDiffChunk(chunk, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,11 +252,11 @@ void GitEditorWidget::unstageDiffChunk()
|
|||||||
{
|
{
|
||||||
const QAction *a = qobject_cast<QAction *>(sender());
|
const QAction *a = qobject_cast<QAction *>(sender());
|
||||||
QTC_ASSERT(a, return);
|
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);
|
return applyDiffChunk(chunk, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitEditorWidget::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert)
|
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
||||||
{
|
{
|
||||||
QTemporaryFile patchFile;
|
QTemporaryFile patchFile;
|
||||||
if (!patchFile.open())
|
if (!patchFile.open())
|
||||||
@@ -288,7 +288,7 @@ void GitEditorWidget::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool rever
|
|||||||
|
|
||||||
void GitEditorWidget::init()
|
void GitEditorWidget::init()
|
||||||
{
|
{
|
||||||
VcsBase::VcsBaseEditorWidget::init();
|
VcsBaseEditorWidget::init();
|
||||||
Core::Id editorId = textDocument()->id();
|
Core::Id editorId = textDocument()->id();
|
||||||
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID)
|
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID)
|
||||||
textDocument()->setSyntaxHighlighter(new GitSubmitHighlighter);
|
textDocument()->setSyntaxHighlighter(new GitSubmitHighlighter);
|
||||||
@@ -296,7 +296,7 @@ void GitEditorWidget::init()
|
|||||||
textDocument()->setSyntaxHighlighter(new GitRebaseHighlighter);
|
textDocument()->setSyntaxHighlighter(new GitRebaseHighlighter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitEditorWidget::addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk)
|
void GitEditorWidget::addDiffActions(QMenu *menu, const DiffChunk &chunk)
|
||||||
{
|
{
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ bool GitEditorWidget::isValidRevision(const QString &revision) const
|
|||||||
void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change)
|
void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change)
|
||||||
{
|
{
|
||||||
m_currentChange = 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("Cherry-Pick Change %1").arg(change), this, SLOT(cherryPickChange()));
|
||||||
menu->addAction(tr("Revert Change %1").arg(change), this, SLOT(revertChange()));
|
menu->addAction(tr("Revert Change %1").arg(change), this, SLOT(revertChange()));
|
||||||
menu->addAction(tr("Checkout Change %1").arg(change), this, SLOT(checkoutChange()));
|
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[] = {
|
const VcsBaseEditorParameters editorParameters[] = {
|
||||||
{
|
{
|
||||||
VcsBase::OtherContent,
|
OtherContent,
|
||||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_ID,
|
Git::Constants::GIT_COMMAND_LOG_EDITOR_ID,
|
||||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME,
|
Git::Constants::GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.git.commandlog"},
|
"text/vnd.qtcreator.git.commandlog"},
|
||||||
{ VcsBase::LogOutput,
|
{ LogOutput,
|
||||||
Git::Constants::GIT_LOG_EDITOR_ID,
|
Git::Constants::GIT_LOG_EDITOR_ID,
|
||||||
Git::Constants::GIT_LOG_EDITOR_DISPLAY_NAME,
|
Git::Constants::GIT_LOG_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.git.log"},
|
"text/vnd.qtcreator.git.log"},
|
||||||
{ VcsBase::AnnotateOutput,
|
{ AnnotateOutput,
|
||||||
Git::Constants::GIT_BLAME_EDITOR_ID,
|
Git::Constants::GIT_BLAME_EDITOR_ID,
|
||||||
Git::Constants::GIT_BLAME_EDITOR_DISPLAY_NAME,
|
Git::Constants::GIT_BLAME_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.git.annotation"},
|
"text/vnd.qtcreator.git.annotation"},
|
||||||
{ VcsBase::OtherContent,
|
{ OtherContent,
|
||||||
Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID,
|
Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID,
|
||||||
Git::Constants::GIT_COMMIT_TEXT_EDITOR_DISPLAY_NAME,
|
Git::Constants::GIT_COMMIT_TEXT_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.git.commit"},
|
"text/vnd.qtcreator.git.commit"},
|
||||||
{ VcsBase::OtherContent,
|
{ OtherContent,
|
||||||
Git::Constants::GIT_REBASE_EDITOR_ID,
|
Git::Constants::GIT_REBASE_EDITOR_ID,
|
||||||
Git::Constants::GIT_REBASE_EDITOR_DISPLAY_NAME,
|
Git::Constants::GIT_REBASE_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.git.rebase"},
|
"text/vnd.qtcreator.git.rebase"},
|
||||||
@@ -186,10 +186,10 @@ ParameterAction *GitPlugin::createParameterAction(ActionContainer *ac,
|
|||||||
bool addToLocator, const QKeySequence &keys)
|
bool addToLocator, const QKeySequence &keys)
|
||||||
{
|
{
|
||||||
auto action = new ParameterAction(defaultText, parameterText, ParameterAction::EnabledWithParameter, this);
|
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())
|
if (!keys.isEmpty())
|
||||||
command->setDefaultKeySequence(keys);
|
command->setDefaultKeySequence(keys);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
ac->addAction(command);
|
ac->addAction(command);
|
||||||
if (addToLocator)
|
if (addToLocator)
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -227,7 +227,7 @@ QAction *GitPlugin::createRepositoryAction(ActionContainer *ac,
|
|||||||
const QKeySequence &keys)
|
const QKeySequence &keys)
|
||||||
{
|
{
|
||||||
auto action = new QAction(text, this);
|
auto action = new QAction(text, this);
|
||||||
Core::Command *command = ActionManager::registerAction(action, id, context);
|
Command *command = ActionManager::registerAction(action, id, context);
|
||||||
if (!keys.isEmpty())
|
if (!keys.isEmpty())
|
||||||
command->setDefaultKeySequence(keys);
|
command->setDefaultKeySequence(keys);
|
||||||
if (ac)
|
if (ac)
|
||||||
@@ -293,12 +293,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||||
[]() { return new GitSubmitEditor(&submitParameters); }));
|
[]() { return new GitSubmitEditor(&submitParameters); }));
|
||||||
|
|
||||||
auto cloneWizardFactory = new VcsBase::BaseCheckoutWizardFactory;
|
auto cloneWizardFactory = new BaseCheckoutWizardFactory;
|
||||||
cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||||
cloneWizardFactory->setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
cloneWizardFactory->setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
||||||
cloneWizardFactory->setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
cloneWizardFactory->setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
||||||
cloneWizardFactory->setDisplayName(tr("Git Repository Clone"));
|
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);
|
return new CloneWizard(path, parent);
|
||||||
});
|
});
|
||||||
addAutoReleasedObject(cloneWizardFactory);
|
addAutoReleasedObject(cloneWizardFactory);
|
||||||
@@ -310,7 +310,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
//register actions
|
//register actions
|
||||||
ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||||
|
|
||||||
Core::ActionContainer *gitContainer = ActionManager::createMenu("Git");
|
ActionContainer *gitContainer = ActionManager::createMenu("Git");
|
||||||
gitContainer->menu()->setTitle(tr("&Git"));
|
gitContainer->menu()->setTitle(tr("&Git"));
|
||||||
toolsContainer->addMenu(gitContainer);
|
toolsContainer->addMenu(gitContainer);
|
||||||
m_menuAction = gitContainer->menu()->menuAction();
|
m_menuAction = gitContainer->menu()->menuAction();
|
||||||
@@ -624,7 +624,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
context, false, SLOT(startChangeRelatedAction()));
|
context, false, SLOT(startChangeRelatedAction()));
|
||||||
|
|
||||||
m_createRepositryAction = new QAction(tr("Create Repository..."), this);
|
m_createRepositryAction = new QAction(tr("Create Repository..."), this);
|
||||||
Core::Command *createRepositoryCommand = ActionManager::registerAction(
|
Command *createRepositoryCommand = ActionManager::registerAction(
|
||||||
m_createRepositryAction, "Git.CreateRepository", globalcontext);
|
m_createRepositryAction, "Git.CreateRepository", globalcontext);
|
||||||
connect(m_createRepositryAction, SIGNAL(triggered()), this, SLOT(createRepository()));
|
connect(m_createRepositryAction, SIGNAL(triggered()), this, SLOT(createRepository()));
|
||||||
gitContainer->addAction(createRepositoryCommand);
|
gitContainer->addAction(createRepositoryCommand);
|
||||||
@@ -632,8 +632,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
// Submit editor
|
// Submit editor
|
||||||
Context submitContext(Constants::GITSUBMITEDITOR_ID);
|
Context submitContext(Constants::GITSUBMITEDITOR_ID);
|
||||||
m_submitCurrentAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_submitCurrentAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
Core::Command *command = ActionManager::registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
Command *command = ActionManager::registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
||||||
|
|
||||||
m_diffSelectedFilesAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
m_diffSelectedFilesAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||||
|
@@ -52,10 +52,10 @@ using namespace VcsBase;
|
|||||||
namespace Git {
|
namespace Git {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GitSubmitFileModel : public VcsBase::SubmitFileModel
|
class GitSubmitFileModel : public SubmitFileModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GitSubmitFileModel(QObject *parent = 0) : VcsBase::SubmitFileModel(parent)
|
GitSubmitFileModel(QObject *parent = 0) : SubmitFileModel(parent)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void updateSelections(SubmitFileModel *source)
|
void updateSelections(SubmitFileModel *source)
|
||||||
@@ -124,7 +124,7 @@ private:
|
|||||||
* option for staged files. So, we sort apart the diff file lists
|
* option for staged files. So, we sort apart the diff file lists
|
||||||
* according to a type flag we add to the model. */
|
* 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),
|
VcsBaseSubmitEditor(parameters, new GitSubmitEditorWidget),
|
||||||
m_model(0),
|
m_model(0),
|
||||||
m_commitEncoding(0),
|
m_commitEncoding(0),
|
||||||
@@ -178,14 +178,14 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
|
|||||||
it != d.files.constEnd(); ++it) {
|
it != d.files.constEnd(); ++it) {
|
||||||
const FileStates state = it->first;
|
const FileStates state = it->first;
|
||||||
const QString file = it->second;
|
const QString file = it->second;
|
||||||
VcsBase::CheckMode checkMode;
|
CheckMode checkMode;
|
||||||
if (state & UnmergedFile) {
|
if (state & UnmergedFile) {
|
||||||
checkMode = VcsBase::Uncheckable;
|
checkMode = Uncheckable;
|
||||||
w->setHasUnmerged(true);
|
w->setHasUnmerged(true);
|
||||||
} else if (state & StagedFile) {
|
} else if (state & StagedFile) {
|
||||||
checkMode = VcsBase::Checked;
|
checkMode = Checked;
|
||||||
} else {
|
} else {
|
||||||
checkMode = VcsBase::Unchecked;
|
checkMode = Unchecked;
|
||||||
}
|
}
|
||||||
m_model->addFile(file, CommitData::stateDisplayName(state), checkMode,
|
m_model->addFile(file, CommitData::stateDisplayName(state), checkMode,
|
||||||
QVariant(static_cast<int>(state)));
|
QVariant(static_cast<int>(state)));
|
||||||
|
@@ -71,7 +71,7 @@ void CommitEditor::setFields(const QFileInfo &repositoryRoot, const QString &bra
|
|||||||
if (item.flags == QLatin1String("Untracked"))
|
if (item.flags == QLatin1String("Untracked"))
|
||||||
shouldTrack.append(item.file);
|
shouldTrack.append(item.file);
|
||||||
else
|
else
|
||||||
fileModel->addFile(item.file, item.flags, VcsBase::Unchecked);
|
fileModel->addFile(item.file, item.flags, Unchecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repositoryRoot.absoluteFilePath(),
|
VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repositoryRoot.absoluteFilePath(),
|
||||||
@@ -80,7 +80,7 @@ void CommitEditor::setFields(const QFileInfo &repositoryRoot, const QString &bra
|
|||||||
foreach (const QString &track, shouldTrack) {
|
foreach (const QString &track, shouldTrack) {
|
||||||
foreach (const VcsBaseClient::StatusItem &item, repoStatus) {
|
foreach (const VcsBaseClient::StatusItem &item, repoStatus) {
|
||||||
if (item.file == track)
|
if (item.file == track)
|
||||||
fileModel->addFile(item.file, item.flags, VcsBase::Unchecked);
|
fileModel->addFile(item.file, item.flags, Unchecked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -252,7 +252,7 @@ QString MercurialClient::shortDescriptionSync(const QString &workingDirectory,
|
|||||||
QByteArray outputData;
|
QByteArray outputData;
|
||||||
if (!vcsFullySynchronousExec(workingDirectory, args, &outputData))
|
if (!vcsFullySynchronousExec(workingDirectory, args, &outputData))
|
||||||
return revision;
|
return revision;
|
||||||
description = Utils::SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(outputData));
|
description = SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(outputData));
|
||||||
if (description.endsWith(QLatin1Char('\n')))
|
if (description.endsWith(QLatin1Char('\n')))
|
||||||
description.truncate(description.size() - 1);
|
description.truncate(description.size() - 1);
|
||||||
return description;
|
return description;
|
||||||
|
@@ -555,7 +555,7 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start new temp file
|
// Start new temp file
|
||||||
Utils::TempFileSaver saver;
|
TempFileSaver saver;
|
||||||
// Keep the file alive, else it removes self and forgets its name
|
// Keep the file alive, else it removes self and forgets its name
|
||||||
saver.setAutoRemove(false);
|
saver.setAutoRemove(false);
|
||||||
if (!saver.finalize()) {
|
if (!saver.finalize()) {
|
||||||
|
@@ -98,15 +98,15 @@ const char PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS",
|
|||||||
|
|
||||||
const VcsBaseEditorParameters editorParameters[] = {
|
const VcsBaseEditorParameters editorParameters[] = {
|
||||||
{
|
{
|
||||||
VcsBase::LogOutput,
|
LogOutput,
|
||||||
PERFORCE_LOG_EDITOR_ID,
|
PERFORCE_LOG_EDITOR_ID,
|
||||||
PERFORCE_LOG_EDITOR_DISPLAY_NAME,
|
PERFORCE_LOG_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.p4.log"},
|
"text/vnd.qtcreator.p4.log"},
|
||||||
{ VcsBase::AnnotateOutput,
|
{ AnnotateOutput,
|
||||||
PERFORCE_ANNOTATION_EDITOR_ID,
|
PERFORCE_ANNOTATION_EDITOR_ID,
|
||||||
PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME,
|
PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME,
|
||||||
"text/vnd.qtcreator.p4.annotation"},
|
"text/vnd.qtcreator.p4.annotation"},
|
||||||
{ VcsBase::DiffOutput,
|
{ DiffOutput,
|
||||||
PERFORCE_DIFF_EDITOR_ID,
|
PERFORCE_DIFF_EDITOR_ID,
|
||||||
PERFORCE_DIFF_EDITOR_DISPLAY_NAME,
|
PERFORCE_DIFF_EDITOR_DISPLAY_NAME,
|
||||||
"text/x-patch"}
|
"text/x-patch"}
|
||||||
@@ -249,18 +249,18 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||||
|
|
||||||
Core::ActionContainer *perforceContainer = ActionManager::createMenu(CMD_ID_PERFORCE_MENU);
|
ActionContainer *perforceContainer = ActionManager::createMenu(CMD_ID_PERFORCE_MENU);
|
||||||
perforceContainer->menu()->setTitle(tr("&Perforce"));
|
perforceContainer->menu()->setTitle(tr("&Perforce"));
|
||||||
mtools->addMenu(perforceContainer);
|
mtools->addMenu(perforceContainer);
|
||||||
m_menuAction = perforceContainer->menu()->menuAction();
|
m_menuAction = perforceContainer->menu()->menuAction();
|
||||||
|
|
||||||
Context perforcesubmitcontext(PERFORCE_SUBMIT_EDITOR_ID);
|
Context perforcesubmitcontext(PERFORCE_SUBMIT_EDITOR_ID);
|
||||||
|
|
||||||
Core::Command *command;
|
Command *command;
|
||||||
|
|
||||||
m_diffFileAction = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_diffFileAction = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_diffFileAction, CMD_ID_DIFF_CURRENT, context);
|
command = ActionManager::registerAction(m_diffFileAction, CMD_ID_DIFF_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDescription(tr("Diff Current File"));
|
command->setDescription(tr("Diff Current File"));
|
||||||
connect(m_diffFileAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
|
connect(m_diffFileAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
@@ -268,7 +268,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_annotateCurrentAction = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_annotateCurrentAction = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_annotateCurrentAction, CMD_ID_ANNOTATE_CURRENT, context);
|
command = ActionManager::registerAction(m_annotateCurrentAction, CMD_ID_ANNOTATE_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDescription(tr("Annotate Current File"));
|
command->setDescription(tr("Annotate Current File"));
|
||||||
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
|
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
@@ -276,7 +276,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, context);
|
command = ActionManager::registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+F") : tr("Alt+P,Alt+F")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+F") : tr("Alt+P,Alt+F")));
|
||||||
command->setDescription(tr("Filelog Current File"));
|
command->setDescription(tr("Filelog Current File"));
|
||||||
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));
|
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));
|
||||||
@@ -287,7 +287,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_editAction = new ParameterAction(tr("Edit"), tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_editAction = new ParameterAction(tr("Edit"), tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_editAction, CMD_ID_EDIT, context);
|
command = ActionManager::registerAction(m_editAction, CMD_ID_EDIT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+E") : tr("Alt+P,Alt+E")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+E") : tr("Alt+P,Alt+E")));
|
||||||
command->setDescription(tr("Edit File"));
|
command->setDescription(tr("Edit File"));
|
||||||
connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
|
connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
|
||||||
@@ -296,7 +296,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, context);
|
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+A") : tr("Alt+P,Alt+A")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+A") : tr("Alt+P,Alt+A")));
|
||||||
command->setDescription(tr("Add File"));
|
command->setDescription(tr("Add File"));
|
||||||
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
|
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
|
||||||
@@ -305,7 +305,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_deleteAction, CMD_ID_DELETE_FILE, context);
|
command = ActionManager::registerAction(m_deleteAction, CMD_ID_DELETE_FILE, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDescription(tr("Delete File"));
|
command->setDescription(tr("Delete File"));
|
||||||
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
|
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
@@ -313,7 +313,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_revertFileAction = new ParameterAction(tr("Revert"), tr("Revert \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_revertFileAction = new ParameterAction(tr("Revert"), tr("Revert \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_revertFileAction, CMD_ID_REVERT, context);
|
command = ActionManager::registerAction(m_revertFileAction, CMD_ID_REVERT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+R") : tr("Alt+P,Alt+R")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+R") : tr("Alt+P,Alt+R")));
|
||||||
command->setDescription(tr("Revert File"));
|
command->setDescription(tr("Revert File"));
|
||||||
connect(m_revertFileAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
|
connect(m_revertFileAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
|
||||||
@@ -325,7 +325,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
const QString diffProjectDefaultText = tr("Diff Current Project/Session");
|
const QString diffProjectDefaultText = tr("Diff Current Project/Session");
|
||||||
m_diffProjectAction = new ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), ParameterAction::AlwaysEnabled, this);
|
m_diffProjectAction = new ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), ParameterAction::AlwaysEnabled, this);
|
||||||
command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, context);
|
command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+D") : tr("Alt+P,Alt+D")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+D") : tr("Alt+P,Alt+D")));
|
||||||
command->setDescription(diffProjectDefaultText);
|
command->setDescription(diffProjectDefaultText);
|
||||||
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
|
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
|
||||||
@@ -334,14 +334,14 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context);
|
command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
|
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_submitProjectAction = new ParameterAction(tr("Submit Project"), tr("Submit Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_submitProjectAction = new ParameterAction(tr("Submit Project"), tr("Submit Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_submitProjectAction, CMD_ID_SUBMIT, context);
|
command = ActionManager::registerAction(m_submitProjectAction, CMD_ID_SUBMIT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+S") : tr("Alt+P,Alt+S")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+S") : tr("Alt+P,Alt+S")));
|
||||||
connect(m_submitProjectAction, SIGNAL(triggered()), this, SLOT(startSubmitProject()));
|
connect(m_submitProjectAction, SIGNAL(triggered()), this, SLOT(startSubmitProject()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
@@ -351,21 +351,21 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
m_updateProjectAction = new ParameterAction(updateProjectDefaultText, tr("Update Project \"%1\""), ParameterAction::AlwaysEnabled, this);
|
m_updateProjectAction = new ParameterAction(updateProjectDefaultText, tr("Update Project \"%1\""), ParameterAction::AlwaysEnabled, this);
|
||||||
command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE_PROJECT, context);
|
command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE_PROJECT, context);
|
||||||
command->setDescription(updateProjectDefaultText);
|
command->setDescription(updateProjectDefaultText);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateCurrentProject()));
|
connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateCurrentProject()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_revertUnchangedAction = new ParameterAction(tr("Revert Unchanged"), tr("Revert Unchanged Files of Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_revertUnchangedAction = new ParameterAction(tr("Revert Unchanged"), tr("Revert Unchanged Files of Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_revertUnchangedAction, CMD_ID_REVERT_UNCHANGED_PROJECT, context);
|
command = ActionManager::registerAction(m_revertUnchangedAction, CMD_ID_REVERT_UNCHANGED_PROJECT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_revertUnchangedAction, SIGNAL(triggered()), this, SLOT(revertUnchangedCurrentProject()));
|
connect(m_revertUnchangedAction, SIGNAL(triggered()), this, SLOT(revertUnchangedCurrentProject()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_revertProjectAction = new ParameterAction(tr("Revert Project"), tr("Revert Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_revertProjectAction = new ParameterAction(tr("Revert Project"), tr("Revert Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_revertProjectAction, CMD_ID_REVERT_PROJECT, context);
|
command = ActionManager::registerAction(m_revertProjectAction, CMD_ID_REVERT_PROJECT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_revertProjectAction, SIGNAL(triggered()), this, SLOT(revertCurrentProject()));
|
connect(m_revertProjectAction, SIGNAL(triggered()), this, SLOT(revertCurrentProject()));
|
||||||
perforceContainer->addAction(command);
|
perforceContainer->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -422,7 +422,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Submit"), this);
|
m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Submit"), this);
|
||||||
command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, perforcesubmitcontext);
|
command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, perforcesubmitcontext);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
||||||
|
|
||||||
m_diffSelectedFiles = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
m_diffSelectedFiles = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||||
@@ -734,7 +734,7 @@ void PerforcePlugin::annotate(const QString &workingDir,
|
|||||||
if (lineNumber < 1)
|
if (lineNumber < 1)
|
||||||
lineNumber = VcsBaseEditor::lineNumberOfCurrentEditor();
|
lineNumber = VcsBaseEditor::lineNumberOfCurrentEditor();
|
||||||
IEditor *ed = showOutputInEditor(tr("p4 annotate %1").arg(id),
|
IEditor *ed = showOutputInEditor(tr("p4 annotate %1").arg(id),
|
||||||
result.stdOut, VcsBase::AnnotateOutput,
|
result.stdOut, AnnotateOutput,
|
||||||
source, codec);
|
source, codec);
|
||||||
VcsBaseEditor::gotoLineOfEditor(ed, lineNumber);
|
VcsBaseEditor::gotoLineOfEditor(ed, lineNumber);
|
||||||
}
|
}
|
||||||
@@ -787,7 +787,7 @@ void PerforcePlugin::filelog(const QString &workingDir, const QString &fileName,
|
|||||||
if (!result.error) {
|
if (!result.error) {
|
||||||
const QString source = VcsBaseEditor::getSource(workingDir, fileName);
|
const QString source = VcsBaseEditor::getSource(workingDir, fileName);
|
||||||
IEditor *editor = showOutputInEditor(tr("p4 filelog %1").arg(id), result.stdOut,
|
IEditor *editor = showOutputInEditor(tr("p4 filelog %1").arg(id), result.stdOut,
|
||||||
VcsBase::LogOutput, source, codec);
|
LogOutput, source, codec);
|
||||||
if (enableAnnotationContextMenu)
|
if (enableAnnotationContextMenu)
|
||||||
VcsBaseEditor::getVcsBaseEditor(editor)->setFileLogAnnotateEnabled(true);
|
VcsBaseEditor::getVcsBaseEditor(editor)->setFileLogAnnotateEnabled(true);
|
||||||
}
|
}
|
||||||
@@ -809,7 +809,7 @@ void PerforcePlugin::changelists(const QString &workingDir, const QString &fileN
|
|||||||
if (!result.error) {
|
if (!result.error) {
|
||||||
const QString source = VcsBaseEditor::getSource(workingDir, fileName);
|
const QString source = VcsBaseEditor::getSource(workingDir, fileName);
|
||||||
IEditor *editor = showOutputInEditor(tr("p4 changelists %1").arg(id), result.stdOut,
|
IEditor *editor = showOutputInEditor(tr("p4 changelists %1").arg(id), result.stdOut,
|
||||||
VcsBase::LogOutput, source, codec);
|
LogOutput, source, codec);
|
||||||
VcsBaseEditor::gotoLineOfEditor(editor, 1);
|
VcsBaseEditor::gotoLineOfEditor(editor, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1286,7 +1286,7 @@ void PerforcePlugin::p4Diff(const PerforceDiffParameters &p)
|
|||||||
QTextCodec *codec = VcsBaseEditor::getCodec(p.workingDir, p.files);
|
QTextCodec *codec = VcsBaseEditor::getCodec(p.workingDir, p.files);
|
||||||
const QString id = VcsBaseEditor::getTitleId(p.workingDir, p.files);
|
const QString id = VcsBaseEditor::getTitleId(p.workingDir, p.files);
|
||||||
// Reuse existing editors for that id
|
// Reuse existing editors for that id
|
||||||
const QString tag = VcsBaseEditor::editorTag(VcsBase::DiffOutput, p.workingDir, p.files);
|
const QString tag = VcsBaseEditor::editorTag(DiffOutput, p.workingDir, p.files);
|
||||||
IEditor *existingEditor = VcsBaseEditor::locateEditorByTag(tag);
|
IEditor *existingEditor = VcsBaseEditor::locateEditorByTag(tag);
|
||||||
// Split arguments according to size
|
// Split arguments according to size
|
||||||
QStringList args;
|
QStringList args;
|
||||||
|
@@ -114,13 +114,13 @@ void SubversionClient::commit(const QString &repositoryRoot,
|
|||||||
cmd->execute();
|
cmd->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id SubversionClient::vcsEditorKind(VcsCommandTag cmd) const
|
Id SubversionClient::vcsEditorKind(VcsCommandTag cmd) const
|
||||||
{
|
{
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case VcsBaseClient::LogCommand: return Constants::SUBVERSION_LOG_EDITOR_ID;
|
case VcsBaseClient::LogCommand: return Constants::SUBVERSION_LOG_EDITOR_ID;
|
||||||
case VcsBaseClient::AnnotateCommand: return Constants::SUBVERSION_BLAME_EDITOR_ID;
|
case VcsBaseClient::AnnotateCommand: return Constants::SUBVERSION_BLAME_EDITOR_ID;
|
||||||
default:
|
default:
|
||||||
return Core::Id();
|
return Id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -280,12 +280,12 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
subversionMenu->menu()->setTitle(tr("&Subversion"));
|
subversionMenu->menu()->setTitle(tr("&Subversion"));
|
||||||
toolsContainer->addMenu(subversionMenu);
|
toolsContainer->addMenu(subversionMenu);
|
||||||
m_menuAction = subversionMenu->menu()->menuAction();
|
m_menuAction = subversionMenu->menu()->menuAction();
|
||||||
Core::Command *command;
|
Command *command;
|
||||||
|
|
||||||
m_diffCurrentAction = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_diffCurrentAction = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_diffCurrentAction,
|
command = ActionManager::registerAction(m_diffCurrentAction,
|
||||||
CMD_ID_DIFF_CURRENT, context);
|
CMD_ID_DIFF_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+D") : tr("Alt+S,Alt+D")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+D") : tr("Alt+S,Alt+D")));
|
||||||
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
|
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
@@ -294,7 +294,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_filelogCurrentAction,
|
command = ActionManager::registerAction(m_filelogCurrentAction,
|
||||||
CMD_ID_FILELOG_CURRENT, context);
|
CMD_ID_FILELOG_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_filelogCurrentAction, SIGNAL(triggered()), this,
|
connect(m_filelogCurrentAction, SIGNAL(triggered()), this,
|
||||||
SLOT(filelogCurrentFile()));
|
SLOT(filelogCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
@@ -303,7 +303,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_annotateCurrentAction = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_annotateCurrentAction = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_annotateCurrentAction,
|
command = ActionManager::registerAction(m_annotateCurrentAction,
|
||||||
CMD_ID_ANNOTATE_CURRENT, context);
|
CMD_ID_ANNOTATE_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_annotateCurrentAction, SIGNAL(triggered()), this,
|
connect(m_annotateCurrentAction, SIGNAL(triggered()), this,
|
||||||
SLOT(annotateCurrentFile()));
|
SLOT(annotateCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
@@ -314,7 +314,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD,
|
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD,
|
||||||
context);
|
context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+A") : tr("Alt+S,Alt+A")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+A") : tr("Alt+S,Alt+A")));
|
||||||
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
|
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
@@ -323,7 +323,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_commitCurrentAction = new ParameterAction(tr("Commit Current File"), tr("Commit \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_commitCurrentAction = new ParameterAction(tr("Commit Current File"), tr("Commit \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_commitCurrentAction,
|
command = ActionManager::registerAction(m_commitCurrentAction,
|
||||||
CMD_ID_COMMIT_CURRENT, context);
|
CMD_ID_COMMIT_CURRENT, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+C") : tr("Alt+S,Alt+C")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+C") : tr("Alt+S,Alt+C")));
|
||||||
connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
|
connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
@@ -332,7 +332,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_deleteAction, CMD_ID_DELETE_FILE,
|
command = ActionManager::registerAction(m_deleteAction, CMD_ID_DELETE_FILE,
|
||||||
context);
|
context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
|
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -340,7 +340,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_revertAction = new ParameterAction(tr("Revert..."), tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
m_revertAction = new ParameterAction(tr("Revert..."), tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_revertAction, CMD_ID_REVERT,
|
command = ActionManager::registerAction(m_revertAction, CMD_ID_REVERT,
|
||||||
context);
|
context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
|
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -350,7 +350,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_diffProjectAction = new ParameterAction(tr("Diff Project"), tr("Diff Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_diffProjectAction = new ParameterAction(tr("Diff Project"), tr("Diff Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT,
|
command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT,
|
||||||
context);
|
context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffProject()));
|
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffProject()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -358,14 +358,14 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_statusProjectAction = new ParameterAction(tr("Project Status"), tr("Status of Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_statusProjectAction = new ParameterAction(tr("Project Status"), tr("Status of Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_statusProjectAction, CMD_ID_STATUS,
|
command = ActionManager::registerAction(m_statusProjectAction, CMD_ID_STATUS,
|
||||||
context);
|
context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(projectStatus()));
|
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(projectStatus()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context);
|
command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
|
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
@@ -373,14 +373,14 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_updateProjectAction = new ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_updateProjectAction = new ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE, context);
|
command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE, context);
|
||||||
connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateProject()));
|
connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateProject()));
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
m_commitProjectAction = new ParameterAction(tr("Commit Project"), tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
m_commitProjectAction = new ParameterAction(tr("Commit Project"), tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this);
|
||||||
command = ActionManager::registerAction(m_commitProjectAction, CMD_ID_COMMIT_PROJECT, context);
|
command = ActionManager::registerAction(m_commitProjectAction, CMD_ID_COMMIT_PROJECT, context);
|
||||||
connect(m_commitProjectAction, SIGNAL(triggered()), this, SLOT(startCommitProject()));
|
connect(m_commitProjectAction, SIGNAL(triggered()), this, SLOT(startCommitProject()));
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
subversionMenu->addAction(command);
|
subversionMenu->addAction(command);
|
||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
@@ -434,7 +434,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
|
|
||||||
m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, svncommitcontext);
|
command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, svncommitcontext);
|
||||||
command->setAttribute(Core::Command::CA_UpdateText);
|
command->setAttribute(Command::CA_UpdateText);
|
||||||
connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
||||||
|
|
||||||
m_submitDiffAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
m_submitDiffAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||||
|
@@ -801,7 +801,7 @@ void VcsBasePlugin::setProcessEnvironment(QProcessEnvironment *e,
|
|||||||
// Run a process synchronously, returning Utils::SynchronousProcessResponse
|
// Run a process synchronously, returning Utils::SynchronousProcessResponse
|
||||||
// response struct and using the VcsBasePlugin flags as applicable
|
// response struct and using the VcsBasePlugin flags as applicable
|
||||||
SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir,
|
SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir,
|
||||||
const Utils::FileName &binary,
|
const FileName &binary,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
int timeOutMS,
|
int timeOutMS,
|
||||||
unsigned flags,
|
unsigned flags,
|
||||||
|
@@ -186,7 +186,7 @@ VcsBaseSubmitEditor::VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *pa
|
|||||||
document()->setDisplayName(QCoreApplication::translate("VCS", d->m_parameters->displayName));
|
document()->setDisplayName(QCoreApplication::translate("VCS", d->m_parameters->displayName));
|
||||||
|
|
||||||
// Message font according to settings
|
// Message font according to settings
|
||||||
Utils::CompletingTextEdit *descriptionEdit = editorWidget->descriptionEdit();
|
CompletingTextEdit *descriptionEdit = editorWidget->descriptionEdit();
|
||||||
const TextEditor::FontSettings fs = TextEditor::TextEditorSettings::fontSettings();
|
const TextEditor::FontSettings fs = TextEditor::TextEditorSettings::fontSettings();
|
||||||
const QTextCharFormat tf = fs.toTextCharFormat(TextEditor::C_TEXT);
|
const QTextCharFormat tf = fs.toTextCharFormat(TextEditor::C_TEXT);
|
||||||
descriptionEdit->setFont(tf.font());
|
descriptionEdit->setFont(tf.font());
|
||||||
@@ -279,7 +279,7 @@ static inline QStringList fieldTexts(const QString &fileContents)
|
|||||||
|
|
||||||
void VcsBaseSubmitEditor::createUserFields(const QString &fieldConfigFile)
|
void VcsBaseSubmitEditor::createUserFields(const QString &fieldConfigFile)
|
||||||
{
|
{
|
||||||
Utils::FileReader reader;
|
FileReader reader;
|
||||||
if (!reader.fetch(fieldConfigFile, QIODevice::Text, Core::ICore::mainWindow()))
|
if (!reader.fetch(fieldConfigFile, QIODevice::Text, Core::ICore::mainWindow()))
|
||||||
return;
|
return;
|
||||||
// Parse into fields
|
// Parse into fields
|
||||||
@@ -364,7 +364,7 @@ bool VcsBaseSubmitEditor::open(QString *errorString, const QString &fileName, co
|
|||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Utils::FileReader reader;
|
FileReader reader;
|
||||||
if (!reader.fetch(realFileName, QIODevice::Text, errorString))
|
if (!reader.fetch(realFileName, QIODevice::Text, errorString))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ bool VcsBaseSubmitEditor::open(QString *errorString, const QString &fileName, co
|
|||||||
if (!setFileContents(text.toUtf8()))
|
if (!setFileContents(text.toUtf8()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
d->m_file->setFilePath(Utils::FileName::fromString(fileName));
|
d->m_file->setFilePath(FileName::fromString(fileName));
|
||||||
d->m_file->setModified(fileName != realFileName);
|
d->m_file->setModified(fileName != realFileName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -565,12 +565,12 @@ VcsBaseSubmitEditor::PromptSubmitResult
|
|||||||
// Provide check box to turn off prompt ONLY if it was not forced
|
// Provide check box to turn off prompt ONLY if it was not forced
|
||||||
if (*promptSetting && !forcePrompt) {
|
if (*promptSetting && !forcePrompt) {
|
||||||
const QDialogButtonBox::StandardButton danswer =
|
const QDialogButtonBox::StandardButton danswer =
|
||||||
Utils::CheckableMessageBox::question(parent, title, question,
|
CheckableMessageBox::question(parent, title, question,
|
||||||
tr("Prompt to submit"), promptSetting,
|
tr("Prompt to submit"), promptSetting,
|
||||||
QDialogButtonBox::Yes|QDialogButtonBox::No|
|
QDialogButtonBox::Yes|QDialogButtonBox::No|
|
||||||
QDialogButtonBox::Cancel,
|
QDialogButtonBox::Cancel,
|
||||||
QDialogButtonBox::Yes);
|
QDialogButtonBox::Yes);
|
||||||
answer = Utils::CheckableMessageBox::dialogButtonBoxToMessageBoxButton(danswer);
|
answer = CheckableMessageBox::dialogButtonBoxToMessageBoxButton(danswer);
|
||||||
} else {
|
} else {
|
||||||
answer = QMessageBox::question(parent, title, question,
|
answer = QMessageBox::question(parent, title, question,
|
||||||
QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel,
|
QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel,
|
||||||
|
@@ -78,7 +78,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
|
|
||||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/vcsbase/VcsBase.mimetypes.xml"), errorMessage))
|
if (!MimeDatabase::addMimeTypes(QLatin1String(":/vcsbase/VcsBase.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_coreListener = new CoreListener;
|
m_coreListener = new CoreListener;
|
||||||
|
Reference in New Issue
Block a user