Use the model of NotesApp

This commit is contained in:
scharel 2021-07-01 19:10:12 +02:00
parent 6ff59f1971
commit 5cb5ec8637
4 changed files with 10 additions and 9 deletions

View file

@ -80,8 +80,9 @@ ApplicationWindow
Connections {
target: appSettings
onCurrentAccountChanged: {
account.path = appSettings.path + "/accounts/" + appSettings.currentAccount
console.log("Current account: " + account.username + "@" + account.url)
account.path = appSettings.path + "/accounts/" + appSettings.currentAccount
notesApp.model().account = appSettings.currentAccount
}
}

View file

@ -88,7 +88,7 @@ Page {
currentIndex: -1
model: notesModel
model: notesApp.model()
delegate: BackgroundItem {
id: note

View file

@ -156,7 +156,7 @@ void NotesApp::updateReply(QNetworkReply* reply) {
QByteArray data = reply->readAll();
//qDebug() << data;
QJsonDocument json = QJsonDocument::fromJson(data);
qDebug() << json;
//qDebug() << json;
if (json.isObject()) {
QJsonObject obj = json.object();
updateNote(obj.value("id").toInt(), obj, true);

View file

@ -912,27 +912,27 @@ You can also use other markdown syntax inside them.</source>
<context>
<name>harbour-nextcloudnotes</name>
<message>
<location filename="../qml/harbour-nextcloudnotes.qml" line="115"/>
<location filename="../qml/harbour-nextcloudnotes.qml" line="116"/>
<source>Notes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/harbour-nextcloudnotes.qml" line="116"/>
<location filename="../qml/harbour-nextcloudnotes.qml" line="117"/>
<source>Offline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/harbour-nextcloudnotes.qml" line="117"/>
<location filename="../qml/harbour-nextcloudnotes.qml" line="118"/>
<source>Synced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/harbour-nextcloudnotes.qml" line="131"/>
<location filename="../qml/harbour-nextcloudnotes.qml" line="132"/>
<source>API error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/harbour-nextcloudnotes.qml" line="124"/>
<location filename="../qml/harbour-nextcloudnotes.qml" line="125"/>
<source>File error</source>
<translation type="unfinished"></translation>
</message>