From e0520794f53463d759eba228708acdede040e237 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 20 Sep 2018 00:57:24 +0300 Subject: [PATCH] Perforce: Modernize override, auto, nullptr Change-Id: I82f63fbe06d098e71876c30af0fe247a5bae3a55 Reviewed-by: Alessandro Portale --- src/plugins/perforce/perforcechecker.h | 2 +- src/plugins/perforce/perforceplugin.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/perforce/perforcechecker.h b/src/plugins/perforce/perforcechecker.h index e1a7ec67b69..ed346ab4311 100644 --- a/src/plugins/perforce/perforcechecker.h +++ b/src/plugins/perforce/perforcechecker.h @@ -40,7 +40,7 @@ class PerforceChecker : public QObject Q_OBJECT public: explicit PerforceChecker(QObject *parent = nullptr); - ~PerforceChecker(); + ~PerforceChecker() override; void start(const QString &binary, const QString &workingDirectory, diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 22348b5a705..1ad1cf7dc57 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -108,8 +108,9 @@ const VcsBaseEditorParameters editorParameters[] = { // Utility to find a parameter set by type static inline const VcsBaseEditorParameters *findType(int ie) { - const EditorContentType et = static_cast(ie); - return VcsBaseEditor::findType(editorParameters, sizeof(editorParameters)/sizeof(editorParameters[0]), et); + return VcsBaseEditor::findType(editorParameters, + sizeof(editorParameters)/sizeof(*editorParameters), + static_cast(ie)); } // Ensure adding "..." to relative paths which is p4's convention @@ -601,7 +602,7 @@ void PerforcePlugin::startSubmitProject() IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames) { IEditor *editor = EditorManager::openEditor(fileName, PERFORCE_SUBMIT_EDITOR_ID); - PerforceSubmitEditor *submitEditor = static_cast(editor); + auto submitEditor = static_cast(editor); setSubmitEditor(submitEditor); submitEditor->restrictToProjectFiles(depotFileNames); connect(submitEditor, &VcsBaseSubmitEditor::diffSelectedFiles,