Commit e80ba181 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Sort insertion order using int instead of string.

Related to #583
parent 1e00ab87
Pipeline #31839 passed with stage
in 10 minutes and 12 seconds
...@@ -132,7 +132,7 @@ QVariant AbstractProjectItem::getData(DataType type) const ...@@ -132,7 +132,7 @@ QVariant AbstractProjectItem::getData(DataType type) const
data = QVariant(m_thumbnail); data = QVariant(m_thumbnail);
break; break;
case DataId: case DataId:
data = QVariant(m_binId); data = QVariant(m_binId.toInt());
break; break;
case DataDuration: case DataDuration:
data = QVariant(m_duration); data = QVariant(m_duration);
......
...@@ -124,6 +124,9 @@ bool ProjectSortProxyModel::lessThan(const QModelIndex &left, const QModelIndex ...@@ -124,6 +124,9 @@ bool ProjectSortProxyModel::lessThan(const QModelIndex &left, const QModelIndex
if (leftData.type() == QVariant::DateTime) { if (leftData.type() == QVariant::DateTime) {
return leftData.toDateTime() < rightData.toDateTime(); return leftData.toDateTime() < rightData.toDateTime();
} }
if (leftData.type() == QVariant::Int) {
return leftData.toInt() < rightData.toInt();
}
return m_collator.compare(leftData.toString(), rightData.toString()) < 0; return m_collator.compare(leftData.toString(), rightData.toString()) < 0;
} }
if (sortOrder() == Qt::AscendingOrder) { if (sortOrder() == Qt::AscendingOrder) {
......
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