Permalink
Browse files

Merge branch 'fix-empty-recent-list'

  • Loading branch information...
riuson committed Jul 15, 2012
2 parents 73cfc6d + 6b1b9c9 commit de6afc93daac00a0e6f49d755c018acb139323c5
Showing with 14 additions and 9 deletions.
  1. +14 −9 controls/starttab.cpp
@@ -44,17 +44,22 @@ void StartTab::setRecentFiles(const QStringList *list)
{
this->mRecentFilesList = list;

QString listTemplate = this->ui->labelRecentFiles->text();
QString listItems;
for (int i = 0; i < list->count(); i++)
if (list->count() > 0)
{
QString filename = list->at(i);
QString strippedName = QFileInfo(filename).fileName();
QString text = QString("<li><a href=\"%1\">%2</a></li>").arg(filename).arg(strippedName);
listItems.append(text);
QString listTemplate = this->ui->labelRecentFiles->text();
QString listItems;
for (int i = 0; i < list->count(); i++)
{
QString filename = list->at(i);
QString strippedName = QFileInfo(filename).fileName();
QString text = QString("<li><a href=\"%1\">%2</a></li>").arg(filename).arg(strippedName);
listItems.append(text);
}
listTemplate.replace("#list#", listItems);
this->ui->labelRecentFiles->setText(listTemplate);
}
listTemplate.replace("#list#", listItems);
this->ui->labelRecentFiles->setText(listTemplate);
else
this->ui->labelRecentFiles->hide();
}
//-----------------------------------------------------------------------------
const QString StartTab::tabName() const

0 comments on commit de6afc9

Please sign in to comment.