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>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
|
#define MAX_RECENT_ITEMS 6
|
||||||
|
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
bool ProjectWelcomePageWidget::WelcomePageData::operator==(const WelcomePageData &rhs) const
|
bool ProjectWelcomePageWidget::WelcomePageData::operator==(const WelcomePageData &rhs) const
|
||||||
@@ -103,7 +105,10 @@ void ProjectWelcomePageWidget::updateWelcomePage(const WelcomePageData &welcomeP
|
|||||||
ui->projTreeWidget->clear();
|
ui->projTreeWidget->clear();
|
||||||
|
|
||||||
if (welcomePageData.sessionList.count() > 0) {
|
if (welcomePageData.sessionList.count() > 0) {
|
||||||
|
int items = 0;
|
||||||
foreach (const QString &s, welcomePageData.sessionList) {
|
foreach (const QString &s, welcomePageData.sessionList) {
|
||||||
|
if (++items > MAX_RECENT_ITEMS)
|
||||||
|
break;
|
||||||
QString str = s;
|
QString str = s;
|
||||||
if (welcomePageData.activeSession.isEmpty()) {
|
if (welcomePageData.activeSession.isEmpty()) {
|
||||||
if (s == welcomePageData.previousSession)
|
if (s == welcomePageData.previousSession)
|
||||||
@@ -122,7 +127,10 @@ 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;
|
||||||
foreach (const QStringPair &it, welcomePageData.projectList) {
|
foreach (const QStringPair &it, welcomePageData.projectList) {
|
||||||
|
if (++items > MAX_RECENT_ITEMS)
|
||||||
|
break;
|
||||||
const QFileInfo fi(it.first);
|
const QFileInfo fi(it.first);
|
||||||
ui->projTreeWidget->addItem(it.second, it.first,
|
ui->projTreeWidget->addItem(it.second, it.first,
|
||||||
QDir::toNativeSeparators(fi.absolutePath()));
|
QDir::toNativeSeparators(fi.absolutePath()));
|
||||||
|
|||||||
@@ -117,19 +117,6 @@
|
|||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="1" column="0" colspan="3">
|
||||||
<widget class="Utils::WelcomeModeLabel" name="projTitleLabel">
|
<widget class="Utils::WelcomeModeLabel" name="projTitleLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -245,19 +232,6 @@
|
|||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -324,9 +298,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<zorder></zorder>
|
<zorder></zorder>
|
||||||
<zorder>layoutWidget</zorder>
|
|
||||||
<zorder>horizontalSpacer_2</zorder>
|
|
||||||
<zorder>horizontalSpacer_2</zorder>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user