mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Clean up
This commit is contained in:
parent
5f14d830e3
commit
42955187fa
@ -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 \
|
||||
|
@ -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_;
|
||||
|
@ -59,7 +59,7 @@ int NoteCollection::count() const {
|
||||
|
||||
Note NoteCollection::byId(const QString& id) const {
|
||||
std::vector<int> 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;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ jop::NoteModel::NoteModel()
|
||||
}
|
||||
|
||||
int jop::NoteModel::rowCount(const QModelIndex &parent) const {
|
||||
Q_UNUSED(parent);
|
||||
return collection_.count();
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,4 @@ QString QmlNote::body() const {
|
||||
void QmlNote::setNote(const Note ¬e) {
|
||||
note_ = note;
|
||||
emit changed();
|
||||
//emit titleChanged();
|
||||
//emit bodyChanged();
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -5,8 +5,6 @@
|
||||
<file>NoteList.qml</file>
|
||||
<file>NoteEditor.qml</file>
|
||||
<file>AddButton.qml</file>
|
||||
<file>Test.qml</file>
|
||||
<file>TestForm.ui.qml</file>
|
||||
<file>EditableListItem.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -9,9 +9,6 @@ class Settings : public QSettings {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
//public:
|
||||
// Settings();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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<int> availableBufferAround(int index, int bufferSize) const {
|
||||
std::vector<int> availableBufferAround(int index, size_t bufferSize) const {
|
||||
std::vector<int> temp;
|
||||
|
||||
// Doesn't make sense to search for an empty buffer around
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user