From 48ef82ef0a8ee3dcfefb585e999cbf1a867c962f Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Fri, 9 Apr 2010 18:58:35 +0200 Subject: [PATCH] Limit to 6 recent items on the welcome screen. --- .../projectwelcomepagewidget.cpp | 8 +++++ .../projectwelcomepagewidget.ui | 29 ------------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/plugins/projectexplorer/projectwelcomepagewidget.cpp b/src/plugins/projectexplorer/projectwelcomepagewidget.cpp index 46bc3e0dabc..f7abe9fbd8e 100644 --- a/src/plugins/projectexplorer/projectwelcomepagewidget.cpp +++ b/src/plugins/projectexplorer/projectwelcomepagewidget.cpp @@ -44,6 +44,8 @@ #include +#define MAX_RECENT_ITEMS 6 + using namespace ProjectExplorer::Internal; bool ProjectWelcomePageWidget::WelcomePageData::operator==(const WelcomePageData &rhs) const @@ -103,7 +105,10 @@ void ProjectWelcomePageWidget::updateWelcomePage(const WelcomePageData &welcomeP ui->projTreeWidget->clear(); if (welcomePageData.sessionList.count() > 0) { + int items = 0; foreach (const QString &s, welcomePageData.sessionList) { + if (++items > MAX_RECENT_ITEMS) + break; QString str = s; if (welcomePageData.activeSession.isEmpty()) { if (s == welcomePageData.previousSession) @@ -122,7 +127,10 @@ void ProjectWelcomePageWidget::updateWelcomePage(const WelcomePageData &welcomeP typedef QPair QStringPair; if (welcomePageData.projectList.count() > 0) { + int items = 0; foreach (const QStringPair &it, welcomePageData.projectList) { + if (++items > MAX_RECENT_ITEMS) + break; const QFileInfo fi(it.first); ui->projTreeWidget->addItem(it.second, it.first, QDir::toNativeSeparators(fi.absolutePath())); diff --git a/src/plugins/projectexplorer/projectwelcomepagewidget.ui b/src/plugins/projectexplorer/projectwelcomepagewidget.ui index 23b5bc84a13..081d1c4883a 100644 --- a/src/plugins/projectexplorer/projectwelcomepagewidget.ui +++ b/src/plugins/projectexplorer/projectwelcomepagewidget.ui @@ -117,19 +117,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -245,19 +232,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -324,9 +298,6 @@ - layoutWidget - horizontalSpacer_2 - horizontalSpacer_2