Add sort by insert order

Related to #287
parent 75c79f6c
Pipeline #12572 passed with stage
in 21 minutes and 52 seconds
......@@ -221,7 +221,7 @@ QVariant AbstractProjectItem::getData(DataType type) const
int AbstractProjectItem::supportedDataCount() const
{
return 6;
return 7;
}
QString AbstractProjectItem::name() const
......
......@@ -883,10 +883,15 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
sortByDuration->setCheckable(true);
sortByDuration->setData(5);
sortByDuration->setChecked(binSort == 5);
QAction *sortByInsert = new QAction(i18n("Insert Order"), m_sortGroup);
sortByInsert->setCheckable(true);
sortByInsert->setData(6);
sortByInsert->setChecked(binSort == 6);
sort->addAction(sortByName);
sort->addAction(sortByDate);
sort->addAction(sortByDuration);
sort->addAction(sortByType);
sort->addAction(sortByInsert);
sort->addAction(sortByDesc);
sort->addSeparator();
sort->addAction(m_sortDescend);
......
......@@ -97,6 +97,9 @@ int ProjectItemModel::mapToColumn(int column) const
case 5:
return AbstractProjectItem::DataDuration;
break;
case 6:
return AbstractProjectItem::DataId;
break;
default:
return AbstractProjectItem::DataName;
}
......@@ -257,6 +260,9 @@ QVariant ProjectItemModel::headerData(int section, Qt::Orientation orientation,
case 5:
columnName = i18n("Duration");
break;
case 6:
columnName = i18n("Id");
break;
default:
columnName = i18n("Unknown");
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment