forked from qt-creator/qt-creator
ProjectExplorer: Show VCS topic in tree
Topic is usually the current branch name Change-Id: Id6ecc48744a5b3d9c7502b36b4895eb18d0ff0c6 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
3685ce7599
commit
fd6d0d8c29
@@ -34,6 +34,9 @@
|
||||
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/fileiconprovider.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -104,6 +107,11 @@ QString Node::displayName() const
|
||||
return QFileInfo(path()).fileName();
|
||||
}
|
||||
|
||||
QString Node::vcsTopic() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString Node::tooltip() const
|
||||
{
|
||||
return QDir::toNativeSeparators(path());
|
||||
@@ -269,6 +277,16 @@ ProjectNode::ProjectNode(const QString &projectFilePath)
|
||||
setDisplayName(QFileInfo(projectFilePath).fileName());
|
||||
}
|
||||
|
||||
QString ProjectNode::vcsTopic() const {
|
||||
const QString dir = QFileInfo(path()).absolutePath();
|
||||
|
||||
if (Core::IVersionControl *const vc =
|
||||
Core::ICore::vcsManager()->findVersionControlForDirectory(dir))
|
||||
return vc->vcsTopic(dir);
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
QList<ProjectNode*> ProjectNode::subProjectNodes() const
|
||||
{
|
||||
return m_subProjectNodes;
|
||||
|
||||
Reference in New Issue
Block a user