forked from qt-creator/qt-creator
VCSBase: Modernize
override, auto, nullptr, member initializers. Change-Id: Ie21b8f4a4d6673947d82619bc3de677fcea63d7f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
e0520794f5
commit
8f65486dfc
@@ -213,7 +213,8 @@ void CleanDialog::addFile(const QString &workingDirectory, QString fileName, boo
|
||||
// Tooltip with size information
|
||||
if (fi.isFile()) {
|
||||
const QString lastModified = fi.lastModified().toString(Qt::DefaultLocaleShortDate);
|
||||
nameItem->setToolTip(tr("%n bytes, last modified %1.", 0, fi.size()).arg(lastModified));
|
||||
nameItem->setToolTip(tr("%n bytes, last modified %1.", nullptr,
|
||||
fi.size()).arg(lastModified));
|
||||
}
|
||||
d->m_filesModel->appendRow(nameItem);
|
||||
}
|
||||
@@ -245,7 +246,7 @@ bool CleanDialog::promptToDelete()
|
||||
return true;
|
||||
|
||||
if (QMessageBox::question(this, tr("Delete"),
|
||||
tr("Do you want to delete %n files?", 0, selectedFiles.size()),
|
||||
tr("Do you want to delete %n files?", nullptr, selectedFiles.size()),
|
||||
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) != QMessageBox::Yes)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class CommonSettingsWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommonSettingsWidget(QWidget *parent = 0);
|
||||
explicit CommonSettingsWidget(QWidget *parent = nullptr);
|
||||
~CommonSettingsWidget() override;
|
||||
|
||||
CommonVcsSettings settings() const;
|
||||
@@ -59,7 +59,7 @@ class CommonOptionsPage : public VcsBaseOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommonOptionsPage(QObject *parent = 0);
|
||||
explicit CommonOptionsPage(QObject *parent = nullptr);
|
||||
|
||||
QWidget *widget() override;
|
||||
void apply() override;
|
||||
|
||||
@@ -142,7 +142,7 @@ void DiffAndLogHighlighterPrivate::updateOtherFormats()
|
||||
|
||||
// --- DiffAndLogHighlighter
|
||||
DiffAndLogHighlighter::DiffAndLogHighlighter(const QRegExp &filePattern, const QRegExp &changePattern) :
|
||||
TextEditor::SyntaxHighlighter(static_cast<QTextDocument *>(0)),
|
||||
TextEditor::SyntaxHighlighter(static_cast<QTextDocument *>(nullptr)),
|
||||
d(new DiffAndLogHighlighterPrivate(this, filePattern, changePattern))
|
||||
{
|
||||
setDefaultTextFormatCategories();
|
||||
|
||||
@@ -44,7 +44,7 @@ class NickNameDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NickNameDialog(QStandardItemModel *model, QWidget *parent = 0);
|
||||
explicit NickNameDialog(QStandardItemModel *model, QWidget *parent = nullptr);
|
||||
~NickNameDialog() override;
|
||||
|
||||
QString nickName() const;
|
||||
|
||||
@@ -38,7 +38,7 @@ class SubmitEditorFile : public Core::IDocument
|
||||
{
|
||||
public:
|
||||
explicit SubmitEditorFile(const VcsBaseSubmitEditorParameters *parameters,
|
||||
VcsBaseSubmitEditor *parent = 0);
|
||||
VcsBaseSubmitEditor *parent = nullptr);
|
||||
|
||||
OpenResult open(QString *errorString, const QString &fileName,
|
||||
const QString &realFileName) override;
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void setText(const QString &t) {
|
||||
if (QAction *action = qobject_cast<QAction *>(parent()))
|
||||
if (auto action = qobject_cast<QAction *>(parent()))
|
||||
action->setText(t);
|
||||
}
|
||||
};
|
||||
@@ -128,42 +128,25 @@ struct SubmitEditorWidgetPrivate
|
||||
// A pair of position/action to extend context menus
|
||||
typedef QPair<int, QPointer<QAction> > AdditionalContextMenuAction;
|
||||
|
||||
SubmitEditorWidgetPrivate();
|
||||
|
||||
Ui::SubmitEditorWidget m_ui;
|
||||
bool m_filesSelected;
|
||||
int m_activatedRow;
|
||||
bool m_emptyFileListEnabled;
|
||||
|
||||
QList<AdditionalContextMenuAction> descriptionEditContextMenuActions;
|
||||
QVBoxLayout *m_fieldLayout;
|
||||
QVBoxLayout *m_fieldLayout = nullptr;
|
||||
QList<SubmitFieldWidget *> m_fieldWidgets;
|
||||
QShortcut *m_submitShortcut;
|
||||
int m_lineWidth;
|
||||
|
||||
bool m_commitEnabled;
|
||||
bool m_ignoreChange;
|
||||
bool m_descriptionMandatory;
|
||||
bool m_updateInProgress;
|
||||
QShortcut *m_submitShortcut = nullptr;
|
||||
QActionPushButton *m_submitButton = nullptr;
|
||||
QString m_description;
|
||||
|
||||
QActionPushButton *m_submitButton;
|
||||
};
|
||||
int m_lineWidth = defaultLineWidth;
|
||||
int m_activatedRow = -1;
|
||||
|
||||
SubmitEditorWidgetPrivate::SubmitEditorWidgetPrivate() :
|
||||
m_filesSelected(false),
|
||||
m_activatedRow(-1),
|
||||
m_emptyFileListEnabled(false),
|
||||
m_fieldLayout(0),
|
||||
m_submitShortcut(0),
|
||||
m_lineWidth(defaultLineWidth),
|
||||
m_commitEnabled(false),
|
||||
m_ignoreChange(false),
|
||||
m_descriptionMandatory(true),
|
||||
m_updateInProgress(false),
|
||||
m_submitButton(0)
|
||||
{
|
||||
}
|
||||
bool m_filesSelected = false;
|
||||
bool m_emptyFileListEnabled = false;
|
||||
bool m_commitEnabled = false;
|
||||
bool m_ignoreChange = false;
|
||||
bool m_descriptionMandatory = true;
|
||||
bool m_updateInProgress = false;
|
||||
};
|
||||
|
||||
SubmitEditorWidget::SubmitEditorWidget() :
|
||||
d(new SubmitEditorWidgetPrivate)
|
||||
@@ -224,8 +207,7 @@ void SubmitEditorWidget::registerActions(QAction *editorUndoAction, QAction *edi
|
||||
connect(this, &SubmitEditorWidget::submitActionEnabledChanged,
|
||||
submitAction, &QAction::setEnabled);
|
||||
// Wire setText via QActionSetTextSlotHelper.
|
||||
QActionSetTextSlotHelper *actionSlotHelper
|
||||
= submitAction->findChild<QActionSetTextSlotHelper *>();
|
||||
auto actionSlotHelper = submitAction->findChild<QActionSetTextSlotHelper *>();
|
||||
if (!actionSlotHelper)
|
||||
actionSlotHelper = new QActionSetTextSlotHelper(submitAction);
|
||||
connect(this, &SubmitEditorWidget::submitActionTextChanged,
|
||||
@@ -463,7 +445,7 @@ void SubmitEditorWidget::updateSubmitAction()
|
||||
// Update button text.
|
||||
const int fileCount = d->m_ui.fileView->model()->rowCount();
|
||||
const QString msg = checkedCount ?
|
||||
tr("%1 %2/%n File(s)", 0, fileCount)
|
||||
tr("%1 %2/%n File(s)", nullptr, fileCount)
|
||||
.arg(commitName()).arg(checkedCount) :
|
||||
commitName();
|
||||
emit submitActionTextChanged(msg);
|
||||
|
||||
@@ -65,30 +65,18 @@ namespace VcsBase {
|
||||
|
||||
// Field/Row entry
|
||||
struct FieldEntry {
|
||||
FieldEntry();
|
||||
void createGui(const QIcon &removeIcon);
|
||||
void deleteGuiLater();
|
||||
|
||||
QComboBox *combo;
|
||||
QHBoxLayout *layout;
|
||||
QLineEdit *lineEdit;
|
||||
QToolBar *toolBar;
|
||||
QToolButton *clearButton;
|
||||
QToolButton *browseButton;
|
||||
int comboIndex;
|
||||
QComboBox *combo = nullptr;
|
||||
QHBoxLayout *layout = nullptr;
|
||||
QLineEdit *lineEdit = nullptr;
|
||||
QToolBar *toolBar = nullptr;
|
||||
QToolButton *clearButton = nullptr;
|
||||
QToolButton *browseButton = nullptr;
|
||||
int comboIndex = 0;
|
||||
};
|
||||
|
||||
FieldEntry::FieldEntry() :
|
||||
combo(0),
|
||||
layout(0),
|
||||
lineEdit(0),
|
||||
toolBar(0),
|
||||
clearButton(0),
|
||||
browseButton(0),
|
||||
comboIndex(0)
|
||||
{
|
||||
}
|
||||
|
||||
void FieldEntry::createGui(const QIcon &removeIcon)
|
||||
{
|
||||
layout = new QHBoxLayout;
|
||||
@@ -131,20 +119,17 @@ struct SubmitFieldWidgetPrivate {
|
||||
|
||||
const QIcon removeFieldIcon;
|
||||
QStringList fields;
|
||||
QCompleter *completer;
|
||||
bool hasBrowseButton;
|
||||
bool allowDuplicateFields;
|
||||
QCompleter *completer = nullptr;
|
||||
|
||||
QList <FieldEntry> fieldEntries;
|
||||
QVBoxLayout *layout;
|
||||
QVBoxLayout *layout = nullptr;
|
||||
|
||||
bool hasBrowseButton = false;
|
||||
bool allowDuplicateFields = false;
|
||||
};
|
||||
|
||||
SubmitFieldWidgetPrivate::SubmitFieldWidgetPrivate() :
|
||||
removeFieldIcon(Utils::Icons::BROKEN.icon()),
|
||||
completer(0),
|
||||
hasBrowseButton(false),
|
||||
allowDuplicateFields(false),
|
||||
layout(0)
|
||||
removeFieldIcon(Utils::Icons::BROKEN.icon())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class VCSBASE_EXPORT SubmitFieldWidget : public QWidget
|
||||
Q_PROPERTY(bool allowDuplicateFields READ allowDuplicateFields WRITE setAllowDuplicateFields DESIGNABLE true)
|
||||
|
||||
public:
|
||||
explicit SubmitFieldWidget(QWidget *parent = 0);
|
||||
explicit SubmitFieldWidget(QWidget *parent = nullptr);
|
||||
~SubmitFieldWidget() override;
|
||||
|
||||
QStringList fields() const;
|
||||
|
||||
@@ -68,7 +68,7 @@ static Core::IEditor *locateEditor(const char *property, const QString &entry)
|
||||
foreach (Core::IDocument *document, Core::DocumentModel::openedDocuments())
|
||||
if (document->property(property).toString() == entry)
|
||||
return Core::DocumentModel::editorsForDocument(document).first();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
namespace VcsBase {
|
||||
@@ -247,20 +247,20 @@ VcsBaseEditorWidget *VcsBaseClientImpl::createVcsEditor(Core::Id kind, QString t
|
||||
const char *registerDynamicProperty,
|
||||
const QString &dynamicPropertyValue) const
|
||||
{
|
||||
VcsBaseEditorWidget *baseEditor = 0;
|
||||
VcsBaseEditorWidget *baseEditor = nullptr;
|
||||
Core::IEditor *outputEditor = locateEditor(registerDynamicProperty, dynamicPropertyValue);
|
||||
const QString progressMsg = tr("Working...");
|
||||
if (outputEditor) {
|
||||
// Exists already
|
||||
outputEditor->document()->setContents(progressMsg.toUtf8());
|
||||
baseEditor = VcsBaseEditor::getVcsBaseEditor(outputEditor);
|
||||
QTC_ASSERT(baseEditor, return 0);
|
||||
QTC_ASSERT(baseEditor, return nullptr);
|
||||
Core::EditorManager::activateEditor(outputEditor);
|
||||
} else {
|
||||
outputEditor = Core::EditorManager::openEditorWithContents(kind, &title, progressMsg.toUtf8());
|
||||
outputEditor->document()->setProperty(registerDynamicProperty, dynamicPropertyValue);
|
||||
baseEditor = VcsBaseEditor::getVcsBaseEditor(outputEditor);
|
||||
QTC_ASSERT(baseEditor, return 0);
|
||||
QTC_ASSERT(baseEditor, return nullptr);
|
||||
connect(baseEditor, &VcsBaseEditorWidget::annotateRevisionRequested,
|
||||
this, &VcsBaseClientImpl::annotateRevisionRequested);
|
||||
baseEditor->setSource(source);
|
||||
@@ -455,7 +455,8 @@ void VcsBaseClient::diff(const QString &workingDir, const QStringList &files,
|
||||
else
|
||||
args << extraOptions;
|
||||
args << files;
|
||||
QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(0) : VcsBaseEditor::getCodec(source);
|
||||
QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(nullptr)
|
||||
: VcsBaseEditor::getCodec(source);
|
||||
VcsCommand *command = createCommand(workingDir, editor);
|
||||
command->setCodec(codec);
|
||||
enqueueJob(command, args, workingDir, exitCodeInterpreter(DiffCommand));
|
||||
@@ -528,7 +529,7 @@ void VcsBaseClient::status(const QString &workingDir, const QString &file,
|
||||
QStringList args(vcsCommandString(StatusCommand));
|
||||
args << extraOptions << file;
|
||||
VcsOutputWindow::setRepository(workingDir);
|
||||
VcsCommand *cmd = createCommand(workingDir, 0, VcsWindowOutputBind);
|
||||
VcsCommand *cmd = createCommand(workingDir, nullptr, VcsWindowOutputBind);
|
||||
connect(cmd, &VcsCommand::finished,
|
||||
VcsOutputWindow::instance(), &VcsOutputWindow::clearRepository,
|
||||
Qt::QueuedConnection);
|
||||
@@ -632,7 +633,7 @@ void VcsBaseClient::commit(const QString &repositoryRoot,
|
||||
// for example)
|
||||
QStringList args(vcsCommandString(CommitCommand));
|
||||
args << extraOptions << files;
|
||||
VcsCommand *cmd = createCommand(repositoryRoot, 0, VcsWindowOutputBind);
|
||||
VcsCommand *cmd = createCommand(repositoryRoot, nullptr, VcsWindowOutputBind);
|
||||
if (!commitMessageFile.isEmpty())
|
||||
connect(cmd, &VcsCommand::finished, [commitMessageFile]() { QFile(commitMessageFile).remove(); });
|
||||
enqueueJob(cmd, args);
|
||||
|
||||
@@ -48,10 +48,7 @@ public:
|
||||
bool boolValue;
|
||||
};
|
||||
|
||||
SettingValue() :
|
||||
m_type(QVariant::Invalid)
|
||||
{
|
||||
}
|
||||
SettingValue() = default;
|
||||
|
||||
explicit SettingValue(const QVariant &v) :
|
||||
m_type(v.type())
|
||||
@@ -100,7 +97,7 @@ public:
|
||||
|
||||
QString stringValue(const QString &defaultString = QString()) const
|
||||
{
|
||||
if (type() == QVariant::String && m_comp.strPtr != 0)
|
||||
if (type() == QVariant::String && m_comp.strPtr != nullptr)
|
||||
return *(m_comp.strPtr);
|
||||
return defaultString;
|
||||
}
|
||||
@@ -121,9 +118,9 @@ public:
|
||||
private:
|
||||
void deleteInternalString()
|
||||
{
|
||||
if (m_type == QVariant::String && m_comp.strPtr != 0) {
|
||||
if (m_type == QVariant::String && m_comp.strPtr != nullptr) {
|
||||
delete m_comp.strPtr;
|
||||
m_comp.strPtr = 0;
|
||||
m_comp.strPtr = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +128,11 @@ private:
|
||||
{
|
||||
if (type() == QVariant::String) {
|
||||
const QString *otherString = other.m_comp.strPtr;
|
||||
m_comp.strPtr = new QString(otherString != 0 ? *otherString : QString());
|
||||
m_comp.strPtr = new QString(otherString != nullptr ? *otherString : QString());
|
||||
}
|
||||
}
|
||||
|
||||
QVariant::Type m_type;
|
||||
QVariant::Type m_type = QVariant::Invalid;
|
||||
};
|
||||
|
||||
bool operator==(const SettingValue &lhs, const SettingValue &rhs)
|
||||
@@ -285,21 +282,21 @@ int *VcsBaseClientSettings::intPointer(const QString &key)
|
||||
{
|
||||
if (hasKey(key))
|
||||
return &(d->m_valueHash[key].m_comp.intValue);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool *VcsBaseClientSettings::boolPointer(const QString &key)
|
||||
{
|
||||
if (hasKey(key))
|
||||
return &(d->m_valueHash[key].m_comp.boolValue);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString *VcsBaseClientSettings::stringPointer(const QString &key)
|
||||
{
|
||||
if (hasKey(key) && valueType(key) == QVariant::String)
|
||||
return d->m_valueHash[key].m_comp.strPtr;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int VcsBaseClientSettings::intValue(const QString &key, int defaultValue) const
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Internal {
|
||||
class AbstractTextCursorHandler : public QObject
|
||||
{
|
||||
public:
|
||||
AbstractTextCursorHandler(VcsBaseEditorWidget *editorWidget = 0);
|
||||
AbstractTextCursorHandler(VcsBaseEditorWidget *editorWidget = nullptr);
|
||||
|
||||
/*! Tries to find some matching contents under \a cursor.
|
||||
*
|
||||
@@ -240,13 +240,13 @@ class ChangeTextCursorHandler : public AbstractTextCursorHandler
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ChangeTextCursorHandler(VcsBaseEditorWidget *editorWidget = 0);
|
||||
ChangeTextCursorHandler(VcsBaseEditorWidget *editorWidget = nullptr);
|
||||
|
||||
bool findContentsUnderCursor(const QTextCursor &cursor);
|
||||
void highlightCurrentContents();
|
||||
void handleCurrentContents();
|
||||
QString currentContents() const;
|
||||
void fillContextMenu(QMenu *menu, EditorContentType type) const;
|
||||
bool findContentsUnderCursor(const QTextCursor &cursor) override;
|
||||
void highlightCurrentContents() override;
|
||||
void handleCurrentContents() override;
|
||||
QString currentContents() const override;
|
||||
void fillContextMenu(QMenu *menu, EditorContentType type) const override;
|
||||
|
||||
private slots:
|
||||
void slotDescribe();
|
||||
@@ -336,7 +336,7 @@ void ChangeTextCursorHandler::slotCopyRevision()
|
||||
|
||||
QAction *ChangeTextCursorHandler::createDescribeAction(const QString &change) const
|
||||
{
|
||||
auto a = new QAction(VcsBaseEditorWidget::tr("&Describe Change %1").arg(change), 0);
|
||||
auto a = new QAction(VcsBaseEditorWidget::tr("&Describe Change %1").arg(change), nullptr);
|
||||
connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotDescribe);
|
||||
return a;
|
||||
}
|
||||
@@ -348,7 +348,7 @@ QAction *ChangeTextCursorHandler::createAnnotateAction(const QString &change, bo
|
||||
previous && !editorWidget()->annotatePreviousRevisionTextFormat().isEmpty() ?
|
||||
editorWidget()->annotatePreviousRevisionTextFormat() :
|
||||
editorWidget()->annotateRevisionTextFormat();
|
||||
auto a = new QAction(format.arg(change), 0);
|
||||
auto a = new QAction(format.arg(change), nullptr);
|
||||
a->setData(change);
|
||||
connect(a, &QAction::triggered, editorWidget(), &VcsBaseEditorWidget::slotAnnotateRevision);
|
||||
return a;
|
||||
@@ -356,7 +356,7 @@ QAction *ChangeTextCursorHandler::createAnnotateAction(const QString &change, bo
|
||||
|
||||
QAction *ChangeTextCursorHandler::createCopyRevisionAction(const QString &change) const
|
||||
{
|
||||
auto a = new QAction(editorWidget()->copyRevisionTextFormat().arg(change), 0);
|
||||
auto a = new QAction(editorWidget()->copyRevisionTextFormat().arg(change), nullptr);
|
||||
a->setData(change);
|
||||
connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotCopyRevision);
|
||||
return a;
|
||||
@@ -374,13 +374,13 @@ class UrlTextCursorHandler : public AbstractTextCursorHandler
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UrlTextCursorHandler(VcsBaseEditorWidget *editorWidget = 0);
|
||||
UrlTextCursorHandler(VcsBaseEditorWidget *editorWidget = nullptr);
|
||||
|
||||
bool findContentsUnderCursor(const QTextCursor &cursor);
|
||||
void highlightCurrentContents();
|
||||
void handleCurrentContents();
|
||||
void fillContextMenu(QMenu *menu, EditorContentType type) const;
|
||||
QString currentContents() const;
|
||||
bool findContentsUnderCursor(const QTextCursor &cursor) override;
|
||||
void highlightCurrentContents() override;
|
||||
void handleCurrentContents() override;
|
||||
void fillContextMenu(QMenu *menu, EditorContentType type) const override;
|
||||
QString currentContents() const override;
|
||||
|
||||
protected slots:
|
||||
virtual void slotCopyUrl();
|
||||
@@ -488,7 +488,7 @@ void UrlTextCursorHandler::slotOpenUrl()
|
||||
|
||||
QAction *UrlTextCursorHandler::createOpenUrlAction(const QString &text) const
|
||||
{
|
||||
auto a = new QAction(text, 0);
|
||||
auto a = new QAction(text);
|
||||
a->setData(m_urlData.url);
|
||||
connect(a, &QAction::triggered, this, &UrlTextCursorHandler::slotOpenUrl);
|
||||
return a;
|
||||
@@ -496,7 +496,7 @@ QAction *UrlTextCursorHandler::createOpenUrlAction(const QString &text) const
|
||||
|
||||
QAction *UrlTextCursorHandler::createCopyUrlAction(const QString &text) const
|
||||
{
|
||||
auto a = new QAction(text, 0);
|
||||
auto a = new QAction(text);
|
||||
a->setData(m_urlData.url);
|
||||
connect(a, &QAction::triggered, this, &UrlTextCursorHandler::slotCopyUrl);
|
||||
return a;
|
||||
@@ -511,11 +511,11 @@ class EmailTextCursorHandler : public UrlTextCursorHandler
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EmailTextCursorHandler(VcsBaseEditorWidget *editorWidget = 0);
|
||||
void fillContextMenu(QMenu *menu, EditorContentType type) const;
|
||||
EmailTextCursorHandler(VcsBaseEditorWidget *editorWidget = nullptr);
|
||||
void fillContextMenu(QMenu *menu, EditorContentType type) const override;
|
||||
|
||||
protected slots:
|
||||
void slotOpenUrl();
|
||||
void slotOpenUrl() override;
|
||||
};
|
||||
|
||||
EmailTextCursorHandler::EmailTextCursorHandler(VcsBaseEditorWidget *editorWidget)
|
||||
@@ -588,7 +588,7 @@ AbstractTextCursorHandler *VcsBaseEditorWidgetPrivate::findTextCursorHandler(con
|
||||
if (handler->findContentsUnderCursor(cursor))
|
||||
return handler;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QComboBox *VcsBaseEditorWidgetPrivate::entriesComboBox()
|
||||
@@ -643,7 +643,7 @@ VcsBaseEditorWidget::VcsBaseEditorWidget()
|
||||
|
||||
void VcsBaseEditorWidget::setParameters(const VcsBaseEditorParameters *parameters)
|
||||
{
|
||||
QTC_CHECK(d->m_parameters == 0);
|
||||
QTC_CHECK(d->m_parameters == nullptr);
|
||||
d->m_parameters = parameters;
|
||||
}
|
||||
|
||||
@@ -756,7 +756,7 @@ void VcsBaseEditorWidget::init()
|
||||
|
||||
VcsBaseEditorWidget::~VcsBaseEditorWidget()
|
||||
{
|
||||
setCommand(0); // abort all running commands
|
||||
setCommand(nullptr); // abort all running commands
|
||||
delete d;
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ void VcsBaseEditorWidget::mouseMoveEvent(QMouseEvent *e)
|
||||
// Link emulation behaviour for 'click on change-interaction'
|
||||
const QTextCursor cursor = cursorForPosition(e->pos());
|
||||
Internal::AbstractTextCursorHandler *handler = d->findTextCursorHandler(cursor);
|
||||
if (handler != 0) {
|
||||
if (handler != nullptr) {
|
||||
handler->highlightCurrentContents();
|
||||
overrideCursor = true;
|
||||
cursorShape = Qt::PointingHandCursor;
|
||||
@@ -1036,7 +1036,7 @@ void VcsBaseEditorWidget::mouseReleaseEvent(QMouseEvent *e)
|
||||
if (e->button() == Qt::LeftButton &&!(e->modifiers() & Qt::ShiftModifier)) {
|
||||
const QTextCursor cursor = cursorForPosition(e->pos());
|
||||
Internal::AbstractTextCursorHandler *handler = d->findTextCursorHandler(cursor);
|
||||
if (handler != 0) {
|
||||
if (handler != nullptr) {
|
||||
handler->handleCurrentContents();
|
||||
e->accept();
|
||||
return;
|
||||
@@ -1078,7 +1078,7 @@ void VcsBaseEditorWidget::slotActivateAnnotation()
|
||||
|
||||
disconnect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotActivateAnnotation);
|
||||
|
||||
if (BaseAnnotationHighlighter *ah = qobject_cast<BaseAnnotationHighlighter *>(textDocument()->syntaxHighlighter())) {
|
||||
if (auto ah = qobject_cast<BaseAnnotationHighlighter *>(textDocument()->syntaxHighlighter())) {
|
||||
ah->setChangeNumbers(changes);
|
||||
ah->rehighlight();
|
||||
} else {
|
||||
@@ -1162,7 +1162,7 @@ void VcsBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor)
|
||||
return;
|
||||
|
||||
Core::IEditor *ed = Core::EditorManager::openEditor(fileName);
|
||||
if (BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(ed))
|
||||
if (auto editor = qobject_cast<BaseTextEditor *>(ed))
|
||||
editor->gotoLine(chunkStart + lineCount);
|
||||
}
|
||||
|
||||
@@ -1230,16 +1230,16 @@ const VcsBaseEditorParameters *VcsBaseEditor::findType(const VcsBaseEditorParame
|
||||
for (int i = 0; i < arraySize; i++)
|
||||
if (array[i].type == et)
|
||||
return array + i;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Find the codec used for a file querying the editor.
|
||||
static QTextCodec *findFileCodec(const QString &source)
|
||||
{
|
||||
Core::IDocument *document = Core::DocumentModel::documentForFilePath(source);
|
||||
if (Core::BaseTextDocument *textDocument = qobject_cast<Core::BaseTextDocument *>(document))
|
||||
if (auto textDocument = qobject_cast<Core::BaseTextDocument *>(document))
|
||||
return const_cast<QTextCodec *>(textDocument->codec());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Find the codec by checking the projects (root dir of project file)
|
||||
@@ -1285,9 +1285,9 @@ QTextCodec *VcsBaseEditor::getCodec(const QString &workingDirectory, const QStri
|
||||
|
||||
VcsBaseEditorWidget *VcsBaseEditor::getVcsBaseEditor(const Core::IEditor *editor)
|
||||
{
|
||||
if (const BaseTextEditor *be = qobject_cast<const BaseTextEditor *>(editor))
|
||||
if (auto be = qobject_cast<const BaseTextEditor *>(editor))
|
||||
return qobject_cast<VcsBaseEditorWidget *>(be->editorWidget());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Return line number of current editor if it matches.
|
||||
@@ -1301,12 +1301,11 @@ int VcsBaseEditor::lineNumberOfCurrentEditor(const QString ¤tFile)
|
||||
if (!idocument || idocument->filePath().toString() != currentFile)
|
||||
return -1;
|
||||
}
|
||||
const BaseTextEditor *eda = qobject_cast<const BaseTextEditor *>(ed);
|
||||
auto eda = qobject_cast<const BaseTextEditor *>(ed);
|
||||
if (!eda)
|
||||
return -1;
|
||||
const int cursorLine = eda->textCursor().blockNumber() + 1;
|
||||
auto const edw = qobject_cast<const TextEditorWidget *>(ed->widget());
|
||||
if (edw) {
|
||||
if (auto edw = qobject_cast<const TextEditorWidget *>(ed->widget())) {
|
||||
const int firstLine = edw->firstVisibleBlockNumber() + 1;
|
||||
const int lastLine = edw->lastVisibleBlockNumber() + 1;
|
||||
if (firstLine <= cursorLine && cursorLine < lastLine)
|
||||
@@ -1319,7 +1318,7 @@ int VcsBaseEditor::lineNumberOfCurrentEditor(const QString ¤tFile)
|
||||
bool VcsBaseEditor::gotoLineOfEditor(Core::IEditor *e, int lineNumber)
|
||||
{
|
||||
if (lineNumber >= 0 && e) {
|
||||
if (BaseTextEditor *be = qobject_cast<BaseTextEditor*>(e)) {
|
||||
if (auto be = qobject_cast<BaseTextEditor*>(e)) {
|
||||
be->gotoLine(lineNumber);
|
||||
return true;
|
||||
}
|
||||
@@ -1462,7 +1461,7 @@ void VcsBaseEditorWidget::addDiffActions(QMenu *, const DiffChunk &)
|
||||
|
||||
void VcsBaseEditorWidget::slotAnnotateRevision()
|
||||
{
|
||||
if (const QAction *a = qobject_cast<const QAction *>(sender())) {
|
||||
if (auto a = qobject_cast<const QAction *>(sender())) {
|
||||
const int currentLine = textCursor().blockNumber() + 1;
|
||||
const QString fileName = fileNameForLine(currentLine);
|
||||
QString workingDirectory = d->m_workingDirectory;
|
||||
@@ -1497,7 +1496,7 @@ void VcsBaseEditorWidget::showProgressIndicator()
|
||||
void VcsBaseEditorWidget::hideProgressIndicator()
|
||||
{
|
||||
delete d->m_progressIndicator;
|
||||
d->m_progressIndicator = 0;
|
||||
d->m_progressIndicator = nullptr;
|
||||
}
|
||||
|
||||
bool VcsBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const
|
||||
@@ -1624,7 +1623,7 @@ Core::IEditor *VcsBaseEditor::locateEditorByTag(const QString &tag)
|
||||
if (tagPropertyValue.type() == QVariant::String && tagPropertyValue.toString() == tag)
|
||||
return Core::DocumentModel::editorsForDocument(document).first();
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace VcsBase
|
||||
@@ -1635,7 +1634,7 @@ Core::IEditor *VcsBaseEditor::locateEditorByTag(const QString &tag)
|
||||
void VcsBase::VcsBaseEditorWidget::testDiffFileResolving(const char *id)
|
||||
{
|
||||
VcsBaseEditor *editor = VcsBase::VcsEditorFactory::createEditorById(id);
|
||||
VcsBaseEditorWidget *widget = qobject_cast<VcsBaseEditorWidget *>(editor->editorWidget());
|
||||
auto widget = qobject_cast<VcsBaseEditorWidget *>(editor->editorWidget());
|
||||
|
||||
QFETCH(QByteArray, header);
|
||||
QFETCH(QByteArray, fileName);
|
||||
@@ -1653,7 +1652,7 @@ void VcsBase::VcsBaseEditorWidget::testLogResolving(const char *id, QByteArray &
|
||||
const QByteArray &entry2)
|
||||
{
|
||||
VcsBaseEditor *editor = VcsBase::VcsEditorFactory::createEditorById(id);
|
||||
VcsBaseEditorWidget *widget = qobject_cast<VcsBaseEditorWidget *>(editor->editorWidget());
|
||||
auto widget = qobject_cast<VcsBaseEditorWidget *>(editor->editorWidget());
|
||||
|
||||
widget->textDocument()->setPlainText(QLatin1String(data));
|
||||
QCOMPARE(widget->d->entriesComboBox()->itemText(0), QString::fromLatin1(entry1));
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
Int
|
||||
};
|
||||
|
||||
SettingMappingData() : boolSetting(0), m_type(Invalid)
|
||||
SettingMappingData() : boolSetting(nullptr)
|
||||
{ }
|
||||
|
||||
SettingMappingData(bool *setting) : boolSetting(setting), m_type(Bool)
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
Type m_type = Invalid;
|
||||
};
|
||||
|
||||
class VcsBaseEditorConfigPrivate
|
||||
@@ -251,12 +251,12 @@ const QList<VcsBaseEditorConfig::OptionMapping> &VcsBaseEditorConfig::optionMapp
|
||||
|
||||
QStringList VcsBaseEditorConfig::argumentsForOption(const OptionMapping &mapping) const
|
||||
{
|
||||
const QAction *action = qobject_cast<const QAction *>(mapping.object);
|
||||
auto action = qobject_cast<const QAction *>(mapping.object);
|
||||
if (action && action->isChecked())
|
||||
return mapping.options;
|
||||
|
||||
QStringList args;
|
||||
const QComboBox *cb = qobject_cast<const QComboBox *>(mapping.object);
|
||||
auto cb = qobject_cast<const QComboBox *>(mapping.object);
|
||||
if (!cb)
|
||||
return args;
|
||||
|
||||
@@ -285,14 +285,14 @@ void VcsBaseEditorConfig::updateMappedSettings()
|
||||
}
|
||||
case Internal::SettingMappingData::String :
|
||||
{
|
||||
const QComboBox *cb = qobject_cast<const QComboBox *>(optMapping.object);
|
||||
auto cb = qobject_cast<const QComboBox *>(optMapping.object);
|
||||
if (cb && cb->currentIndex() != -1)
|
||||
*settingData.stringSetting = cb->itemData(cb->currentIndex()).toString();
|
||||
break;
|
||||
}
|
||||
case Internal::SettingMappingData::Int:
|
||||
{
|
||||
const QComboBox *cb = qobject_cast<const QComboBox *>(optMapping.object);
|
||||
auto cb = qobject_cast<const QComboBox *>(optMapping.object);
|
||||
if (cb && cb->currentIndex() != -1)
|
||||
*settingData.intSetting = cb->currentIndex();
|
||||
break;
|
||||
|
||||
@@ -60,7 +60,6 @@ VcsClientOptionsPageWidget::VcsClientOptionsPageWidget(QWidget *parent) : QWidge
|
||||
VcsClientOptionsPage::VcsClientOptionsPage(Core::IVersionControl *control, VcsBaseClientImpl *client,
|
||||
QObject *parent) :
|
||||
VcsBaseOptionsPage(parent),
|
||||
m_widget(0),
|
||||
m_client(client)
|
||||
{
|
||||
QTC_CHECK(m_client);
|
||||
@@ -76,10 +75,10 @@ void VcsClientOptionsPage::setWidgetFactory(VcsClientOptionsPage::WidgetFactory
|
||||
|
||||
VcsClientOptionsPageWidget *VcsClientOptionsPage::widget()
|
||||
{
|
||||
QTC_ASSERT(m_factory, return 0);
|
||||
QTC_ASSERT(m_factory, return nullptr);
|
||||
if (!m_widget)
|
||||
m_widget = m_factory();
|
||||
QTC_ASSERT(m_widget, return 0);
|
||||
QTC_ASSERT(m_widget, return nullptr);
|
||||
m_widget->setSettings(m_client->settings());
|
||||
return m_widget;
|
||||
}
|
||||
@@ -98,7 +97,7 @@ void VcsClientOptionsPage::apply()
|
||||
void VcsClientOptionsPage::finish()
|
||||
{
|
||||
delete m_widget;
|
||||
m_widget = 0;
|
||||
m_widget = nullptr;
|
||||
}
|
||||
|
||||
} // namespace VcsBase
|
||||
|
||||
@@ -80,7 +80,7 @@ protected:
|
||||
|
||||
private:
|
||||
WidgetFactory m_factory;
|
||||
VcsClientOptionsPageWidget *m_widget;
|
||||
VcsClientOptionsPageWidget *m_widget = nullptr;
|
||||
VcsBaseClientImpl *const m_client;
|
||||
};
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ void StateListener::slotStateChanged()
|
||||
}
|
||||
|
||||
// Get the file and its control. Do not use the file unless we find one
|
||||
IVersionControl *fileControl = 0;
|
||||
IVersionControl *fileControl = nullptr;
|
||||
|
||||
if (!state.currentFile.isEmpty()) {
|
||||
QFileInfo currentFi(state.currentFile);
|
||||
@@ -296,7 +296,7 @@ void StateListener::slotStateChanged()
|
||||
}
|
||||
|
||||
// Check for project, find the control
|
||||
IVersionControl *projectControl = 0;
|
||||
IVersionControl *projectControl = nullptr;
|
||||
Project *currentProject = ProjectTree::currentProject();
|
||||
if (!currentProject)
|
||||
currentProject = SessionManager::startupProject();
|
||||
@@ -513,31 +513,23 @@ VCSBASE_EXPORT QDebug operator<<(QDebug in, const VcsBasePluginState &state)
|
||||
class VcsBasePluginPrivate
|
||||
{
|
||||
public:
|
||||
explicit VcsBasePluginPrivate();
|
||||
|
||||
inline bool supportsRepositoryCreation() const;
|
||||
|
||||
QPointer<VcsBaseSubmitEditor> m_submitEditor;
|
||||
IVersionControl *m_versionControl;
|
||||
IVersionControl *m_versionControl = nullptr;
|
||||
Context m_context;
|
||||
VcsBasePluginState m_state;
|
||||
int m_actionState;
|
||||
int m_actionState = -1;
|
||||
|
||||
static Internal::StateListener *m_listener;
|
||||
};
|
||||
|
||||
VcsBasePluginPrivate::VcsBasePluginPrivate() :
|
||||
m_versionControl(0),
|
||||
m_actionState(-1)
|
||||
{
|
||||
}
|
||||
|
||||
bool VcsBasePluginPrivate::supportsRepositoryCreation() const
|
||||
{
|
||||
return m_versionControl && m_versionControl->supportsOperation(IVersionControl::CreateRepositoryOperation);
|
||||
}
|
||||
|
||||
Internal::StateListener *VcsBasePluginPrivate::m_listener = 0;
|
||||
Internal::StateListener *VcsBasePluginPrivate::m_listener = nullptr;
|
||||
|
||||
VcsBasePlugin::VcsBasePlugin() :
|
||||
d(new VcsBasePluginPrivate())
|
||||
@@ -685,7 +677,7 @@ void VcsBasePlugin::createRepository()
|
||||
if (directory.isEmpty())
|
||||
return;
|
||||
const IVersionControl *managingControl = VcsManager::findVersionControlForDirectory(directory);
|
||||
if (managingControl == 0)
|
||||
if (managingControl == nullptr)
|
||||
break;
|
||||
const QString question = tr("The directory \"%1\" is already managed by a version control system (%2)."
|
||||
" Would you like to specify another directory?").arg(directory, managingControl->displayName());
|
||||
|
||||
@@ -75,7 +75,7 @@ enum { wantToolBar = 0 };
|
||||
// Return true if word is meaningful and can be added to a completion model
|
||||
static bool acceptsWordForCompletion(const char *word)
|
||||
{
|
||||
if (word == 0)
|
||||
if (!word)
|
||||
return false;
|
||||
static const std::size_t minWordLength = 7;
|
||||
return std::strlen(word) >= minWordLength;
|
||||
@@ -84,17 +84,19 @@ static bool acceptsWordForCompletion(const char *word)
|
||||
// Return the class name which function belongs to
|
||||
static const char *belongingClassName(const CPlusPlus::Function *function)
|
||||
{
|
||||
if (function == 0)
|
||||
return 0;
|
||||
if (!function)
|
||||
return nullptr;
|
||||
|
||||
const CPlusPlus::Name *funcName = function->name();
|
||||
if (funcName != 0 && funcName->asQualifiedNameId() != 0) {
|
||||
const CPlusPlus::Name *funcBaseName = funcName->asQualifiedNameId()->base();
|
||||
if (funcBaseName != 0 && funcBaseName->identifier() != 0)
|
||||
return funcBaseName->identifier()->chars();
|
||||
if (auto funcName = function->name()) {
|
||||
if (auto qualifiedNameId = funcName->asQualifiedNameId()) {
|
||||
if (const CPlusPlus::Name *funcBaseName = qualifiedNameId->base()) {
|
||||
if (auto identifier = funcBaseName->identifier())
|
||||
return identifier->chars();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -151,7 +153,7 @@ public:
|
||||
VcsBaseSubmitEditor *q);
|
||||
|
||||
SubmitEditorWidget *m_widget;
|
||||
QToolBar *m_toolWidget;
|
||||
QToolBar *m_toolWidget = nullptr;
|
||||
const VcsBaseSubmitEditorParameters *m_parameters;
|
||||
QString m_displayName;
|
||||
QString m_checkScriptWorkingDirectory;
|
||||
@@ -160,17 +162,15 @@ public:
|
||||
QPointer<QAction> m_diffAction;
|
||||
QPointer<QAction> m_submitAction;
|
||||
|
||||
NickNameDialog *m_nickNameDialog;
|
||||
NickNameDialog *m_nickNameDialog = nullptr;
|
||||
};
|
||||
|
||||
VcsBaseSubmitEditorPrivate::VcsBaseSubmitEditorPrivate(const VcsBaseSubmitEditorParameters *parameters,
|
||||
SubmitEditorWidget *editorWidget,
|
||||
VcsBaseSubmitEditor *q) :
|
||||
m_widget(editorWidget),
|
||||
m_toolWidget(0),
|
||||
m_parameters(parameters),
|
||||
m_file(new SubmitEditorFile(parameters, q)),
|
||||
m_nickNameDialog(0)
|
||||
m_file(new SubmitEditorFile(parameters, q))
|
||||
{
|
||||
auto completer = new QCompleter(q);
|
||||
completer->setCaseSensitivity(Qt::CaseSensitive);
|
||||
@@ -384,13 +384,13 @@ static QToolBar *createToolBar(const QWidget *someWidget, QAction *submitAction,
|
||||
QWidget *VcsBaseSubmitEditor::toolBar()
|
||||
{
|
||||
if (!wantToolBar)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
if (d->m_toolWidget)
|
||||
return d->m_toolWidget;
|
||||
|
||||
if (!d->m_diffAction && !d->m_submitAction)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// Create
|
||||
d->m_toolWidget = createToolBar(d->m_widget, d->m_submitAction, d->m_diffAction);
|
||||
@@ -429,7 +429,7 @@ void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *model)
|
||||
const QString filePath = fileInfo.absoluteFilePath();
|
||||
// Add symbols from the C++ code model
|
||||
const CPlusPlus::Document::Ptr doc = cppSnapShot.document(filePath);
|
||||
if (!doc.isNull() && doc->control() != 0) {
|
||||
if (!doc.isNull() && doc->control()) {
|
||||
const CPlusPlus::Control *ctrl = doc->control();
|
||||
CPlusPlus::Symbol **symPtr = ctrl->firstSymbol(); // Read-only
|
||||
while (symPtr != ctrl->lastSymbol()) {
|
||||
@@ -438,7 +438,7 @@ void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *model)
|
||||
const CPlusPlus::Identifier *symId = sym->identifier();
|
||||
// Add any class, function or namespace identifiers
|
||||
if ((sym->isClass() || sym->isFunction() || sym->isNamespace())
|
||||
&& (symId != 0 && acceptsWordForCompletion(symId->chars())))
|
||||
&& (symId && acceptsWordForCompletion(symId->chars())))
|
||||
{
|
||||
uniqueSymbols.insert(QString::fromUtf8(symId->chars()));
|
||||
}
|
||||
@@ -531,7 +531,7 @@ VcsBaseSubmitEditor::PromptSubmitResult
|
||||
bool forcePrompt,
|
||||
bool canCommitOnFailure)
|
||||
{
|
||||
SubmitEditorWidget *submitWidget = static_cast<SubmitEditorWidget *>(this->widget());
|
||||
auto submitWidget = static_cast<SubmitEditorWidget *>(this->widget());
|
||||
|
||||
Core::EditorManager::activateEditor(this, Core::EditorManager::IgnoreNavigationHistory);
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ private:
|
||||
class OutputWindowPlainTextEdit : public Core::OutputWindow
|
||||
{
|
||||
public:
|
||||
explicit OutputWindowPlainTextEdit(QWidget *parent = 0);
|
||||
~OutputWindowPlainTextEdit();
|
||||
explicit OutputWindowPlainTextEdit(QWidget *parent = nullptr);
|
||||
~OutputWindowPlainTextEdit() override;
|
||||
|
||||
void appendLines(QString const& s, const QString &repository = QString());
|
||||
void appendLinesWithStyle(QString const& s, enum VcsOutputWindow::MessageStyle style, const QString &repository = QString());
|
||||
@@ -102,7 +102,7 @@ protected:
|
||||
|
||||
private:
|
||||
void setFormat(enum VcsOutputWindow::MessageStyle style);
|
||||
QString identifierUnderCursor(const QPoint &pos, QString *repository = 0) const;
|
||||
QString identifierUnderCursor(const QPoint &pos, QString *repository = nullptr) const;
|
||||
|
||||
const QTextCharFormat m_defaultFormat;
|
||||
QTextCharFormat m_errorFormat;
|
||||
@@ -129,7 +129,7 @@ OutputWindowPlainTextEdit::OutputWindowPlainTextEdit(QWidget *parent) :
|
||||
m_messageFormat.setForeground(Utils::creatorTheme()->color(Theme::OutputPanes_MessageOutput));
|
||||
m_formatter = new OutputFormatter;
|
||||
m_formatter->setPlainTextEdit(this);
|
||||
Aggregation::Aggregate *agg = new Aggregation::Aggregate;
|
||||
auto agg = new Aggregation::Aggregate;
|
||||
agg->add(this);
|
||||
agg->add(new Core::BaseTextFind(this));
|
||||
}
|
||||
@@ -184,7 +184,7 @@ void OutputWindowPlainTextEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||
// Add 'open file'
|
||||
QString repository;
|
||||
const QString token = identifierUnderCursor(event->pos(), &repository);
|
||||
QAction *openAction = 0;
|
||||
QAction *openAction = nullptr;
|
||||
if (!token.isEmpty()) {
|
||||
// Check for a file, expand via repository if relative
|
||||
QFileInfo fi(token);
|
||||
@@ -287,8 +287,8 @@ public:
|
||||
QRegExp passwordRegExp;
|
||||
};
|
||||
|
||||
static VcsOutputWindow *m_instance = 0;
|
||||
static VcsOutputWindowPrivate *d = 0;
|
||||
static VcsOutputWindow *m_instance = nullptr;
|
||||
static VcsOutputWindowPrivate *d = nullptr;
|
||||
|
||||
VcsOutputWindow::VcsOutputWindow()
|
||||
{
|
||||
@@ -314,7 +314,7 @@ static QString filterPasswordFromUrls(const QString &input)
|
||||
|
||||
VcsOutputWindow::~VcsOutputWindow()
|
||||
{
|
||||
m_instance = 0;
|
||||
m_instance = nullptr;
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
expander->registerVariable(Constants::VAR_VCS_NAME,
|
||||
tr("Name of the version control system in use by the current project."),
|
||||
[]() -> QString {
|
||||
IVersionControl *vc = 0;
|
||||
IVersionControl *vc = nullptr;
|
||||
if (Project *project = ProjectTree::currentProject())
|
||||
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory().toString());
|
||||
return vc ? vc->displayName() : QString();
|
||||
@@ -115,7 +115,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
expander->registerVariable(Constants::VAR_VCS_TOPIC,
|
||||
tr("The current version control topic (branch or tag) identification of the current project."),
|
||||
[]() -> QString {
|
||||
IVersionControl *vc = 0;
|
||||
IVersionControl *vc = nullptr;
|
||||
QString topLevel;
|
||||
if (Project *project = ProjectTree::currentProject())
|
||||
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory().toString(), &topLevel);
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace {
|
||||
class PathMatcher
|
||||
{
|
||||
public:
|
||||
PathMatcher() : m_count(std::numeric_limits<int>::max()), m_project(0) { }
|
||||
ProjectExplorer::Project *project() { return m_project; }
|
||||
|
||||
void match(ProjectExplorer::Project *project,
|
||||
@@ -59,8 +58,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
int m_count;
|
||||
ProjectExplorer::Project *m_project;
|
||||
int m_count = std::numeric_limits<int>::max();
|
||||
ProjectExplorer::Project *m_project = nullptr;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -68,7 +67,7 @@ private:
|
||||
namespace VcsBase {
|
||||
namespace Internal {
|
||||
|
||||
VcsProjectCache *VcsProjectCache::m_instance = 0;
|
||||
VcsProjectCache *VcsProjectCache::m_instance = nullptr;
|
||||
|
||||
VcsProjectCache::VcsProjectCache()
|
||||
{
|
||||
@@ -83,7 +82,7 @@ VcsProjectCache::VcsProjectCache()
|
||||
|
||||
VcsProjectCache::~VcsProjectCache()
|
||||
{
|
||||
m_instance = 0;
|
||||
m_instance = nullptr;
|
||||
}
|
||||
|
||||
ProjectExplorer::Project *VcsProjectCache::projectFor(const QString &repo)
|
||||
|
||||
Reference in New Issue
Block a user