Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 28d57337 authored by Camilo higuita's avatar Camilo higuita

better grouping of call logs

parent 45ca06c9
......@@ -58,7 +58,12 @@ void CallLogs::getList(const bool &cached)
#ifdef STATIC_MAUIKIT
for(const auto &item : MAUIAndroid::getCallLogs())
this->list << FM::toModel(item.toMap());
{
auto map = item.toMap();
map.insert(FMH::MODEL_NAME[FMH::MODEL_KEY::MODIFIED],
QDate(QDateTime::fromString(map.value(FMH::MODEL_NAME[FMH::MODEL_KEY::DATE]).toString(), "dd-MM-yyyy HH:mm").date()).toString(Qt::TextDate));
this->list << FM::toModel(map);
}
#endif
this->sortList();
......@@ -93,12 +98,11 @@ void CallLogs::sortList()
{
case FMH::MODEL_KEY::DATE:
{
auto currentTime = QDateTime::currentDateTime();
auto date1 = QDateTime::fromString(e1[key], "dd-MM-yyyy HH:mm");
auto date2 = QDateTime::fromString(e2[key], "dd-MM-yyyy HH:mm");
auto date1 = QDateTime::fromString(e1[key], "dd-MM-yyyy HH:mm").date();
auto date2 = QDateTime::fromString(e2[key], "dd-MM-yyyy HH:mm").date();
if (OP(date1.secsTo(currentTime), date2.secsTo(currentTime), order))
if (OP(date1.daysTo(QDate::currentDate()), date2.daysTo(QDate::currentDate()), order))
return true;
break;
......
......@@ -32,12 +32,12 @@ Maui.Page
spacing: space.big
clip: true
section.property: "date"
section.property: "modified"
section.criteria: ViewSection.FullString
section.labelPositioning: ViewSection.InlineLabels
section.delegate: Maui.LabelDelegate
{
label: Maui.FM.formatDate(section, "MM/dd/yyyy", "dd-MM-yyyy HH:mm")
label: section
isSection: true
boldLabel: true
// colorScheme.backgroundColor: "#333"
......@@ -59,8 +59,8 @@ Maui.Page
{
id: _delegate
label1.text: model.n + " / " + model.tel
label2.text: model.date
label1.text: model.n
label2.text: Maui.FM.formatDate(model.date, "HH:mm", "dd-MM-yyyy HH:mm") + " / " + new Date(model.duration * 1000).toISOString().substr(11, 8);
label3.text: model.type
height: unit * 60
......@@ -77,6 +77,14 @@ Maui.Page
case "MISSED" : return "dialog-close";
}
iconColor: switch (model.type)
{
case "INCOMING" : return suggestedColor;
case "OUTGOING" : return warningColor;
case "MISSED" : return dangerColor;
}
}
Connections
......
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