Skip to content
Snippets Groups Projects
Commit 31f74ef3 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

roles: add IndexedLastUsed to Ring::Role enum

This is used to get the history category enum value rather
than the formatted string to be able to do comparisons,
since the formatted string changes depending on the language.

Issue: #81198
Change-Id: I215571beea11e9bb543fdbfba93041c43cd2e4f5
parent ae023b2d
No related branches found
No related tags found
No related merge requests found
......@@ -494,6 +494,8 @@ QVariant ContactMethod::roleData(int role) const
case static_cast<int>(Call::Role::FormattedDate):
cat = !lastCall ? QVariant() : HistoryTimeCategoryModel::timeToHistoryCategory(lastCall->startTimeStamp());
break;
case static_cast<int>(Ring::Role::IndexedLastUsed):
return QVariant(static_cast<int>(HistoryTimeCategoryModel::timeToHistoryConst(lastCall->startTimeStamp())));
case static_cast<int>(Call::Role::HasAVRecording):
cat = cat = !lastCall ? QVariant() : lastCall->isAVRecording();
break;
......
......@@ -41,6 +41,7 @@ enum class Role
Number ,
LastUsed ,
FormattedLastUsed ,
IndexedLastUsed ,
State ,
FormattedState ,
DropState ,
......
......@@ -568,6 +568,7 @@ QVariant Person::roleData(int role) const
case static_cast<int>(Ring::Role::FormattedLastUsed):
case static_cast<int>(Person::Role::FormattedLastUsed):
return QVariant(HistoryTimeCategoryModel::timeToHistoryCategory(lastUsedTime()));
case static_cast<int>(Ring::Role::IndexedLastUsed):
case static_cast<int>(Person::Role::IndexedLastUsed):
return QVariant(static_cast<int>(HistoryTimeCategoryModel::timeToHistoryConst(lastUsedTime())));
case static_cast<int>(Ring::Role::Object):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment