From 42955187fa76443a927c4c9159be17a77899aa71 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 29 Dec 2016 21:51:10 +0100 Subject: [PATCH] Clean up --- QtClient/JoplinQtClient/JoplinQtClient.pro | 2 -- QtClient/JoplinQtClient/application.h | 2 -- QtClient/JoplinQtClient/models/notecollection.cpp | 2 +- QtClient/JoplinQtClient/models/notemodel.cpp | 1 + QtClient/JoplinQtClient/models/qmlnote.cpp | 2 -- QtClient/JoplinQtClient/models/qmlnote.h | 5 ----- QtClient/JoplinQtClient/qml.qrc | 2 -- QtClient/JoplinQtClient/settings.h | 3 --- QtClient/JoplinQtClient/sparsevector.hpp | 2 +- QtClient/JoplinQtClient/synchronizer.cpp | 2 +- QtClient/JoplinQtClient/webapi.cpp | 2 +- 11 files changed, 5 insertions(+), 20 deletions(-) diff --git a/QtClient/JoplinQtClient/JoplinQtClient.pro b/QtClient/JoplinQtClient/JoplinQtClient.pro index 2d58a49cb..5744be027 100755 --- a/QtClient/JoplinQtClient/JoplinQtClient.pro +++ b/QtClient/JoplinQtClient/JoplinQtClient.pro @@ -12,7 +12,6 @@ SOURCES += \ models/note.cpp \ application.cpp \ models/notecollection.cpp \ - services/notecache.cpp \ models/qmlnote.cpp \ webapi.cpp \ synchronizer.cpp \ @@ -40,7 +39,6 @@ HEADERS += \ models/note.h \ application.h \ models/notecollection.h \ - services/notecache.h \ sparsevector.hpp \ models/qmlnote.h \ webapi.h \ diff --git a/QtClient/JoplinQtClient/application.h b/QtClient/JoplinQtClient/application.h index e9ff2a1bd..aa8fd42ed 100755 --- a/QtClient/JoplinQtClient/application.h +++ b/QtClient/JoplinQtClient/application.h @@ -7,7 +7,6 @@ #include "models/foldermodel.h" #include "models/notecollection.h" #include "models/foldercollection.h" -#include "services/notecache.h" #include "models/notemodel.h" #include "models/qmlnote.h" #include "webapi.h" @@ -32,7 +31,6 @@ private: NoteModel noteModel_; QString selectedFolderId() const; QString selectedNoteId() const; - NoteCache noteCache_; QmlNote selectedQmlNote_; WebApi api_; Synchronizer synchronizer_; diff --git a/QtClient/JoplinQtClient/models/notecollection.cpp b/QtClient/JoplinQtClient/models/notecollection.cpp index a67af4d01..f339e1e0c 100755 --- a/QtClient/JoplinQtClient/models/notecollection.cpp +++ b/QtClient/JoplinQtClient/models/notecollection.cpp @@ -59,7 +59,7 @@ int NoteCollection::count() const { Note NoteCollection::byId(const QString& id) const { std::vector indexes = cache_.indexes(); - for (int i = 0; i < indexes.size(); i++) { + for (size_t i = 0; i < indexes.size(); i++) { Note note = cache_.get(indexes[i]); if (note.id() == id) return note; } diff --git a/QtClient/JoplinQtClient/models/notemodel.cpp b/QtClient/JoplinQtClient/models/notemodel.cpp index 99748bd8e..9cf80180c 100755 --- a/QtClient/JoplinQtClient/models/notemodel.cpp +++ b/QtClient/JoplinQtClient/models/notemodel.cpp @@ -6,6 +6,7 @@ jop::NoteModel::NoteModel() } int jop::NoteModel::rowCount(const QModelIndex &parent) const { + Q_UNUSED(parent); return collection_.count(); } diff --git a/QtClient/JoplinQtClient/models/qmlnote.cpp b/QtClient/JoplinQtClient/models/qmlnote.cpp index 4db9d49b8..476e03d6d 100755 --- a/QtClient/JoplinQtClient/models/qmlnote.cpp +++ b/QtClient/JoplinQtClient/models/qmlnote.cpp @@ -15,6 +15,4 @@ QString QmlNote::body() const { void QmlNote::setNote(const Note ¬e) { note_ = note; emit changed(); - //emit titleChanged(); - //emit bodyChanged(); } diff --git a/QtClient/JoplinQtClient/models/qmlnote.h b/QtClient/JoplinQtClient/models/qmlnote.h index d09c09475..71ade08c0 100755 --- a/QtClient/JoplinQtClient/models/qmlnote.h +++ b/QtClient/JoplinQtClient/models/qmlnote.h @@ -10,9 +10,6 @@ class QmlNote : public QObject { Q_OBJECT - Q_PROPERTY(QString title READ title NOTIFY titleChanged) - Q_PROPERTY(QString body READ body NOTIFY bodyChanged) - public: QmlNote(); @@ -22,8 +19,6 @@ public: signals: - void titleChanged(); - void bodyChanged(); void changed(); private: diff --git a/QtClient/JoplinQtClient/qml.qrc b/QtClient/JoplinQtClient/qml.qrc index f4196f7d4..9a4adf8c5 100755 --- a/QtClient/JoplinQtClient/qml.qrc +++ b/QtClient/JoplinQtClient/qml.qrc @@ -5,8 +5,6 @@ NoteList.qml NoteEditor.qml AddButton.qml - Test.qml - TestForm.ui.qml EditableListItem.qml diff --git a/QtClient/JoplinQtClient/settings.h b/QtClient/JoplinQtClient/settings.h index 7e9e0ba70..767a6cc4c 100755 --- a/QtClient/JoplinQtClient/settings.h +++ b/QtClient/JoplinQtClient/settings.h @@ -9,9 +9,6 @@ class Settings : public QSettings { Q_OBJECT -//public: -// Settings(); - }; } diff --git a/QtClient/JoplinQtClient/sparsevector.hpp b/QtClient/JoplinQtClient/sparsevector.hpp index b4d6d2259..06c818136 100755 --- a/QtClient/JoplinQtClient/sparsevector.hpp +++ b/QtClient/JoplinQtClient/sparsevector.hpp @@ -96,7 +96,7 @@ public: // Returns a vector containing the indexes that are not currently set around // the given index, up to bufferSize indexes. - std::vector availableBufferAround(int index, int bufferSize) const { + std::vector availableBufferAround(int index, size_t bufferSize) const { std::vector temp; // Doesn't make sense to search for an empty buffer around diff --git a/QtClient/JoplinQtClient/synchronizer.cpp b/QtClient/JoplinQtClient/synchronizer.cpp index 50bf66b5c..3f3c54ff1 100755 --- a/QtClient/JoplinQtClient/synchronizer.cpp +++ b/QtClient/JoplinQtClient/synchronizer.cpp @@ -44,7 +44,7 @@ void Synchronizer::start() { api_.put("folders/" + folder.id(), QUrlQuery(), data, "putFolder:" + folder.id()); } - for (size_t i = 0; i < notes.size(); i++) { + for (int i = 0; i < notes.size(); i++) { Note note = notes[i]; QUrlQuery data; data.addQueryItem("id", note.id()); diff --git a/QtClient/JoplinQtClient/webapi.cpp b/QtClient/JoplinQtClient/webapi.cpp index 73f680f48..203cea511 100755 --- a/QtClient/JoplinQtClient/webapi.cpp +++ b/QtClient/JoplinQtClient/webapi.cpp @@ -93,7 +93,7 @@ void WebApi::request_finished(QNetworkReply *reply) { response = doc.object(); } - for (size_t i = 0; i < inProgressRequests_.size(); i++) { + for (int i = 0; i < inProgressRequests_.size(); i++) { QueuedRequest r = inProgressRequests_[i]; if (r.reply == reply) { inProgressRequests_.erase(inProgressRequests_.begin() + i);