forked from qt-creator/qt-creator
SubmitFileModel: Simplify list construction
Change-Id: Ie59501ec245020666e59b41b9690a562538cd69c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
eff6f2cebb
commit
ca95965b27
@@ -90,8 +90,7 @@ static QList<QStandardItem *> createFileRow(const QString &repositoryRoot,
|
|||||||
// Note: for "overlaid" icons in Core::FileIconProvider a valid file path is not required
|
// Note: for "overlaid" icons in Core::FileIconProvider a valid file path is not required
|
||||||
const QFileInfo fi(repositoryRoot + QLatin1Char('/') + fileName);
|
const QFileInfo fi(repositoryRoot + QLatin1Char('/') + fileName);
|
||||||
fileItem->setIcon(Core::FileIconProvider::icon(fi));
|
fileItem->setIcon(Core::FileIconProvider::icon(fi));
|
||||||
QList<QStandardItem *> row;
|
const QList<QStandardItem *> row{statusItem, fileItem};
|
||||||
row << statusItem << fileItem;
|
|
||||||
if (statusHint != SubmitFileModel::FileStatusUnknown) {
|
if (statusHint != SubmitFileModel::FileStatusUnknown) {
|
||||||
const QBrush textForeground = fileStatusTextForeground(statusHint);
|
const QBrush textForeground = fileStatusTextForeground(statusHint);
|
||||||
foreach (QStandardItem *item, row)
|
foreach (QStandardItem *item, row)
|
||||||
@@ -117,9 +116,7 @@ SubmitFileModel::SubmitFileModel(QObject *parent) :
|
|||||||
QStandardItemModel(0, 2, parent)
|
QStandardItemModel(0, 2, parent)
|
||||||
{
|
{
|
||||||
// setColumnCount(2);
|
// setColumnCount(2);
|
||||||
QStringList headerLabels;
|
setHorizontalHeaderLabels({tr("State"), tr("File")});
|
||||||
headerLabels << tr("State") << tr("File");
|
|
||||||
setHorizontalHeaderLabels(headerLabels);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &SubmitFileModel::repositoryRoot() const
|
const QString &SubmitFileModel::repositoryRoot() const
|
||||||
|
|||||||
Reference in New Issue
Block a user