← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~mzanetti/reminders-app/fix-search into lp:reminders-app

 

Michael Zanetti has proposed merging lp:~mzanetti/reminders-app/fix-search into lp:reminders-app.

Commit message:
some more fixes for search

* fix actions invoked from search page
* make note page work from everywhere


Requested reviews:
  Ubuntu Reminders app developers (reminders-app-dev)

For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/fix-search/+merge/251846
-- 
Your team Ubuntu Reminders app developers is requested to review the proposed merge of lp:~mzanetti/reminders-app/fix-search into lp:reminders-app.
=== modified file 'src/app/qml/reminders.qml'
--- src/app/qml/reminders.qml	2015-03-04 14:31:29 +0000
+++ src/app/qml/reminders.qml	2015-03-04 23:10:56 +0000
@@ -149,6 +149,7 @@
         var page = component.createObject();
         pagestack.push(page)
         page.noteSelected.connect(function(note) {root.displayNote(note)})
+        page.editNote.connect(function(note) {root.switchToEditMode(note)})
     }
 
     function doLogin() {
@@ -502,6 +503,9 @@
                         page.editNote.connect(function(note) {
                             root.switchToEditMode(note)
                         })
+                        page.openSearch.connect(function() {
+                            root.openSearch();
+                        })
                         NotesStore.refreshNotes();
                     }
 

=== modified file 'src/app/qml/ui/SearchNotesPage.qml'
--- src/app/qml/ui/SearchNotesPage.qml	2015-02-28 01:43:49 +0000
+++ src/app/qml/ui/SearchNotesPage.qml	2015-03-04 23:10:56 +0000
@@ -19,6 +19,7 @@
 import QtQuick 2.3
 import Ubuntu.Components 1.1
 import Ubuntu.Components.ListItems 1.0
+import Ubuntu.Components.Popups 1.0
 import Evernote 0.1
 import "../components"
 
@@ -26,6 +27,7 @@
     id: root
 
     signal noteSelected(var note)
+    signal editNote(var note)
 
     title: i18n.tr("Search notes")
 
@@ -69,6 +71,12 @@
 
             model: Notes {
                 onlySearchResults: true
+
+                Component.onCompleted: {
+                    if (count > 0) {
+                        NotesStore.clearSearchResults();
+                    }
+                }
             }
 
             delegate: NotesDelegate {
@@ -105,8 +113,9 @@
                     pageStack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: NotesStore.note(model.guid) });
                 }
                 onEditTags: {
-                    PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
+                    var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
                                     { note: NotesStore.note(model.guid), pageHeight: root.height });
+                    popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})
                 }
             }
         }

=== modified file 'src/libqtevernote/notesstore.cpp'
--- src/libqtevernote/notesstore.cpp	2015-03-04 20:30:55 +0000
+++ src/libqtevernote/notesstore.cpp	2015-03-04 23:10:56 +0000
@@ -1374,10 +1374,7 @@
 
 void NotesStore::findNotes(const QString &searchWords)
 {
-    foreach (Note *note, m_notes) {
-        note->setIsSearchResult(false);
-    }
-    emit dataChanged(index(0), index(m_notes.count()), QVector<int>() << RoleIsSearchResult);
+    clearSearchResults();
 
     FetchNotesJob *job = new FetchNotesJob(QString(), searchWords);
     connect(job, &FetchNotesJob::jobDone, this, &NotesStore::fetchNotesJobDone);


Follow ups