Use the model of NotesApp
This commit is contained in:
parent
6ff59f1971
commit
5cb5ec8637
4 changed files with 10 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ Page {
|
|||
|
||||
currentIndex: -1
|
||||
|
||||
model: notesModel
|
||||
model: notesApp.model()
|
||||
|
||||
delegate: BackgroundItem {
|
||||
id: note
|
||||
|
|
|
@ -88,7 +88,7 @@ bool NotesApp::createNote(const QJsonObject& note, bool local) {
|
|||
}
|
||||
|
||||
bool NotesApp::updateNote(const int id, const QJsonObject& note, bool local) {
|
||||
qDebug() << "Updating note: " << id;
|
||||
qDebug() << "Updating note:" << id;
|
||||
bool done = true;
|
||||
if (!m_notes.contains(QJsonValue(note))) {
|
||||
done = false;
|
||||
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue