forked from qt-creator/qt-creator
Limit to 6 recent items on the welcome screen.
This commit is contained in:
@@ -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()));
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user