Commit 4fc86180 authored by Camilo higuita's avatar Camilo higuita

correct issues

parent aa546e13
...@@ -140,6 +140,8 @@ bool Links::update(const QVariantMap &data, const int &index) ...@@ -140,6 +140,8 @@ bool Links::update(const QVariantMap &data, const int &index)
if(this->update(newData)) if(this->update(newData))
{ {
qDebug() << "update link" << newData;
emit this->updateModel(index, roles); emit this->updateModel(index, roles);
return true; return true;
} }
......
...@@ -27,7 +27,7 @@ public slots: ...@@ -27,7 +27,7 @@ public slots:
QVariantMap get(const int &index) const override; QVariantMap get(const int &index) const override;
bool insert(const QVariantMap &link) override; bool insert(const QVariantMap &link) override;
bool update(const int &index, const QVariant &value, const int &role) override; //deprecrated bool update(const int &index, const QVariant &value, const int &role) override; //deprecrated
bool update(const QVariantMap &data, const int &index); bool update(const QVariantMap &data, const int &index) override;
bool update(const OWL::DB &link) override; bool update(const OWL::DB &link) override;
bool remove(const int &index) override; bool remove(const int &index) override;
......
...@@ -117,7 +117,7 @@ Maui.Page ...@@ -117,7 +117,7 @@ Maui.Page
Previewer Previewer
{ {
id: previewer id: previewer
onLinkSaved: linksList.update(link) onLinkSaved: linksList.update(link, linksView.currentIndex)
} }
Links Links
......
...@@ -141,6 +141,7 @@ Maui.Dialog ...@@ -141,6 +141,7 @@ Maui.Dialog
function show(link) function show(link)
{ {
console.log("STATE:" , link.fav)
webView.url = link.link webView.url = link.link
tagBar.populate(link.tags) tagBar.populate(link.tags)
pinButton.checked = link.pin == 1 pinButton.checked = link.pin == 1
...@@ -151,13 +152,14 @@ Maui.Dialog ...@@ -151,13 +152,14 @@ Maui.Dialog
function packLink() function packLink()
{ {
console.log(favButton.checked)
linkSaved({ linkSaved({
title: webView.title, title: webView.title,
link: webView.url, link: webView.url,
color: colorBar.currentColor, color: selectedColor,
tag: tagBar.getTags(), tag: tagBar.getTags(),
pin: pinButton.checked, pin: pinButton.checked ? 1 : 0,
fav: favButton.checked, fav: favButton.checked ? 1 : 0,
updated: new Date() updated: new Date()
}) })
} }
......
...@@ -217,8 +217,8 @@ Maui.Page ...@@ -217,8 +217,8 @@ Maui.Page
target: cardsView.menu target: cardsView.menu
onOpened: onOpened:
{ {
cardsView.menu.isFav = currentNote.fav == 1 ? true : false cardsView.menu.isFav = currentNote.fav == 1
cardsView.menu.isPin = currentNote.pin == 1 ? true : false cardsView.menu.isPin = currentNote.pin == 1
} }
onDeleteClicked: notesList.remove(cardsView.currentIndex) onDeleteClicked: notesList.remove(cardsView.currentIndex)
......
...@@ -211,8 +211,8 @@ Maui.Dialog ...@@ -211,8 +211,8 @@ Maui.Dialog
body: editor.body.text, body: editor.body.text,
color: selectedColor, color: selectedColor,
tag: tagBar.getTags(), tag: tagBar.getTags(),
pin: pinButton.checked, pin: pinButton.checked ? 1 : 0,
fav: favButton.checked, fav: favButton.checked ? 1 : 0,
updated: new Date() 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