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 b6ec8a73 authored by Camilo higuita's avatar Camilo higuita

order links too by updated time

parent a1685a04
......@@ -140,7 +140,9 @@ Maui.ApplicationWindow
NewLinkDialog
{
id: newLinkDialog
onLinkSaved: owl.insertLink(link)
onLinkSaved: if(owl.insertLink(link))
linksView.cardsView.currentItem.update(note)
}
// /***** VIEWS *****/
......
......@@ -128,6 +128,7 @@ bool DBActions::updateNote(const QVariantMap &note)
auto pin = note[OWL::KEYMAP[OWL::KEY::PIN]].toInt();
auto fav = note[OWL::KEYMAP[OWL::KEY::FAV]].toInt();
auto tags = note[OWL::KEYMAP[OWL::KEY::TAG]].toStringList();
auto updated = note[OWL::KEYMAP[OWL::KEY::UPDATED]].toString();
QVariantMap note_map =
{
......@@ -136,7 +137,7 @@ bool DBActions::updateNote(const QVariantMap &note)
{OWL::KEYMAP[OWL::KEY::COLOR], color},
{OWL::KEYMAP[OWL::KEY::PIN], pin},
{OWL::KEYMAP[OWL::KEY::FAV], fav},
{OWL::KEYMAP[OWL::KEY::UPDATED], QDateTime::currentDateTime().toString()}
{OWL::KEYMAP[OWL::KEY::UPDATED], updated}
};
for(auto tg : tags)
......@@ -153,7 +154,7 @@ bool DBActions::removeNote(const QVariantMap &note)
QVariantList DBActions::getNotes()
{
return this->get("select * from notes order by updated asc");
return this->get("select * from notes ORDER BY updated ASC");
}
QVariantList DBActions::getNoteTags(const QString &id)
......@@ -205,13 +206,14 @@ bool DBActions::updateLink(const QVariantMap &link)
auto pin = link[OWL::KEYMAP[OWL::KEY::PIN]].toInt();
auto fav = link[OWL::KEYMAP[OWL::KEY::FAV]].toInt();
auto tags = link[OWL::KEYMAP[OWL::KEY::TAG]].toStringList();
auto updated = link[OWL::KEYMAP[OWL::KEY::UPDATED]].toString();
QVariantMap link_map =
{
{OWL::KEYMAP[OWL::KEY::COLOR], color},
{OWL::KEYMAP[OWL::KEY::PIN], pin},
{OWL::KEYMAP[OWL::KEY::FAV], fav},
{OWL::KEYMAP[OWL::KEY::UPDATED], QDateTime::currentDateTime().toString()},
{OWL::KEYMAP[OWL::KEY::UPDATED], updated},
};
for(auto tg : tags)
......@@ -228,7 +230,7 @@ bool DBActions::removeLink(const QVariantMap &link)
QVariantList DBActions::getLinks()
{
return this->get("select * from links");
return this->get("select * from links ORDER BY updated ASC");
}
QVariantList DBActions::getLinkTags(const QString &link)
......
......@@ -174,7 +174,8 @@ Maui.Popup
color: colorBar.currentColor,
tag: tagBar.getTags(),
pin: pinButton.checked,
fav: favButton.checked
fav: favButton.checked,
updated: new Date()
})
}
}
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