aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mercurial
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-02-25 14:36:03 +0200
committerOrgad Shaneh <orgads@gmail.com>2015-02-26 14:56:25 +0000
commitaee35662a2b2b65ba31797a970edaf9bcd0fb05b (patch)
tree9aeb21e92f9b95694c135c0e188fc9d8a05110cd /src/plugins/mercurial
parent991cf8499106e1e6a35efd35bcd62cfb2387552c (diff)
Prefix duplicate names in Open Documents to make them unique
If a document has a file name associated with it then the prefix is composed from path components (subdirectories), starting from the one where the file is located and going up the parents until the resulting name becomes unique among other open documents. If a document doesn't have an associated file name, then a sequential number (starting from 1) is appended to the display name of the document. This feature is useful when working with big projects that have lots of idendical file names across different subdirectories (e.g. Makefile.in, main.cpp, etc.) that need to be edited at the same time. It allows to easily recognize such a file when switching between documents in the editor, w/o the need to place the mouse pointer over the name entry to get its full path. Started-by: Dmitriy Kuminov <coding@dmik.org> Task-number: QTCREATORBUG-10185 Change-Id: I633ea6d9b9b4fce8b67335dbcce1bda29254efde Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r--src/plugins/mercurial/commiteditor.cpp2
-rw-r--r--src/plugins/mercurial/mercurialplugin.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/mercurial/commiteditor.cpp b/src/plugins/mercurial/commiteditor.cpp
index 73b9b7ab84..724ce2d100 100644
--- a/src/plugins/mercurial/commiteditor.cpp
+++ b/src/plugins/mercurial/commiteditor.cpp
@@ -45,7 +45,7 @@ CommitEditor::CommitEditor(const VcsBaseSubmitEditorParameters *parameters)
: VcsBaseSubmitEditor(parameters, new MercurialCommitWidget),
fileModel(0)
{
- document()->setDisplayName(tr("Commit Editor"));
+ document()->setPreferredDisplayName(tr("Commit Editor"));
}
MercurialCommitWidget *CommitEditor::commitWidget()
diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp
index 137a9de51c..13ada03c79 100644
--- a/src/plugins/mercurial/mercurialplugin.cpp
+++ b/src/plugins/mercurial/mercurialplugin.cpp
@@ -581,7 +581,7 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s
const QString msg = tr("Commit changes for \"%1\".").
arg(QDir::toNativeSeparators(m_submitRepository));
- commitEditor->document()->setDisplayName(msg);
+ commitEditor->document()->setPreferredDisplayName(msg);
QString branch = versionControl()->vcsTopic(m_submitRepository);
commitEditor->setFields(m_submitRepository, branch,