diff --git a/QtClient/JoplinQtClient/AddButton.qml b/QtClient/JoplinQtClient/AddButton.qml new file mode 100755 index 000000000..f2c81ad78 --- /dev/null +++ b/QtClient/JoplinQtClient/AddButton.qml @@ -0,0 +1,42 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.1 + +Item { + + id: root + width: 120 + height: 100 + signal addNoteButtonClicked + signal addFolderButtonClicked + + ColumnLayout { + + anchors.fill: parent + spacing: 2 + + Button { + id: addNoteButton + text: "Add note" + Layout.fillWidth: true + Layout.fillHeight: true + onClicked: root.addNoteButtonClicked() + } + + Button { + id: addFolderButton + text: "Add folder" + Layout.fillWidth: true + Layout.fillHeight: true + onClicked: root.addFolderButtonClicked() + } + + Button { + text: "ADD" + Layout.fillWidth: true + Layout.fillHeight: true + } + + } + +} diff --git a/QtClient/JoplinQtClient/EditableListDelegate.qml b/QtClient/JoplinQtClient/EditableListDelegate.qml new file mode 100755 index 000000000..077de4ef9 --- /dev/null +++ b/QtClient/JoplinQtClient/EditableListDelegate.qml @@ -0,0 +1,39 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Component { + Item { + width: parent.width + height: 25 + Text { + id: label + text: display + anchors.fill: parent + MouseArea { + anchors.fill: parent + onClicked: { + listView.currentIndex = index + } + onDoubleClicked: { + label.visible = false + textField.visible = true + textField.focus = true + } + } + } + TextField { + id: textField + text: display + visible: false + width: parent.width + height: parent.height + onAccepted: { + + } + onEditingFinished: { + label.visible = true + textField.visible = false + } + } + } +} diff --git a/QtClient/JoplinQtClient/EditableListItem.qml b/QtClient/JoplinQtClient/EditableListItem.qml new file mode 100755 index 000000000..94cb78534 --- /dev/null +++ b/QtClient/JoplinQtClient/EditableListItem.qml @@ -0,0 +1,43 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Item { + id: root + width: parent.width + height: 25 + Text { + id: label + text: display + anchors.fill: parent + MouseArea { + anchors.fill: parent + onClicked: { + root.ListView.view.currentIndex = index + } + onDoubleClicked: { + label.visible = false + textField.visible = true + textField.focus = true + console.info("Editing ", index) + } + } + } + TextField { + id: textField + text: display + visible: false + width: parent.width + height: parent.height + onAccepted: { + console.info(root.ListView.view.model); + console.info("Done ", index) + root.ListView.view.model.setData(index, text) + //root.ListView.view.model.setDataInt(index, "trest") + //root.ListView.view.currentItem = "test" + } + onEditingFinished: { + label.visible = true + textField.visible = false + } + } +} diff --git a/QtClient/JoplinQtClient/EditableListViewItem.qml b/QtClient/JoplinQtClient/EditableListViewItem.qml new file mode 100755 index 000000000..190109bb1 --- /dev/null +++ b/QtClient/JoplinQtClient/EditableListViewItem.qml @@ -0,0 +1,38 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Item { + id: folderDelegateRoot + width: 100//parent.width + height: 25 + Text { + id: label + text: display + anchors.fill: parent + MouseArea { + anchors.fill: parent + onClicked: { + listView.currentIndex = index + } + onDoubleClicked: { + label.visible = false + textField.visible = true + textField.focus = true + } + } + } + TextField { + id: textField + text: display + visible: false + width: parent.width + height: parent.height + onAccepted: { + + } + onEditingFinished: { + label.visible = true + textField.visible = false + } + } +} diff --git a/QtClient/JoplinQtClient/FolderList.qml b/QtClient/JoplinQtClient/FolderList.qml index e401d930b..95fbcae34 100755 --- a/QtClient/JoplinQtClient/FolderList.qml +++ b/QtClient/JoplinQtClient/FolderList.qml @@ -13,23 +13,6 @@ Item { anchors.fill: parent } - Component { - id: folderDelegate - Item { - width: parent.width - height: 25 - Text { - text: display - } - MouseArea { - anchors.fill: parent - onClicked: { - listView.currentIndex = index - } - } - } - } - ListView { id: listView anchors.fill: parent @@ -37,5 +20,16 @@ Item { ScrollBar.vertical: ScrollBar { } highlight: Rectangle { color: "lightsteelblue"; radius: 5 } focus: true +// onModelChanged: { +//// listView.model.onDataChanged = function() { +//// console.info("testaaaaaaaaaaaaaaaaaaa") +//// } +// console.info("MODEL CHANGAID") +// } + } + + Component { + id: folderDelegate + EditableListItem {} } } diff --git a/QtClient/JoplinQtClient/JoplinQtClient.pro b/QtClient/JoplinQtClient/JoplinQtClient.pro index 69ee23119..c71c4e70b 100755 --- a/QtClient/JoplinQtClient/JoplinQtClient.pro +++ b/QtClient/JoplinQtClient/JoplinQtClient.pro @@ -19,7 +19,9 @@ SOURCES += \ models/qmlnote.cpp \ webapi.cpp \ synchronizer.cpp \ - settings.cpp + settings.cpp \ + models/foldercollection.cpp \ + databaseutils.cpp RESOURCES += qml.qrc \ database.qrc @@ -50,7 +52,10 @@ HEADERS += \ models/qmlnote.h \ webapi.h \ synchronizer.h \ - settings.h + settings.h \ + models/foldercollection.h \ + databaseutils.h \ + simpletypes.h DISTFILES += diff --git a/QtClient/JoplinQtClient/Test.qml b/QtClient/JoplinQtClient/Test.qml new file mode 100755 index 000000000..9121c080d --- /dev/null +++ b/QtClient/JoplinQtClient/Test.qml @@ -0,0 +1,4 @@ +import QtQuick 2.4 + +TestForm { +} diff --git a/QtClient/JoplinQtClient/TestForm.ui.qml b/QtClient/JoplinQtClient/TestForm.ui.qml new file mode 100755 index 000000000..c1bd78d76 --- /dev/null +++ b/QtClient/JoplinQtClient/TestForm.ui.qml @@ -0,0 +1,26 @@ +import QtQuick 2.4 + +Item { + id: item1 + width: 400 + height: 400 + + AddButton { + id: addButton1 + x: 232 + y: 294 + width: 100 + height: 50 + anchors.rightMargin: 0 + anchors.bottom: parent.bottom + anchors.right: parent.right + } + + FolderList { + id: folderList1 + width: 107 + anchors.bottom: parent.bottom + anchors.top: parent.top + anchors.left: parent.left + } +} diff --git a/QtClient/JoplinQtClient/application.cpp b/QtClient/JoplinQtClient/application.cpp index c95166519..fa4db3283 100755 --- a/QtClient/JoplinQtClient/application.cpp +++ b/QtClient/JoplinQtClient/application.cpp @@ -8,7 +8,16 @@ using namespace jop; -Application::Application(int &argc, char **argv) : QGuiApplication(argc, argv), db_("D:/Web/www/joplin/QtClient/data/notes.sqlite"), api_("http://joplin.local"), synchronizer_(api_, db_) { +Application::Application(int &argc, char **argv) : + QGuiApplication(argc, argv), + db_("D:/Web/www/joplin/QtClient/data/notes.sqlite"), + api_("http://joplin.local"), + synchronizer_(api_, db_), + folderCollection_(db_, 0, "title ASC"), + folderModel_(db_) + + { + // This is linked to where the QSettings will be saved. In other words, // if these values are changed, the settings will be reset and saved // somewhere else. @@ -18,8 +27,11 @@ Application::Application(int &argc, char **argv) : QGuiApplication(argc, argv), Settings settings; + //folderCollection_ = FolderCollection(db_, 0, "title ASC"); + folderService_ = FolderService(db_); - folderModel_.setService(folderService_); + //folderModel_.setService(folderService_); + //folderModel_.setCollection(folderCollection_); noteService_ = NoteService(db_); noteModel_.setService(noteService_); @@ -89,7 +101,7 @@ void Application::afterSessionInitialization() { QString sessionId = settings.value("sessionId").toString(); qDebug() << "Session:" << sessionId; api_.setSessionId(sessionId); - synchronizer_.start(); + //synchronizer_.start(); } void Application::view_currentFolderChanged() { @@ -103,3 +115,11 @@ void Application::view_currentNoteChanged() { Note note = noteCollection_.byId(noteId); selectedQmlNote_.setNote(note); } + +void Application::view_addNoteButtonClicked() { + qDebug() << "ici"; +} + +void Application::view_addFolderButtonClicked() { + +} diff --git a/QtClient/JoplinQtClient/application.h b/QtClient/JoplinQtClient/application.h index 95555f96b..68758a060 100755 --- a/QtClient/JoplinQtClient/application.h +++ b/QtClient/JoplinQtClient/application.h @@ -8,6 +8,7 @@ #include "services/noteservice.h" #include "models/foldermodel.h" #include "models/notecollection.h" +#include "models/foldercollection.h" #include "services/notecache.h" #include "models/notemodel.h" #include "models/qmlnote.h" @@ -30,6 +31,7 @@ private: Database db_; FolderService folderService_; NoteCollection noteCollection_; + FolderCollection folderCollection_; NoteService noteService_; FolderModel folderModel_; NoteModel noteModel_; @@ -46,6 +48,8 @@ public slots: void view_currentFolderChanged(); void view_currentNoteChanged(); + void view_addNoteButtonClicked(); + void view_addFolderButtonClicked(); void api_requestDone(const QJsonObject& response, const QString& tag); }; diff --git a/QtClient/JoplinQtClient/database.cpp b/QtClient/JoplinQtClient/database.cpp index 35ecfb68a..6eaf074bd 100755 --- a/QtClient/JoplinQtClient/database.cpp +++ b/QtClient/JoplinQtClient/database.cpp @@ -27,6 +27,10 @@ QSqlQuery Database::query(const QString &sql) const { return output; } +QSqlDatabase &Database::database() { + return db_; +} + //QSqlQuery Database::exec(const QString &sql, const QMap ¶meters) { // QSqlQuery query; // query.prepare(sql); diff --git a/QtClient/JoplinQtClient/database.h b/QtClient/JoplinQtClient/database.h index 8ed8d5442..8f35fc767 100755 --- a/QtClient/JoplinQtClient/database.h +++ b/QtClient/JoplinQtClient/database.h @@ -12,6 +12,7 @@ public: Database(const QString& path); Database(); QSqlQuery query(const QString& sql) const; + QSqlDatabase& database(); private: diff --git a/QtClient/JoplinQtClient/databaseutils.cpp b/QtClient/JoplinQtClient/databaseutils.cpp new file mode 100755 index 000000000..c51e352c7 --- /dev/null +++ b/QtClient/JoplinQtClient/databaseutils.cpp @@ -0,0 +1,69 @@ +#include + +#include "databaseutils.h" + +using namespace jop; + +QSqlQuery dbUtils::buildSqlQuery(QSqlDatabase* db, const QString& type, const QString& tableName, const QStringList& fields, const VariantVector& values, const QString& whereCondition) { + QString sql; + + if (type.toLower() == "insert") { + QString fieldString = ""; + QString valueString = ""; + for (int i = 0; i < fields.length(); i++) { + QString f = fields[i]; + if (fieldString != "") fieldString += ", "; + if (valueString != "") valueString += ", "; + fieldString += f; + valueString += ":" + f; + } + + sql = QString("INSERT INTO %1 (%2) VALUES (%3)").arg(tableName).arg(fieldString).arg(valueString); + } else if (type.toLower() == "update") { + QString fieldString = ""; + for (int i = 0; i < fields.length(); i++) { + QString f = fields[i]; + if (fieldString != "") fieldString += ", "; + fieldString += f + " = :" + f; + } + + sql = QString("UPDATE %1 SET %2").arg(tableName).arg(fieldString); + if (whereCondition != "") sql += " WHERE " + whereCondition; + } + + QSqlQuery query(*db); + query.prepare(sql); + for (int i = 0; i < values.size(); i++) { + QVariant v = values[i]; + QString fieldName = ":" + fields[i]; + if (v.type() == QVariant::String) { + query.bindValue(fieldName, v.toString()); + } else if (v.type() == QVariant::Int) { + query.bindValue(fieldName, v.toInt()); + } else if (v.isNull()) { + query.bindValue(fieldName, (int)NULL); + } else if (v.type() == QVariant::Double) { + query.bindValue(fieldName, v.toDouble()); + } else if (v.type() == (QVariant::Type)QMetaType::Float) { + query.bindValue(fieldName, v.toFloat()); + } else if (v.type() == QVariant::LongLong) { + query.bindValue(fieldName, v.toLongLong()); + } else if (v.type() == QVariant::UInt) { + query.bindValue(fieldName, v.toUInt()); + } else if (v.type() == QVariant::Char) { + query.bindValue(fieldName, v.toChar()); + } else { + qWarning() << Q_FUNC_INFO << "Unsupported variant type:" << v.type(); + } + } + + qDebug() <<"SQL:"< i(query.boundValues()); + while (i.hasNext()) { + i.next(); + qDebug() << i.key() << ":" << i.value().toString(); + } + + return query; +} diff --git a/QtClient/JoplinQtClient/databaseutils.h b/QtClient/JoplinQtClient/databaseutils.h new file mode 100755 index 000000000..1e8835dba --- /dev/null +++ b/QtClient/JoplinQtClient/databaseutils.h @@ -0,0 +1,15 @@ +#ifndef DATABASEUTILS_H +#define DATABASEUTILS_H + +#include +#include "simpletypes.h" + +namespace jop { +namespace dbUtils { + +QSqlQuery buildSqlQuery(QSqlDatabase* db, const QString& type, const QString& tableName, const QStringList& fields, const VariantVector& values, const QString& whereCondition = ""); + +} +} + +#endif // DATABASEUTILS_H diff --git a/QtClient/JoplinQtClient/main.qml b/QtClient/JoplinQtClient/main.qml index 1c0151dbb..267ebbe47 100755 --- a/QtClient/JoplinQtClient/main.qml +++ b/QtClient/JoplinQtClient/main.qml @@ -9,6 +9,8 @@ Item { height: 600 signal currentFolderChanged() signal currentNoteChanged() + signal addNoteButtonClicked() + signal addFolderButtonClicked() property alias currentFolderIndex: folderList.currentIndex property alias currentNoteIndex: noteList.currentIndex @@ -58,4 +60,12 @@ Item { } + AddButton { + id: addButton + anchors.right: parent.right + anchors.bottom: parent.bottom + onAddFolderButtonClicked: root.addFolderButtonClicked() + onAddNoteButtonClicked: root.addNoteButtonClicked() + } + } diff --git a/QtClient/JoplinQtClient/models/foldercollection.cpp b/QtClient/JoplinQtClient/models/foldercollection.cpp index 9fd88d8d9..b177fcda8 100755 --- a/QtClient/JoplinQtClient/models/foldercollection.cpp +++ b/QtClient/JoplinQtClient/models/foldercollection.cpp @@ -1,7 +1,57 @@ #include "foldercollection.h" +#include "databaseutils.h" using namespace jop; -FolderCollection::FolderCollection() { +//FolderCollection::FolderCollection() {} +// Note: although parentId is supplied, it is currently not being used. +FolderCollection::FolderCollection(Database& db, const QString& parentId, const QString& orderBy) { + db_ = db; + parentId_ = parentId; + orderBy_ = orderBy; +} + +Folder FolderCollection::at(int index) const { + if (cache_.size()) return cache_[index]; + + QSqlQuery q = db_.query("SELECT id, title FROM folders ORDER BY " + orderBy_); + q.exec(); + + while (q.next()) { + Folder folder; + folder.setId(q.value(0).toString()); + folder.setTitle(q.value(1).toString()); + + cache_.push_back(folder); + } + + + return at(index); +} + +// TODO: cache result +int FolderCollection::count() const { + QSqlQuery q = db_.query("SELECT count(*) as row_count FROM folders"); + q.exec(); + q.next(); + return q.value(0).toInt(); +} + +Folder FolderCollection::byId(const QString& id) const { + int count = this->count(); + for (int i = 0; i < count; i++) { + Folder folder = at(i); + if (folder.id() == id) return folder; + } + + qWarning() << "Invalid folder ID:" << id; + return Folder(); +} + +void FolderCollection::update(const QString &id, const QStringList &fields, const VariantVector &values) { + QSqlQuery q = dbUtils::buildSqlQuery(&db_.database(), "update", "folders", fields, values, "id = \"" + id + "\""); + q.exec(); + cache_.clear(); + emit changed(0, count() - 1, fields); } diff --git a/QtClient/JoplinQtClient/models/foldercollection.h b/QtClient/JoplinQtClient/models/foldercollection.h index fcd7d8478..7df672c06 100755 --- a/QtClient/JoplinQtClient/models/foldercollection.h +++ b/QtClient/JoplinQtClient/models/foldercollection.h @@ -2,20 +2,38 @@ #define FOLDERCOLLECTION_H #include -#include "model/folder.h" + +#include "database.h" +#include "models/note.h" +#include "models/folder.h" +#include "sparsevector.hpp" +#include "simpletypes.h" namespace jop { -class FolderCollection { +class FolderCollection : public QObject { + + Q_OBJECT public: - FolderCollection(); - void add(const Folder* folder); + //FolderCollection(); + FolderCollection(Database& db, const QString &parentId, const QString& orderBy); + Folder at(int index) const; + int count() const; + Folder byId(const QString &id) const; + void update(const QString& id, const QStringList& fields, const VariantVector& values); private: - std::vector collection_; + QString parentId_; + QString orderBy_; + Database db_; + mutable QVector cache_; + +signals: + + void changed(int from, int to, const QStringList& fields); }; diff --git a/QtClient/JoplinQtClient/models/foldermodel.cpp b/QtClient/JoplinQtClient/models/foldermodel.cpp index eca088c3b..ba8765093 100755 --- a/QtClient/JoplinQtClient/models/foldermodel.cpp +++ b/QtClient/JoplinQtClient/models/foldermodel.cpp @@ -2,32 +2,20 @@ using namespace jop; -FolderModel::FolderModel() : QAbstractListModel() {} - -void FolderModel::setService(FolderService &folderService) { - folderService_ = folderService; -} - -void FolderModel::addFolder(Folder* folder) { - //folders_.push_back(folder); +FolderModel::FolderModel(Database &database) : QAbstractListModel(), folderCollection_(database, 0, "title") { + connect(&folderCollection_, SIGNAL(changed(int,int,const QStringList&)), this, SLOT(folderCollection_changed(int,int,const QStringList&))); } int FolderModel::rowCount(const QModelIndex & parent) const { Q_UNUSED(parent); - return folderService_.count(); - //return 10; - //return folders_.size(); + return folderCollection_.count(); } // NOTE: to lazy load - send back "Loading..." if item not currently loaded // queue the item for loading. // Then batch load them a bit later. QVariant FolderModel::data(const QModelIndex & index, int role) const { - QList list = folderService_.overviewList(); - - if (index.row() < 0 || index.row() >= list.size()) return QVariant(); - - Folder folder = list[index.row()]; + Folder folder = folderCollection_.at(index.row()); if (role == Qt::DisplayRole) { return QVariant(folder.title()); @@ -40,6 +28,26 @@ QVariant FolderModel::data(const QModelIndex & index, int role) const { return QVariant(); } +bool FolderModel::setData(const QModelIndex &index, const QVariant &value, int role) { + Folder folder = folderCollection_.at(index.row()); + + if (role == Qt::EditRole) { + QStringList fields; + fields << "title"; + VariantVector values; + values << value; + folderCollection_.update(folder.id(), fields, values); + return true; + } + + qWarning() << "Unsupported role" << role; + return false; +} + +bool FolderModel::setData(int index, const QVariant &value, int role) { + return setData(this->index(index), value, role); +} + QHash FolderModel::roleNames() const { QHash roles = QAbstractItemModel::roleNames(); roles[TitleRole] = "title"; @@ -48,10 +56,8 @@ QHash FolderModel::roleNames() const { return roles; } -bool FolderModel::canFetchMore(const QModelIndex &parent) const { - return folders_.size() < folderService_.count(); -} - -void FolderModel::fetchMore(const QModelIndex &parent) { - +void FolderModel::folderCollection_changed(int from, int to, const QStringList& fields) { + QVector roles; + roles << Qt::DisplayRole; + emit dataChanged(this->index(from), this->index(to), roles); } diff --git a/QtClient/JoplinQtClient/models/foldermodel.h b/QtClient/JoplinQtClient/models/foldermodel.h index e88edf09a..04552b3a3 100755 --- a/QtClient/JoplinQtClient/models/foldermodel.h +++ b/QtClient/JoplinQtClient/models/foldermodel.h @@ -3,7 +3,9 @@ #include +#include "database.h" #include "services/folderservice.h" +#include "models/foldercollection.h" namespace jop { @@ -19,9 +21,10 @@ public: RawRole }; - FolderModel(); + FolderModel(Database& database); - void setService(FolderService& folderService); + //void setService(FolderService& folderService); + //void setCollection(FolderCollection& folderCollection); void addFolder(Folder* folder); @@ -29,16 +32,23 @@ public: QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + protected: QHash roleNames() const; - bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE; - void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE; private: QList folders_; FolderService folderService_; + FolderCollection folderCollection_; + +public slots: + + bool setData(int index, const QVariant &value, int role = Qt::EditRole); + void folderCollection_changed(int from, int to, const QStringList &fields); + //bool setDataInt(int index, const QVariant &value, int role = Qt::EditRole); }; diff --git a/QtClient/JoplinQtClient/models/notecollection.h b/QtClient/JoplinQtClient/models/notecollection.h index 6fc2edc85..29dd9cdd4 100755 --- a/QtClient/JoplinQtClient/models/notecollection.h +++ b/QtClient/JoplinQtClient/models/notecollection.h @@ -5,7 +5,6 @@ #include "database.h" #include "models/note.h" -#include "services/notecache.h" #include "sparsevector.hpp" namespace jop { diff --git a/QtClient/JoplinQtClient/qml.qrc b/QtClient/JoplinQtClient/qml.qrc index f3f28b11b..f4196f7d4 100755 --- a/QtClient/JoplinQtClient/qml.qrc +++ b/QtClient/JoplinQtClient/qml.qrc @@ -4,5 +4,9 @@ FolderList.qml NoteList.qml NoteEditor.qml + AddButton.qml + Test.qml + TestForm.ui.qml + EditableListItem.qml diff --git a/QtClient/JoplinQtClient/services/folderservice.cpp b/QtClient/JoplinQtClient/services/folderservice.cpp index fd570b229..dc5611369 100755 --- a/QtClient/JoplinQtClient/services/folderservice.cpp +++ b/QtClient/JoplinQtClient/services/folderservice.cpp @@ -47,3 +47,7 @@ const QList FolderService::overviewList() const { return cache_; } + +void FolderService::clearCache() { + cache_.clear(); +} diff --git a/QtClient/JoplinQtClient/services/folderservice.h b/QtClient/JoplinQtClient/services/folderservice.h index 21e016ffc..9f2ae50b1 100755 --- a/QtClient/JoplinQtClient/services/folderservice.h +++ b/QtClient/JoplinQtClient/services/folderservice.h @@ -17,6 +17,7 @@ public: Folder byId(const QString &id) const; //Folder partialAt(int index) const; const QList overviewList() const; + void clearCache(); private: diff --git a/QtClient/JoplinQtClient/simpletypes.h b/QtClient/JoplinQtClient/simpletypes.h new file mode 100755 index 000000000..ee840adac --- /dev/null +++ b/QtClient/JoplinQtClient/simpletypes.h @@ -0,0 +1,12 @@ +#ifndef SIMPLETYPES_H +#define SIMPLETYPES_H + +#include + +namespace jop { + +typedef QVector VariantVector; + +} + +#endif // SIMPLETYPES_H diff --git a/QtClient/evernote-import/evernote-import-qt.pro b/QtClient/evernote-import/evernote-import-qt.pro index 604b809bf..9d3366bcd 100755 --- a/QtClient/evernote-import/evernote-import-qt.pro +++ b/QtClient/evernote-import/evernote-import-qt.pro @@ -32,3 +32,4 @@ INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt LIBS += -L"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/lib" LIBS += -L"C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86" LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt/x86" + diff --git a/src/AppBundle/Controller/ApiController.php b/src/AppBundle/Controller/ApiController.php index 8ed2f13a1..0612fa69d 100755 --- a/src/AppBundle/Controller/ApiController.php +++ b/src/AppBundle/Controller/ApiController.php @@ -40,16 +40,7 @@ abstract class ApiController extends Controller { echo "\n"; } }); - - // 1. client 1 : bla bla bla - // 2. client 2 : bla bla bla fromclient2 - // 3. client 1 : client1bla bla bla - - // RESULT: client1bla bla bla - - // Because diff for 3 is done between 2 and 3 - // Need to introduce revID so that Change class knows between which versions the diff should be made - + // HACK: get connection once here so that it's initialized and can // be accessed from models. $this->db = $this->get('app.eloquent')->connection();