diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-11-11 14:32:54 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-11-11 14:32:54 +0100 |
commit | 8335a06ed4e1918c7216d82dc7a97bbea2b774aa (patch) | |
tree | f4d2d35b0ae9fdb06fce8d955bb33f38c0a58925 /src/plugins/perforce | |
parent | 4d45ad00037a056e52c74dca8a5c00ab2763da5d (diff) |
Code model: Update on changes from the versioning system.
Add changed signals to IVersionControl and
VCSManager and wire them to the update methods. Add a menu action for
manually updating. Improved version of reverted
7aa24116935249a840e1350a6f8de73bc794fb09.
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r-- | src/plugins/perforce/perforceplugin.cpp | 7 | ||||
-rw-r--r-- | src/plugins/perforce/perforceversioncontrol.cpp | 10 | ||||
-rw-r--r-- | src/plugins/perforce/perforceversioncontrol.h | 3 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 7039798b09..a80d8f5597 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -454,6 +454,8 @@ void PerforcePlugin::revertCurrentFile() Core::FileChangeBlocker fcb(fileName); fcb.setModifiedReload(true); PerforceResponse result2 = runP4Cmd(QStringList() << QLatin1String("revert") << fileName, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); + if (!result2.error) + m_versionControl->emitFilesChanged(QStringList(fileName)); } void PerforcePlugin::diffCurrentFile() @@ -514,7 +516,10 @@ void PerforcePlugin::updateCheckout(const QStringList &dirs) { QStringList args(QLatin1String("sync")); args.append(dirs); - runP4Cmd(args, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); + const PerforceResponse resp = runP4Cmd(args, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); + if (!dirs.empty()) + foreach(const QString &dir, dirs) + m_versionControl->emitRepositoryChanged(dir); } void PerforcePlugin::printOpenedFileList() diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index 040692428d..ad915b2a20 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -94,5 +94,15 @@ QString PerforceVersionControl::findTopLevelForDirectory(const QString &director return m_plugin->findTopLevelForDirectory(directory); } +void PerforceVersionControl::emitRepositoryChanged(const QString &s) +{ + emit repositoryChanged(s); +} + +void PerforceVersionControl::emitFilesChanged(const QStringList &l) +{ + emit filesChanged(l); +} + } // Internal } // Perforce diff --git a/src/plugins/perforce/perforceversioncontrol.h b/src/plugins/perforce/perforceversioncontrol.h index 2992e5518b..dd385061cb 100644 --- a/src/plugins/perforce/perforceversioncontrol.h +++ b/src/plugins/perforce/perforceversioncontrol.h @@ -56,6 +56,9 @@ public: virtual bool vcsAdd(const QString &fileName); virtual bool vcsDelete(const QString &filename); + void emitRepositoryChanged(const QString &s); + void emitFilesChanged(const QStringList &l); + signals: void enabledChanged(bool); |