Add project path to welcome page

Task-number: QTCREATORBUG-140
This commit is contained in:
Jens Bache-Wiig
2010-04-14 16:21:52 +02:00
parent 382df08a2b
commit f552831c9e

View File

@@ -128,11 +128,15 @@ void ProjectWelcomePageWidget::updateWelcomePage(const WelcomePageData &welcomeP
typedef QPair<QString, QString> QStringPair; typedef QPair<QString, QString> QStringPair;
if (welcomePageData.projectList.count() > 0) { if (welcomePageData.projectList.count() > 0) {
int items = 0; int items = 0;
QFontMetrics fm = fontMetrics();
foreach (const QStringPair &it, welcomePageData.projectList) { foreach (const QStringPair &it, welcomePageData.projectList) {
if (++items > MAX_RECENT_ITEMS) if (++items > MAX_RECENT_ITEMS)
break; break;
const QFileInfo fi(it.first); const QFileInfo fi(it.first);
ui->projTreeWidget->addItem(it.second, it.first, QString label = "<b>" + it.second +
"</b><br><font color=gray>" +
fm.elidedText(it.first, Qt::ElideMiddle, 250);
ui->projTreeWidget->addItem(label, it.first,
QDir::toNativeSeparators(fi.absolutePath())); QDir::toNativeSeparators(fi.absolutePath()));
} }
} else { } else {