From f1ea415581b7e32f92e8cd8dadced4049d8f1065 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 17 Mar 2015 12:00:26 +0100 Subject: [PATCH] ProjectExplorer: Don't display alien dir separators on Windows In case you opened more than one project with the same name, it shows the full path incl. dir separators in the first-level tabs in the project mode. Change-Id: Idbf5dfe6ef0c20eecf3a3473011bb2d9b1794cea Reviewed-by: Orgad Shaneh --- src/plugins/projectexplorer/doubletabwidget.cpp | 6 ++++++ src/plugins/projectexplorer/doubletabwidget.h | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/doubletabwidget.cpp b/src/plugins/projectexplorer/doubletabwidget.cpp index 55817378855..36e93cfb887 100644 --- a/src/plugins/projectexplorer/doubletabwidget.cpp +++ b/src/plugins/projectexplorer/doubletabwidget.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -573,3 +574,8 @@ bool DoubleTabWidget::event(QEvent *event) } return QWidget::event(event); } + +QString DoubleTabWidget::Tab::displayName() const +{ + return nameIsUnique ? name : QDir::toNativeSeparators(fullName); +} diff --git a/src/plugins/projectexplorer/doubletabwidget.h b/src/plugins/projectexplorer/doubletabwidget.h index 4e2e70ec79b..92c23ac54ec 100644 --- a/src/plugins/projectexplorer/doubletabwidget.h +++ b/src/plugins/projectexplorer/doubletabwidget.h @@ -80,9 +80,7 @@ private: bool nameIsUnique; QStringList subTabs; int currentSubTab; - QString displayName() const { - return nameIsUnique ? name : fullName; - } + QString displayName() const; }; void updateNameIsUniqueAdd(Tab *tab); void updateNameIsUniqueRemove(const Tab &tab);