summaryrefslogtreecommitdiff
path: root/src/plugins/cpaster
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/cpaster
parent991cf8499106e1e6a35efd35bcd62cfb2387552c (diff)
downloadqt-creator-aee35662a2b2b65ba31797a970edaf9bcd0fb05b.tar.gz
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/cpaster')
-rw-r--r--src/plugins/cpaster/cpasterplugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index 571e8de60a..338cb5dab9 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -394,7 +394,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
// Open editor with title.
IEditor *editor = EditorManager::openEditor(fileName);
QTC_ASSERT(editor, return);
- editor->document()->setDisplayName(titleDescription);
+ editor->document()->setPreferredDisplayName(titleDescription);
}
CodepasterPlugin *CodepasterPlugin::instance()