From 1396633e34cdd47a4a2dc7db041b3217369d0ea7 Mon Sep 17 00:00:00 2001 From: Scharel Clemens Date: Tue, 4 Dec 2018 11:24:07 +0100 Subject: [PATCH] Bugfix: Adding notes is possible again --- qml/cover/CoverPage.qml | 2 +- qml/pages/NotesApi.qml | 4 ++-- qml/pages/NotesPage.qml | 2 +- rpm/harbour-nextcloudnotes.changes | 3 +++ rpm/harbour-nextcloudnotes.yaml | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/qml/cover/CoverPage.qml b/qml/cover/CoverPage.qml index 3383bfe..783a723 100644 --- a/qml/cover/CoverPage.qml +++ b/qml/cover/CoverPage.qml @@ -15,7 +15,7 @@ CoverBackground { CoverAction { iconSource: "image://theme/icon-cover-new" onTriggered: { - nextcloudAccounts.itemAt(appSettings.currentAccount).createNote() + nextcloudAccounts.itemAt(appSettings.currentAccount).createNote({'content': ""}) appWindow.activate() } } diff --git a/qml/pages/NotesApi.qml b/qml/pages/NotesApi.qml index 1aee253..126c560 100644 --- a/qml/pages/NotesApi.qml +++ b/qml/pages/NotesApi.qml @@ -106,7 +106,7 @@ Item { break; case "DELETE": console.log("Deleted a note via API: " + endpoint) - removeFromModelData(data.id) + _removeFromModelData(data.id) break; default: console.log("Unsupported method: " + method) @@ -199,7 +199,7 @@ Item { function _removeFromModelData(id) { modelData.forEach(function(currentValue, index, array) { if (currentValue.id === id) { - modelData.splice(i, 1) + modelData.splice(index, 1) } } ) _mapDataToModel() diff --git a/qml/pages/NotesPage.qml b/qml/pages/NotesPage.qml index d02b213..9a3182d 100644 --- a/qml/pages/NotesPage.qml +++ b/qml/pages/NotesPage.qml @@ -40,7 +40,7 @@ Page { text: qsTr("Add note") enabled: nextcloudAccounts.itemAt(appSettings.currentAccount) ? true : false visible: appSettings.currentAccount >= 0 - onClicked: nextcloudAccounts.itemAt(appSettings.currentAccount).createNote() + onClicked: nextcloudAccounts.itemAt(appSettings.currentAccount).createNote({'content': ""}) } MenuItem { text: enabled ? qsTr("Reload") : qsTr("Updating...") diff --git a/rpm/harbour-nextcloudnotes.changes b/rpm/harbour-nextcloudnotes.changes index 69b235a..82ad54b 100644 --- a/rpm/harbour-nextcloudnotes.changes +++ b/rpm/harbour-nextcloudnotes.changes @@ -12,6 +12,9 @@ # * date Author's Name version-release # - Summary of changes +* Tue Dec 04 2018 Scharel Clemens 0.1-6 +- Bugfix: Adding notes is possible again + * Tue Dec 04 2018 Scharel Clemens 0.1-5 - Implemented auto prepend for list elements diff --git a/rpm/harbour-nextcloudnotes.yaml b/rpm/harbour-nextcloudnotes.yaml index 0b9be1d..dd8c654 100644 --- a/rpm/harbour-nextcloudnotes.yaml +++ b/rpm/harbour-nextcloudnotes.yaml @@ -1,7 +1,7 @@ Name: harbour-nextcloudnotes Summary: Nextcloud Notes Version: 0.1 -Release: 5 +Release: 6 # The contents of the Group field should be one of the groups listed here: # https://github.com/mer-tools/spectacle/blob/master/data/GROUPS Group: Qt/Qt