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 <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2015-03-17 12:00:26 +01:00
parent 71855e6bbc
commit f1ea415581
2 changed files with 7 additions and 3 deletions

View File

@@ -35,6 +35,7 @@
#include <utils/stylehelper.h> #include <utils/stylehelper.h>
#include <utils/theme/theme.h> #include <utils/theme/theme.h>
#include <QDir>
#include <QRect> #include <QRect>
#include <QPainter> #include <QPainter>
#include <QMouseEvent> #include <QMouseEvent>
@@ -573,3 +574,8 @@ bool DoubleTabWidget::event(QEvent *event)
} }
return QWidget::event(event); return QWidget::event(event);
} }
QString DoubleTabWidget::Tab::displayName() const
{
return nameIsUnique ? name : QDir::toNativeSeparators(fullName);
}

View File

@@ -80,9 +80,7 @@ private:
bool nameIsUnique; bool nameIsUnique;
QStringList subTabs; QStringList subTabs;
int currentSubTab; int currentSubTab;
QString displayName() const { QString displayName() const;
return nameIsUnique ? name : fullName;
}
}; };
void updateNameIsUniqueAdd(Tab *tab); void updateNameIsUniqueAdd(Tab *tab);
void updateNameIsUniqueRemove(const Tab &tab); void updateNameIsUniqueRemove(const Tab &tab);