diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2020-06-17 23:34:16 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2020-06-18 05:16:24 +0000 |
commit | e9df7825fa8a8714c3623154f1fc3cf13066a9a4 (patch) | |
tree | 93ab4d95bd6afd34df7e1f9112f8179d448b3b2f | |
parent | 55f3764d08ac5684a9d6fa843f1bcc45289ee8d2 (diff) |
IVersionControl: Change vcsAnnotate return type to void
All implementations return true unconditionally, and the return
value is never read anyway.
+ Remove superfluous function with the same name in Perforce.
Change-Id: I83f361ec7fd8be3177cb4be52e6276e295cd4279
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/plugins/bazaar/bazaarplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/clearcase/clearcaseplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/coreplugin/iversioncontrol.h | 4 | ||||
-rw-r--r-- | src/plugins/cvs/cvsplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/git/gitplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurialplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/perforce/perforceplugin.cpp | 16 | ||||
-rw-r--r-- | src/plugins/subversion/subversionplugin.cpp | 5 |
8 files changed, 17 insertions, 33 deletions
diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 25a3cd94da7..c78605db074 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -160,7 +160,7 @@ public: bool vcsDelete(const QString &filename) final; bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, const Utils::FilePath &baseDirectory, @@ -925,11 +925,10 @@ bool BazaarPluginPrivate::vcsCreateRepository(const QString &directory) return m_client.synchronousCreateRepository(directory); } -bool BazaarPluginPrivate::vcsAnnotate(const QString &file, int line) +void BazaarPluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); m_client.annotate(fi.absolutePath(), fi.fileName(), QString(), line); - return true; } Core::ShellCommand *BazaarPluginPrivate::createInitialCheckoutCommand(const QString &url, diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 206fd75089d..12f6ea4de08 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -199,7 +199,7 @@ public: bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; QString vcsOpenText() const final; QString vcsMakeWritableText() const final; @@ -2484,11 +2484,10 @@ bool ClearCasePluginPrivate::vcsMove(const QString &from, const QString &to) return vcsMove(ifrom.absolutePath(), ifrom.fileName(), ito.fileName()); } -bool ClearCasePluginPrivate::vcsAnnotate(const QString &file, int line) +void ClearCasePluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); vcsAnnotateHelper(fi.absolutePath(), fi.fileName(), QString(), line); - return true; } QString ClearCasePluginPrivate::vcsOpenText() const diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index 17e471e0281..1dd4c021213 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -199,7 +199,7 @@ public: /*! * Display annotation for a file and scroll to line */ - virtual bool vcsAnnotate(const QString &file, int line) = 0; + virtual void vcsAnnotate(const QString &file, int line) = 0; /*! * Display text for Open operation @@ -296,7 +296,7 @@ public: bool vcsDelete(const QString &) override { return false; } bool vcsMove(const QString &, const QString &) override { return false; } bool vcsCreateRepository(const QString &) override { return false; } - bool vcsAnnotate(const QString &, int) override { return false; } + void vcsAnnotate(const QString &, int) override {} private: Id m_id; diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index b9de5be52e3..843ab756bf5 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -250,7 +250,7 @@ public: bool vcsDelete(const QString &filename) final; bool vcsMove(const QString &, const QString &) final { return false; } bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; QString vcsOpenText() const final; @@ -468,11 +468,10 @@ bool CvsPluginPrivate::vcsCreateRepository(const QString &) return false; } -bool CvsPluginPrivate::vcsAnnotate(const QString &file, int line) +void CvsPluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); vcsAnnotate(fi.absolutePath(), fi.fileName(), QString(), line); - return true; } QString CvsPluginPrivate::vcsOpenText() const diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 82647053b72..2ef9fa230b1 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -249,7 +249,7 @@ public: bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; QString vcsTopic(const QString &directory) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, @@ -1937,11 +1937,10 @@ QStringList GitPluginPrivate::unmanagedFiles(const QString &workingDir, return m_gitClient.unmanagedFiles(workingDir, filePaths); } -bool GitPluginPrivate::vcsAnnotate(const QString &file, int line) +void GitPluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); m_gitClient.annotate(fi.absolutePath(), fi.fileName(), QString(), line); - return true; } void GitPlugin::emitFilesChanged(const QStringList &l) diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index 533d08f4e9e..9727167847f 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -144,7 +144,7 @@ public: bool vcsDelete(const QString &filename) final; bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, const Utils::FilePath &baseDirectory, @@ -826,11 +826,10 @@ bool MercurialPluginPrivate::vcsCreateRepository(const QString &directory) return m_client.synchronousCreateRepository(directory); } -bool MercurialPluginPrivate::vcsAnnotate(const QString &file, int line) +void MercurialPluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); m_client.annotate(fi.absolutePath(), fi.fileName(), QString(), line); - return true; } Core::ShellCommand *MercurialPluginPrivate::createInitialCheckoutCommand(const QString &url, diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index b6734134d67..ee31ca5cec2 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -223,7 +223,7 @@ public: bool vcsDelete(const QString &filename) final; bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; QString vcsOpenText() const final; QString vcsMakeWritableText() const final; @@ -238,9 +238,6 @@ public: IEditor *openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames); void describe(const QString &source, const QString &n); - void vcsAnnotate(const QString &workingDirectory, const QString &file, - const QString &revision, int lineNumber); - void getTopLevel(const QString &workingDirectory = QString(), bool isSync = false); void updateActions(ActionState) override; @@ -846,12 +843,6 @@ void PerforcePluginPrivate::annotateFile() } } -void PerforcePluginPrivate::vcsAnnotate(const QString &workingDirectory, const QString &file, - const QString &revision, int lineNumber) -{ - annotate(workingDirectory, file, revision, lineNumber); -} - void PerforcePluginPrivate::annotate(const QString &workingDir, const QString &fileName, const QString &changeList /* = QString() */, @@ -1204,11 +1195,10 @@ bool PerforcePluginPrivate::vcsCreateRepository(const QString &) return false; } -bool PerforcePluginPrivate::vcsAnnotate(const QString &file, int line) +void PerforcePluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); - vcsAnnotate(fi.absolutePath(), fi.fileName(), QString(), line); - return true; + annotate(fi.absolutePath(), fi.fileName(), QString(), line); } QString PerforcePluginPrivate::vcsOpenText() const diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 9ac01e6734d..0a480a18bb5 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -221,7 +221,7 @@ public: bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; - bool vcsAnnotate(const QString &file, int line) final; + void vcsAnnotate(const QString &file, int line) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, const Utils::FilePath &baseDirectory, @@ -1276,11 +1276,10 @@ bool SubversionPluginPrivate::vcsCreateRepository(const QString &) return false; } -bool SubversionPluginPrivate::vcsAnnotate(const QString &file, int line) +void SubversionPluginPrivate::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); vcsAnnotateHelper(fi.absolutePath(), fi.fileName(), QString(), line); - return true; } Core::ShellCommand *SubversionPluginPrivate::createInitialCheckoutCommand(const QString &url, |