From dc4b1580b0227f6a8e3421bbe2526421e41a3b61 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 11 Dec 2016 16:09:39 +0000 Subject: [PATCH] Access view from c+ --- .gitignore | 3 +- .../{FolderListView.qml => FolderList.qml} | 5 +- QtClient/JoplinQtClient/JoplinQtClient.pro | 12 +- QtClient/JoplinQtClient/NoteList.qml | 44 ++++++++ QtClient/JoplinQtClient/application.cpp | 38 +++++++ QtClient/JoplinQtClient/application.h | 36 ++++++ QtClient/JoplinQtClient/database.cpp | 14 +-- QtClient/JoplinQtClient/main.cpp | 70 +----------- QtClient/JoplinQtClient/main.qml | 105 ++---------------- .../JoplinQtClient/models/foldermodel.cpp | 11 +- QtClient/JoplinQtClient/models/foldermodel.h | 10 +- QtClient/JoplinQtClient/models/item.cpp | 11 +- QtClient/JoplinQtClient/models/item.h | 5 +- QtClient/JoplinQtClient/models/note.cpp | 8 ++ QtClient/JoplinQtClient/models/note.h | 23 ++++ QtClient/JoplinQtClient/models/notemodel.cpp | 25 +++++ QtClient/JoplinQtClient/models/notemodel.h | 33 ++++++ QtClient/JoplinQtClient/qml.qrc | 6 +- .../JoplinQtClient/services/noteservice.cpp | 26 +++++ .../JoplinQtClient/services/noteservice.h | 29 +++++ QtClient/JoplinQtClient/stable.h | 6 +- QtClient/JoplinQtClient/uuid.cpp | 22 ++-- QtClient/JoplinQtClient/uuid.h | 2 +- 23 files changed, 332 insertions(+), 212 deletions(-) rename QtClient/JoplinQtClient/{FolderListView.qml => FolderList.qml} (88%) create mode 100755 QtClient/JoplinQtClient/NoteList.qml create mode 100755 QtClient/JoplinQtClient/application.cpp create mode 100755 QtClient/JoplinQtClient/application.h create mode 100755 QtClient/JoplinQtClient/models/note.cpp create mode 100755 QtClient/JoplinQtClient/models/note.h create mode 100755 QtClient/JoplinQtClient/models/notemodel.cpp create mode 100755 QtClient/JoplinQtClient/models/notemodel.h create mode 100755 QtClient/JoplinQtClient/services/noteservice.cpp create mode 100755 QtClient/JoplinQtClient/services/noteservice.h diff --git a/.gitignore b/.gitignore index 0c0866fda..30f5bca5a 100755 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ *.sublime-workspace database.sqlite QtClient/build-*-Debug/ -*.pro.user \ No newline at end of file +*.pro.user +notes.sqlite \ No newline at end of file diff --git a/QtClient/JoplinQtClient/FolderListView.qml b/QtClient/JoplinQtClient/FolderList.qml similarity index 88% rename from QtClient/JoplinQtClient/FolderListView.qml rename to QtClient/JoplinQtClient/FolderList.qml index 8cfddd971..e401d930b 100755 --- a/QtClient/JoplinQtClient/FolderListView.qml +++ b/QtClient/JoplinQtClient/FolderList.qml @@ -5,7 +5,7 @@ Item { id: root property alias model: listView.model property alias currentIndex: listView.currentIndex - signal currentItemChanged() + property alias currentItem: listView.currentItem Rectangle { color: "#eeeeff" @@ -37,8 +37,5 @@ Item { ScrollBar.vertical: ScrollBar { } highlight: Rectangle { color: "lightsteelblue"; radius: 5 } focus: true - onCurrentItemChanged: { - root.currentItemChanged() - } } } diff --git a/QtClient/JoplinQtClient/JoplinQtClient.pro b/QtClient/JoplinQtClient/JoplinQtClient.pro index ffe208416..280862e0c 100755 --- a/QtClient/JoplinQtClient/JoplinQtClient.pro +++ b/QtClient/JoplinQtClient/JoplinQtClient.pro @@ -9,7 +9,11 @@ SOURCES += \ database.cpp \ uuid.cpp \ services/folderservice.cpp \ - models/foldermodel.cpp + models/foldermodel.cpp \ + models/notemodel.cpp \ + models/note.cpp \ + services/noteservice.cpp \ + application.cpp RESOURCES += qml.qrc @@ -28,7 +32,11 @@ HEADERS += \ database.h \ uuid.h \ services/folderservice.h \ - models/foldermodel.h + models/foldermodel.h \ + models/notemodel.h \ + models/note.h \ + services/noteservice.h \ + application.h DISTFILES += diff --git a/QtClient/JoplinQtClient/NoteList.qml b/QtClient/JoplinQtClient/NoteList.qml new file mode 100755 index 000000000..f195bb7e3 --- /dev/null +++ b/QtClient/JoplinQtClient/NoteList.qml @@ -0,0 +1,44 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Item { + id: root + property alias model: listView.model + property alias currentIndex: listView.currentIndex + signal currentItemChanged() + + Rectangle { + color: "#ffeeee" + border.color: "#00ff00" + anchors.fill: parent + } + + Component { + id: noteDelegate + Item { + width: parent.width + height: 25 + Text { + text: display + } + MouseArea { + anchors.fill: parent + onClicked: { + listView.currentIndex = index + } + } + } + } + + ListView { + id: listView + anchors.fill: parent + delegate: noteDelegate + ScrollBar.vertical: ScrollBar { } + highlight: Rectangle { color: "lightsteelblue"; radius: 5 } + focus: true + onCurrentItemChanged: { + root.currentItemChanged() + } + } +} diff --git a/QtClient/JoplinQtClient/application.cpp b/QtClient/JoplinQtClient/application.cpp new file mode 100755 index 000000000..0ce0e0e2f --- /dev/null +++ b/QtClient/JoplinQtClient/application.cpp @@ -0,0 +1,38 @@ +#include "application.h" + +#include "models/folder.h" +#include "database.h" +#include "models/foldermodel.h" +#include "services/folderservice.h" + +using namespace jop; + +Application::Application(int &argc, char **argv) : QGuiApplication(argc, argv) { + db_ = Database("D:/Web/www/joplin/notes.sqlite"); + folderService_ = FolderService(db_); + folderModel_.setService(folderService_); + + view_.setResizeMode(QQuickView::SizeRootObjectToView); + QQmlContext *ctxt = view_.rootContext(); + ctxt->setContextProperty("folderListModel", &folderModel_); + + view_.setSource(QUrl("qrc:/main.qml")); + + QObject* rootObject = (QObject*)view_.rootObject(); + + connect(rootObject, SIGNAL(currentFolderChanged()), this, SLOT(view_currentFolderChanged())); + + view_.show(); +} + +QString Application::selectedFolderId() const { + QObject* rootObject = (QObject*)view_.rootObject(); + + int index = rootObject->property("currentFolderIndex").toInt(); + QModelIndex modelIndex = folderModel_.index(index); + return folderModel_.data(modelIndex, FolderModel::IdRole).toString(); +} + +void Application::view_currentFolderChanged() { + qDebug() << selectedFolderId(); +} diff --git a/QtClient/JoplinQtClient/application.h b/QtClient/JoplinQtClient/application.h new file mode 100755 index 000000000..cd5458f47 --- /dev/null +++ b/QtClient/JoplinQtClient/application.h @@ -0,0 +1,36 @@ +#ifndef APPLICATION_H +#define APPLICATION_H + +#include + +#include "database.h" +#include "services/folderservice.h" +#include "models/foldermodel.h" + +namespace jop { + +class Application : public QGuiApplication { + + Q_OBJECT + +public: + + Application(int &argc, char **argv); + +private: + + QQuickView view_; + Database db_; + FolderService folderService_; + FolderModel folderModel_; + QString selectedFolderId() const; + +public slots: + + void view_currentFolderChanged(); + +}; + +} + +#endif // APPLICATION_H diff --git a/QtClient/JoplinQtClient/database.cpp b/QtClient/JoplinQtClient/database.cpp index ef632b6b9..9316c4df1 100755 --- a/QtClient/JoplinQtClient/database.cpp +++ b/QtClient/JoplinQtClient/database.cpp @@ -5,7 +5,7 @@ using namespace jop; Database::Database(const QString &path) { version_ = -1; - QFile::remove(path); + //QFile::remove(path); db_ = QSqlDatabase::addDatabase("QSQLITE"); db_.setDatabaseName(path); @@ -16,7 +16,7 @@ Database::Database(const QString &path) { qDebug() << "Database: connection ok"; } - upgrade(); + //upgrade(); } Database::Database() {} @@ -80,11 +80,11 @@ void Database::upgrade() { db_.exec("CREATE TABLE folders (id TEXT PRIMARY KEY, title TEXT, created_time INT)"); - for (int i = 1; i < 100; i++) { - QUuid uuid = QUuid::createUuid(); - QString title = QString::number(i); - db_.exec(QString("INSERT INTO folders (id, title, created_time) VALUES (\"%1\", \"%2\", 1481235571)").arg(uuid.toString(), title.repeated(10))); - } +// for (int i = 1; i < 100; i++) { +// QUuid uuid = QUuid::createUuid(); +// QString title = QString::number(i); +// db_.exec(QString("INSERT INTO folders (id, title, created_time) VALUES (\"%1\", \"%2\", 1481235571)").arg(uuid.toString(), title.repeated(10))); +// } //db_.exec("INSERT INTO folders (id, title, created_time) VALUES (\"ed735d55415bee976b771989be8f7005\", \"bbbb\", 1481235571)"); //db_.exec("INSERT INTO folders (id, title, created_time) VALUES (\"5d41402abc4b2a76b9719d911017c592\", \"cccc\", 1481235571)"); diff --git a/QtClient/JoplinQtClient/main.cpp b/QtClient/JoplinQtClient/main.cpp index 0a5129963..32377c468 100755 --- a/QtClient/JoplinQtClient/main.cpp +++ b/QtClient/JoplinQtClient/main.cpp @@ -1,5 +1,6 @@ #include +#include "application.h" #include "models/folder.h" #include "database.h" #include "models/foldermodel.h" @@ -9,73 +10,6 @@ using namespace jop; int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QGuiApplication app(argc, argv); - - Database db("D:/Web/www/joplin/database.sqlite"); - -// FolderService s(db); -// qDebug() << s.count(); - -// Folder f = s.byId("35dbdd6e633566c4160e699a86601ab8"); -// qDebug() << f.id() << f.title() << f.createdTime(); - -// QSqlQuery q = db.query("SELECT * FROM folders WHERE id = :id"); -// q.bindValue(":id", "35dbdd6e633566c4160e699a86601ab8"); -// q.exec(); -// q.next(); - - //qDebug() << q.isValid(); - -// Folder f; -// f.fromSqlQuery(q); - -// qDebug() << f.title() << f.id() << f.createdTime(); - - - //QSqlQuery q = query("SELECT * FROM folders WHERE id = :id"); - //q.bindValue(":id", "a"); - //q.exec(); - - - FolderService folderService(db); - FolderModel model(folderService); - - //Folder* f = new Folder(); f->setTitle("oneXXX"); model.addFolder(f); - //f = new Folder(); f->setTitle("two"); model.addFolder(f); - //f = new Folder(); f->setTitle("three"); model.addFolder(f); - -// QQuickView view; -// view.setResizeMode(QQuickView::SizeRootObjectToView); -// QQmlContext *ctxt = view.rootContext(); -// ctxt->setContextProperty("myModel", &model); - - - -// QSqlDatabase m_db = QSqlDatabase::addDatabase("QSQLITE"); -// m_db.setDatabaseName("D:/Web/www/joplin/QtClient/JoplinQtClient/test.sqlite3"); - -// if (!m_db.open()) -// { -// qDebug() << "Error: connection with database fail"; -// } -// else -// { -// qDebug() << "Database: connection ok"; -// } - - //QQmlApplicationEngine engine; - //engine.load(QUrl(QLatin1String("qrc:/main.qml"))); - - QQuickView view; - view.setResizeMode(QQuickView::SizeRootObjectToView); - QQmlContext *ctxt = view.rootContext(); - ctxt->setContextProperty("folderTreeViewModel", &model); - - view.setSource(QUrl("qrc:/main.qml")); - - - view.show(); - - + Application app(argc, argv); return app.exec(); } diff --git a/QtClient/JoplinQtClient/main.qml b/QtClient/JoplinQtClient/main.qml index d2169c2ca..af35fa7ac 100755 --- a/QtClient/JoplinQtClient/main.qml +++ b/QtClient/JoplinQtClient/main.qml @@ -4,17 +4,20 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.0 Item { + id: root width: 800 height: 600 + signal currentFolderChanged() + property alias currentFolderIndex: folderList.currentIndex RowLayout { id: layout anchors.fill: parent spacing: 0 - FolderListView { - id: folderTreeView - model: folderTreeViewModel + FolderList { + id: folderList + model: folderListModel Layout.fillWidth: true Layout.fillHeight: true Layout.minimumWidth: 50 @@ -23,105 +26,19 @@ Item { Layout.minimumHeight: 150 onCurrentItemChanged: { - console.info(folderTreeView.currentIndex) + root.currentFolderChanged() } } -// Rectangle { -// color: 'teal' -// Layout.fillWidth: true -// Layout.minimumWidth: 50 -// Layout.preferredWidth: 100 -// Layout.maximumWidth: 300 -// Layout.minimumHeight: 150 -// Text { -// anchors.centerIn: parent -// text: parent.width + 'x' + parent.height -// } -// } - Rectangle { - color: 'plum' + NoteList { + id: noteList Layout.fillWidth: true + Layout.fillHeight: true Layout.minimumWidth: 100 Layout.preferredWidth: 200 Layout.preferredHeight: 100 - Text { - anchors.centerIn: parent - text: parent.width + 'x' + parent.height - } } + } - -// visible: true -// width: 640 -// height: 480 -// //title: qsTr("Hello World") - -// RowLayout { - -// anchors.fill: parent - -// FolderTreeView { -// id: folderTreeView -// model: folderTreeViewModel -// width: 200 -// //height: 500 -// //currentIndex: folderTreeViewCurrentIndex -// anchors.fill: parent -// onCurrentItemChanged: { -// console.info(folderTreeView.currentIndex) -// //folderTreeViewCurrentIndex = folderTreeView.currentIndex -// } -// } - -// Rectangle { -// color: 'plum' -// Text { -// anchors.centerIn: parent -// text: parent.width + 'x' + parent.height -// } -// } -// } - } - - -//import QtQuick 2.7 -//import QtQuick.Controls 2.0 -//import QtQuick.Controls 1.4 -//import QtQuick.Layouts 1.0 - -//ApplicationWindow { -// visible: true -// width: 640 -// height: 480 -// title: qsTr("Hello World") - -// SwipeView { -// id: swipeView -// anchors.fill: parent -// currentIndex: tabBar.currentIndex - -// Page1 { -// } - -// Page { -// Label { -// text: qsTr("Second page") -// anchors.centerIn: parent -// } -// } -// } - -// footer: TabBar { -// id: tabBar -// currentIndex: swipeView.currentIndex -// TabButton { -// text: qsTr("First") -// } -// TabButton { -// text: qsTr("Second") -// } -// } -//} diff --git a/QtClient/JoplinQtClient/models/foldermodel.cpp b/QtClient/JoplinQtClient/models/foldermodel.cpp index fdd06645d..eca088c3b 100755 --- a/QtClient/JoplinQtClient/models/foldermodel.cpp +++ b/QtClient/JoplinQtClient/models/foldermodel.cpp @@ -2,9 +2,9 @@ using namespace jop; -//FolderModel::FolderModel() : QAbstractListModel() {} +FolderModel::FolderModel() : QAbstractListModel() {} -FolderModel::FolderModel(FolderService &folderService) : QAbstractListModel() { +void FolderModel::setService(FolderService &folderService) { folderService_ = folderService; } @@ -33,13 +33,18 @@ QVariant FolderModel::data(const QModelIndex & index, int role) const { return QVariant(folder.title()); } + if (role == IdRole) { + return QVariant(folder.id()); + } + return QVariant(); } QHash FolderModel::roleNames() const { QHash roles = QAbstractItemModel::roleNames(); roles[TitleRole] = "title"; - roles[UuidRole] = "uuid"; + roles[IdRole] = "uuid"; + roles[RawRole] = "raw"; return roles; } diff --git a/QtClient/JoplinQtClient/models/foldermodel.h b/QtClient/JoplinQtClient/models/foldermodel.h index 94d110024..e88edf09a 100755 --- a/QtClient/JoplinQtClient/models/foldermodel.h +++ b/QtClient/JoplinQtClient/models/foldermodel.h @@ -14,12 +14,14 @@ class FolderModel : public QAbstractListModel { public: enum FolderRoles { - UuidRole = Qt::UserRole + 1, - TitleRole + IdRole = Qt::UserRole + 1, + TitleRole, + RawRole }; - //FolderModel(); - FolderModel(FolderService& folderService); + FolderModel(); + + void setService(FolderService& folderService); void addFolder(Folder* folder); diff --git a/QtClient/JoplinQtClient/models/item.cpp b/QtClient/JoplinQtClient/models/item.cpp index 111a2dfd7..346391beb 100755 --- a/QtClient/JoplinQtClient/models/item.cpp +++ b/QtClient/JoplinQtClient/models/item.cpp @@ -12,12 +12,12 @@ void Item::fromSqlQuery(const QSqlQuery &q) { int i_title = q.record().indexOf("title"); int i_created_time = q.record().indexOf("created_time"); - id_ = jop::uuid::fromString(q.value(i_id).toString()); + id_ = q.value(i_id).toString(); title_ = q.value(i_title).toString(); createdTime_ = q.value(i_created_time).toInt(); } -QUuid Item::id() const { +QString Item::id() const { return id_; } @@ -29,13 +29,8 @@ int Item::createdTime() const { return createdTime_; } -void Item::setId(const QUuid &v) { - id_ = v; -} - void Item::setId(const QString& v) { - QUuid u = uuid::fromString(v); - setId(u); + id_ = v; } void Item::setTitle(const QString &v) { diff --git a/QtClient/JoplinQtClient/models/item.h b/QtClient/JoplinQtClient/models/item.h index 9ac2cfd1a..885ef8ad6 100755 --- a/QtClient/JoplinQtClient/models/item.h +++ b/QtClient/JoplinQtClient/models/item.h @@ -11,12 +11,11 @@ public: Item(); - QUuid id() const; + QString id() const; QString title() const; int createdTime() const; bool isPartial() const; - void setId(const QUuid& v); void setId(const QString& v); void setTitle(const QString& v); void setCreatedTime(int v); @@ -26,7 +25,7 @@ public: private: - QUuid id_; + QString id_; QString title_; int createdTime_; bool isPartial_; diff --git a/QtClient/JoplinQtClient/models/note.cpp b/QtClient/JoplinQtClient/models/note.cpp new file mode 100755 index 000000000..6d371ea8c --- /dev/null +++ b/QtClient/JoplinQtClient/models/note.cpp @@ -0,0 +1,8 @@ +#include "note.h" + +using namespace jop; + +Note::Note() +{ + +} diff --git a/QtClient/JoplinQtClient/models/note.h b/QtClient/JoplinQtClient/models/note.h new file mode 100755 index 000000000..d6ee75db9 --- /dev/null +++ b/QtClient/JoplinQtClient/models/note.h @@ -0,0 +1,23 @@ +#ifndef NOTE_H +#define NOTE_H + +#include +#include "models/item.h" + +namespace jop { + +class Note : public Item { + +public: + + Note(); + +private: + + + +}; + +} + +#endif // NOTE_H diff --git a/QtClient/JoplinQtClient/models/notemodel.cpp b/QtClient/JoplinQtClient/models/notemodel.cpp new file mode 100755 index 000000000..cb85e1531 --- /dev/null +++ b/QtClient/JoplinQtClient/models/notemodel.cpp @@ -0,0 +1,25 @@ +#include "notemodel.h" + +jop::NoteModel::NoteModel(NoteService ¬eService) +{ + noteService_ = noteService; +} + +int jop::NoteModel::rowCount(const QModelIndex &parent) const +{ + return 0; +} + +QVariant jop::NoteModel::data(const QModelIndex &index, int role) const +{ + return QVariant(); +} + +QHash jop::NoteModel::roleNames() const +{ + QHash roles = QAbstractItemModel::roleNames(); +// roles[TitleRole] = "title"; +// roles[UuidRole] = "uuid"; + return roles; + +} diff --git a/QtClient/JoplinQtClient/models/notemodel.h b/QtClient/JoplinQtClient/models/notemodel.h new file mode 100755 index 000000000..04e4a6fd9 --- /dev/null +++ b/QtClient/JoplinQtClient/models/notemodel.h @@ -0,0 +1,33 @@ +#ifndef NOTEMODEL_H +#define NOTEMODEL_H + +#include + +#include "services/noteservice.h" + +namespace jop { + +class NoteModel : public QAbstractListModel { + + Q_OBJECT + +public: + + NoteModel(NoteService ¬eService); + int rowCount(const QModelIndex & parent = QModelIndex()) const; + QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; + +protected: + + QHash roleNames() const; + +private: + + QList notes_; + NoteService noteService_; + +}; + +} + +#endif // NOTEMODEL_H diff --git a/QtClient/JoplinQtClient/qml.qrc b/QtClient/JoplinQtClient/qml.qrc index f4d0f2321..b1a33e5ec 100755 --- a/QtClient/JoplinQtClient/qml.qrc +++ b/QtClient/JoplinQtClient/qml.qrc @@ -1,9 +1,7 @@ main.qml - Page1.qml - Page1Form.ui.qml - FolderListView.qml - TestUnQuatre.qml + FolderList.qml + NoteList.qml diff --git a/QtClient/JoplinQtClient/services/noteservice.cpp b/QtClient/JoplinQtClient/services/noteservice.cpp new file mode 100755 index 000000000..b007934ae --- /dev/null +++ b/QtClient/JoplinQtClient/services/noteservice.cpp @@ -0,0 +1,26 @@ +#include "noteservice.h" + +using namespace jop; + +NoteService::NoteService() {} + +NoteService::NoteService(jop::Database &database) { + database_ = database; +} + +int NoteService::count(int parentFolderId) const { + QSqlQuery q = database_.query("SELECT count(*) as row_count FROM notes WHERE parent_id = :parent_id"); + q.bindValue(":parent_id", parentFolderId); + q.exec(); + q.next(); + return q.value(0).toInt(); +} + +Note NoteService::byId(const QString &id) const { + Note n; + return n; +} + +const QList NoteService::overviewList(const QString &orderBy, int from, int to) const { + return QList(); +} diff --git a/QtClient/JoplinQtClient/services/noteservice.h b/QtClient/JoplinQtClient/services/noteservice.h new file mode 100755 index 000000000..07fd322fe --- /dev/null +++ b/QtClient/JoplinQtClient/services/noteservice.h @@ -0,0 +1,29 @@ +#ifndef NOTESERVICE_H +#define NOTESERVICE_H + +#include +#include "database.h" +#include "models/note.h" + +namespace jop { + +class NoteService { + +public: + + NoteService(); + NoteService(Database& database); + int count(int parentFolderId) const; + Note byId(const QString& id) const; + const QList overviewList(const QString& orderBy, int from, int to) const; + +private: + + Database database_; + mutable QList cache_; + +}; + +} + +#endif // NOTESERVICE_H diff --git a/QtClient/JoplinQtClient/stable.h b/QtClient/JoplinQtClient/stable.h index a73f3f4ce..e4491a2c7 100755 --- a/QtClient/JoplinQtClient/stable.h +++ b/QtClient/JoplinQtClient/stable.h @@ -4,19 +4,21 @@ #if defined __cplusplus #include +#include #include #include #include #include #include -#include -#include +//#include +//#include #include #include #include #include #include #include +#include #endif // __cplusplus diff --git a/QtClient/JoplinQtClient/uuid.cpp b/QtClient/JoplinQtClient/uuid.cpp index 1fe1ff418..5e3e79944 100755 --- a/QtClient/JoplinQtClient/uuid.cpp +++ b/QtClient/JoplinQtClient/uuid.cpp @@ -4,19 +4,19 @@ namespace jop { namespace uuid { -QUuid fromString(const QString& s) { - // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - QString mod = s; - mod.insert(8, '-'); - mod.insert(13, '-'); - mod.insert(18, '-'); - mod.insert(23, '-'); - mod = "{" + mod + "}"; +//QUuid fromString(const QString& s) { +// // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} +// QString mod = s; +// mod.insert(8, '-'); +// mod.insert(13, '-'); +// mod.insert(18, '-'); +// mod.insert(23, '-'); +// mod = "{" + mod + "}"; - qDebug() << mod; +// //qDebug() << mod; - return QUuid(mod); -} +// return QUuid(mod); +//} } } diff --git a/QtClient/JoplinQtClient/uuid.h b/QtClient/JoplinQtClient/uuid.h index ee3bbc0e4..a5c55a6ff 100755 --- a/QtClient/JoplinQtClient/uuid.h +++ b/QtClient/JoplinQtClient/uuid.h @@ -6,7 +6,7 @@ namespace jop { namespace uuid { -QUuid fromString(const QString& s); +//QUuid fromString(const QString& s); } }