Limit to 6 recent items on the welcome screen.

This commit is contained in:
Daniel Molkentin
2010-04-09 18:58:35 +02:00
parent a5cd901747
commit 48ef82ef0a
2 changed files with 8 additions and 29 deletions

View File

@@ -44,6 +44,8 @@
#include <QtCore/QDebug>
#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<QString, QString> 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()));

View File

@@ -117,19 +117,6 @@
</column>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<widget class="Utils::WelcomeModeLabel" name="projTitleLabel">
<property name="sizePolicy">
@@ -245,19 +232,6 @@
</column>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@@ -324,9 +298,6 @@
</item>
</layout>
<zorder></zorder>
<zorder>layoutWidget</zorder>
<zorder>horizontalSpacer_2</zorder>
<zorder>horizontalSpacer_2</zorder>
</widget>
</item>
</layout>