aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perforce
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-11-09 15:57:56 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-11-09 15:57:56 +0100
commit7aa24116935249a840e1350a6f8de73bc794fb09 (patch)
treef0d69542e8cb13187eaeebb43ec187b3ad763aa1 /src/plugins/perforce
parent19fb0311bade0ffee612d51d64d40b04a811b7c4 (diff)
Code model: Update on changes from the versioning system.
Add state logic to CppCodeModelManagerInterface, making it aware whether an indexer is running, protect the update methods from another invocation while running. Add changed signals to IVersionControl and VCSManager and wire them to the update methods. Add a menu action for manually updating. Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: con <qtc-committer@nokia.com>
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r--src/plugins/perforce/perforceplugin.cpp7
-rw-r--r--src/plugins/perforce/perforceversioncontrol.cpp10
-rw-r--r--src/plugins/perforce/perforceversioncontrol.h3
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);