diff --git a/mauikit.pri b/mauikit.pri index d821db5..581ab11 100644 --- a/mauikit.pri +++ b/mauikit.pri @@ -1,326 +1,338 @@ QT *= \ core \ qml \ quick \ gui \ svg \ concurrent CONFIG *= c++17 DEFINES *= \ MAUI_APP \ STATIC_MAUIKIT \ #REPO VARIABLES LUV_REPO = https://github.com/milohr/luv-icon-theme OPENSSL_REPO = https://github.com/mauikit/openssl ATTICA_REPO = https://github.com/mauikit/attica KQUICKSYNTAXHIGHLIGHTER_REPO = https://github.com/mauikit/kquicksyntaxhighlighter.git KSYNTAXHIGHLIGHTING_REPO = https://github.com/mauikit/KSyntaxHighlighting.git #ANDROID FILES VALUES ANDROID_FILES_DIR = $$_PRO_FILE_PWD_/android_files ANDROID_FILES_MANIFEST = $$_PRO_FILE_PWD_/android_files/AndroidManifest.xml ANDROID_FILES_GRADLE = $$_PRO_FILE_PWD_/android_files/build.gradle ANDROID_FILES_RES_DIR = $$_PRO_FILE_PWD_/android_files/res linux:unix:!android { message(Building Maui helpers for Linux KDE) include($$PWD/src/kde/kde.pri) } else:android|win32 { message(Building Maui helpers for Android or Windows) android { include($$PWD/src/android/android.pri) contains(DEFINES, ANDROID_OPENSSL):{ exists($$PWD/src/utils/syncing/openssl/openssl.pri) { message("Using OpenSSL for Android") include($$PWD/src/utils/syncing/openssl/openssl.pri) }else { message("Getting OpenSSL for Android") system(git clone $$OPENSSL_REPO $$PWD/src/utils/syncing/openssl) include($$PWD/src/utils/syncing/openssl/openssl.pri) } } }else:win32 { + message("Using OpenSSL for Windows") + +LIBS += -L$$PWD/../../../../../../Qt/Tools/OpenSSL/Win_x64/lib/ -llibssl +LIBS += -L$$PWD/../../../../../../Qt/Tools/OpenSSL/Win_x64/lib/ -llibcrypto + } contains(DEFINES, COMPONENT_EDITOR):{ include($$PWD/src/utils/editor/syntaxhighlighter.pri) } contains(DEFINES, COMPONENT_STORE):{ exists($$PWD/src/utils/store/attica/attica.pri):{ message("Using Attica for Android or Windows") include($$PWD/src/utils/store/attica/attica.pri) }else { message("Getting Attica for Android") system(git clone $$ATTICA_REPO $$PWD/src/utils/store/attica) include($$PWD/src/utils/store/attica/attica.pri) } } } else { message("Unknown configuration") } contains(DEFINES, MAUIKIT_STYLE):{ exists($$PWD/src/maui-style/icons/luv-icon-theme) { message("Using Luv icon theme") }else { message("Getting Luv icon theme") system(git clone $$LUV_REPO $$PWD/src/maui-style/icons/luv-icon-theme) } - RESOURCES += $$PWD/src/maui-style/icons.qrc \ - $$PWD/src/maui-style/style.qrc + RESOURCES += $$PWD/src/maui-style/style.qrc + + win32|android: { + DEFINES += ICONS_PNG + RESOURCES += $$PWD/src/maui-style/icons_png.qrc + }else { + RESOURCES += $$PWD/src/maui-style/icons.qrc + } } contains(DEFINES, COMPONENT_TAGGING):{ message("INCLUDING TAGGING COMPONENT") include($$PWD/src/utils/tagging/tagging.pri) } else { warning("SKIPPING TAGGING COMPONENT") } contains(DEFINES, COMPONENT_EDITOR):{ message("INCLUDING EDITOR COMPONENT") HEADERS += \ $$PWD/src/utils/editor/documenthandler.h \ $$PWD/src/utils/editor/syntaxhighlighterutil.h SOURCES += \ $$PWD/src/utils//editor/documenthandler.cpp \ $$PWD/src/utils/editor/syntaxhighlighterutil.cpp INCLUDEPATH += $$PWD/src/utils/editor } else { warning("SKIPPING EDITOR COMPONENT") } contains(DEFINES, COMPONENT_STORE):{ message("INCLUDING STORE COMPONENT") HEADERS += \ $$PWD/src/utils/store/store.h \ $$PWD/src/utils/store/storemodel.h \ $$PWD/src/utils/store/storelist.h SOURCES += \ $$PWD/src/utils/store/store.cpp \ $$PWD/src/utils/store/storemodel.cpp \ $$PWD/src/utils/store/storelist.cpp RESOURCES += $$PWD/src/utils/store/store.qrc INCLUDEPATH += $$PWD/src/utils/store } else { warning("SKIPPING STORE COMPONENT") } contains(DEFINES, COMPONENT_SYNCING):{ message("INCLUDING SYNCING COMPONENT") include($$PWD/src/utils/syncing/libwebdavclient/webdavclient.pri) HEADERS += $$PWD/src/utils/syncing/syncing.h SOURCES += $$PWD/src/utils/syncing/syncing.cpp INCLUDEPATH += $$PWD/src/utils/syncing } else { warning("SKIPPING SYNCING COMPONENT") } contains(DEFINES, COMPONENT_ACCOUNTS):{ message("INCLUDING ACCOUNTS COMPONENT") QT *= sql HEADERS += \ $$PWD/src/utils/accounts/mauiaccounts.h \ $$PWD/src/utils/accounts/accountsdb.h \ SOURCES += \ $$PWD/src/utils/accounts/mauiaccounts.cpp\ $$PWD/src/utils/accounts/accountsdb.cpp RESOURCES += $$PWD/src/utils/accounts/accounts.qrc DISTFILES += $$PWD//src/utils/accounts/script.sql INCLUDEPATH += $$PWD/src/utils/accounts DEPENDPATH += $$PWD/src/utils/accounts } else { warning("SKIPPING ACCOUNTS COMPONENT") } contains(DEFINES, COMPONENT_FM):{ message("INCLUDING FM COMPONENT") HEADERS += \ $$PWD/src/fm/fm.h \ $$PWD/src/fm/fmlist.h \ $$PWD/src/fm/placeslist.h \ $$PWD/src/fm/downloader.h SOURCES += \ $$PWD/src/fm/fm.cpp \ $$PWD/src/fm/fmlist.cpp \ $$PWD/src/fm/placeslist.cpp \ $$PWD/src/fm/downloader.cpp INCLUDEPATH += $$PWD/src/fm DEPENDPATH += $$PWD/src/fm } else { warning("SKIPPING FM COMPONENT") } RESOURCES += \ $$PWD/src/mauikit.qrc \ $$PWD/src/assets.qrc HEADERS += \ $$PWD/src/utils/fmstatic.h \ $$PWD/src/mauikit.h \ $$PWD/src/utils/fmh.h \ $$PWD/src/utils/model_template/mauimodel.h \ $$PWD/src/utils/model_template/mauilist.h \ $$PWD/src/utils/handy.h \ $$PWD/src/utils/utils.h \ $$PWD/src/utils/mauiapp.h \ $$PWD/src/utils/models/pathlist.h SOURCES += \ $$PWD/src/utils/fmstatic.cpp \ $$PWD/src/mauikit.cpp \ $$PWD/src/utils/model_template/mauimodel.cpp \ $$PWD/src/utils/model_template/mauilist.cpp \ $$PWD/src/utils/handy.cpp \ $$PWD/src/utils/mauiapp.cpp \ $$PWD/src/utils/models/pathlist.cpp DEPENDPATH += \ $$PWD/src \ $$PWD/src/utils/model_template INCLUDEPATH += \ $$PWD/src \ $$PWD/src/utils \ $$PWD/src/utils/models \ $$PWD/src/utils/model_template API_VER = 1.0 DISTFILES += \ $$PWD/CMakeLists.txt \ $$PWD/src/controls/qmldir #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5KIOFileWidgets.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5KIOWidgets.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5Bookmarks.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5Solid.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5XmlGui.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5IconThemes.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5KIOCore.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5JobWidgets.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5Service.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5Completion.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5ItemViews.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5ConfigWidgets.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5I18n.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5WidgetsAddons.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5Codecs.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5ConfigGui.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5ConfigCore.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libKF5ConfigCore.so #ANDROID_EXTRA_LIBS += $$PWD/libs/bin/libdbus-1.so ##KIOFileWidgets #LIBS += -L$$PWD/libs/bin/ -lKF5KIOFileWidgets #INCLUDEPATH += $$PWD/libs/includes/KIOFileWidgets #DEPENDPATH += $$PWD/libs/includes/KIOFileWidgets ##KBookmarks #LIBS += -L$$PWD/libs/bin/ -lKF5Bookmarks #INCLUDEPATH += $$PWD/libs/includes/KBookmarks #DEPENDPATH += $$PWD/libs/includes/KBookmarks ##KSolid #LIBS += -L$$PWD//libs/bin/ -lKF5Solid #INCLUDEPATH += $$PWD//libs/includes/Solid #DEPENDPATH += $$PWD/libs/includes/Solid ##KIOWidgets #LIBS += -L$$PWD/libs/bin/ -lKF5KIOWidgets #INCLUDEPATH += $$PWD/libs/includes/KIOWidgets #DEPENDPATH += $$PWD/libs/includes/KIOWidgets ##KXmlGui #LIBS += -L$$PWD/libs/bin/ -lKF5XmlGui #INCLUDEPATH += $$PWD/libs/includes/KXmlGui #DEPENDPATH += $$PWD/libs/includes/KXmlGui ##KIconThemes #LIBS += -L$$PWD/libs/bin/ -lKF5IconThemes #INCLUDEPATH += $$PWD/libs/includes/KIconThemes #DEPENDPATH += $$PWD/libs/includes/KIconThemes ##KIOCore #LIBS += -L$$PWD/libs/bin/ -lKF5KIOCore #INCLUDEPATH += $$PWD/libs/includes/KIOCore #DEPENDPATH += $$PWD/libs/includes/KIOCore ##KJobWidgets #LIBS += -L$$PWD/libs/bin/ -lKF5JobWidgets #INCLUDEPATH += $$PWD/libs/includes/KJobWidgets #DEPENDPATH += $$PWD/libs/includes/KJobWidgets ##KService #LIBS += -L$$PWD/libs/bin/ -lKF5Service #INCLUDEPATH += $$PWD/libs/includes/KService #DEPENDPATH += $$PWD/libs/includes/KService ##KCompletion #LIBS += -L$$PWD/libs/bin/ -lKF5Completion #INCLUDEPATH += $$PWD/libs/includes/KCompletion #DEPENDPATH += $$PWD/libs/includes/KCompletion ##KItemViews #LIBS += -L$$PWD/libs/bin/ -lKF5ItemViews #INCLUDEPATH += $$PWD/libs/includes/KItemViews #DEPENDPATH += $$PWD/libs/includes/KItemViews ##KConfigWidgets #LIBS += -L$$PWD/libs/bin/ -lKF5ConfigWidgets #INCLUDEPATH += $$PWD/libs/includes/KConfigWidgets #DEPENDPATH += $$PWD/libs/includes/KConfigWidgets ##KI18n #LIBS += -L$$PWD/libs/bin/ -lKF5I18n #INCLUDEPATH += $$PWD/libs/includes/KI18n #DEPENDPATH += $$PWD/libs/includes/KI18n ##KWidgetsAddons #LIBS += -L$$PWD/libs/bin/ -lKF5WidgetsAddons #INCLUDEPATH += $$PWD/libs/includes/KWidgetsAddons #DEPENDPATH += $$PWD/libs/includes/KWidgetsAddons ##KCodecs #LIBS += -L$$PWD/libs/bin/ -lKF5Codecs #INCLUDEPATH += $$PWD/libs/includes/KCodecs #DEPENDPATH += $$PWD/libs/includes/KCodecs ##KConfigGui #LIBS += -L$$PWD/libs/bin/ -lKF5ConfigGui #INCLUDEPATH += $$PWD/libs/includes/KConfigGui #DEPENDPATH += $$PWD/libs/includes/KConfigGui ##KConfigCore #LIBS += -L$$PWD/libs/bin/ -lKF5ConfigCore #INCLUDEPATH += $$PWD/libs/includes/KConfigCore #DEPENDPATH += $$PWD/libs/includes/KConfigCore + diff --git a/src/fm/downloader.cpp b/src/fm/downloader.cpp index 05e596d..4c86348 100644 --- a/src/fm/downloader.cpp +++ b/src/fm/downloader.cpp @@ -1,124 +1,132 @@ #include "downloader.h" -FMH::Downloader::Downloader(QObject *parent) : QObject(parent), manager(new QNetworkAccessManager) +FMH::Downloader::Downloader(QObject *parent) : QObject(parent), manager(new QNetworkAccessManager), array(new QByteArray) {} -FMH::Downloader::~Downloader() + FMH::Downloader::~Downloader() { qDebug()<< "DELETEING DOWNLOADER"; this->manager->deleteLater(); // this->reply->deleteLater(); - + this->reply->deleteLater(); + this->reply = nullptr; + this->array->clear(); } -void FMH::Downloader::setFile(const QString &fileURL, const QString &fileName) +void FMH::Downloader::setFile(const QUrl &fileURL, const QUrl &fileName) { - QString filePath = fileURL; - if(fileName.isEmpty() || fileURL.isEmpty()) return; QNetworkRequest request; - request.setUrl(QUrl(fileURL)); + request.setUrl(fileURL); reply = manager->get(request); file = new QFile; - file->setFileName(QUrl(fileName).toLocalFile()); + file->setFileName(fileName.toLocalFile()); if(!file->open(QIODevice::WriteOnly)) - qWarning() << "Could not open file to save download"; + qWarning()<< "can not open file to write download"; + + qDebug() << QSslSocket::sslLibraryBuildVersionString(); + qDebug() << QSslSocket::supportsSsl(); + qDebug() << QSslSocket::sslLibraryVersionString(); connect(reply, SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(onDownloadProgress(qint64,qint64))); connect(manager, SIGNAL(finished(QNetworkReply*)),this,SLOT(onFinished(QNetworkReply*))); connect(reply, SIGNAL(readyRead()),this,SLOT(onReadyRead())); connect(reply, SIGNAL(finished()),this,SLOT(onReplyFinished())); } -void FMH::Downloader::getArray(const QString &fileURL, const QMap &headers) +void FMH::Downloader::getArray(const QUrl &fileURL, const QMap &headers) { qDebug() << fileURL << headers; if(fileURL.isEmpty()) return; QNetworkRequest request; - request.setUrl(QUrl(fileURL)); + request.setUrl(fileURL); if(!headers.isEmpty()) { - for(auto key: headers.keys()) + for(const auto &key: headers.keys()) request.setRawHeader(key.toLocal8Bit(), headers[key].toLocal8Bit()); } reply = manager->get(request); - connect(reply, &QNetworkReply::readyRead, [this]() + connect(reply, &QIODevice::readyRead, [this]() { switch(reply->error()) { case QNetworkReply::NoError: { - this->array = reply->readAll(); + this->array->append(reply->readAll()); break; } default: { qDebug() << reply->errorString(); emit this->warning(reply->errorString()); } } }); - connect(reply, &QNetworkReply::finished, [=]() + connect(reply, &QNetworkReply::finished, [this]() { qDebug() << "Array reply is now finished"; - emit this->dataReady(this->array); + + emit this->dataReady(*this->array); emit this->done(); }); } + void FMH::Downloader::onDownloadProgress(qint64 bytesRead, qint64 bytesTotal) { emit this->progress((bytesRead * bytesTotal) / 100); } void FMH::Downloader::onFinished(QNetworkReply *reply) { switch(reply->error()) { case QNetworkReply::NoError: { qDebug("file is downloaded successfully."); emit this->downloadReady(); break; } default: { emit this->warning(reply->errorString()); - }; + } } if(file->isOpen()) { file->close(); emit this->fileSaved(file->fileName()); file->deleteLater(); } + } void FMH::Downloader::onReadyRead() { + qDebug()<< "WRITTING TO FILE >>>>>"; file->write(reply->readAll()); // emit this->fileSaved(file->fileName()); } void FMH::Downloader::onReplyFinished() { if(file->isOpen()) { file->close(); // emit this->fileSaved(file->fileName()); file->deleteLater(); } emit done(); } diff --git a/src/fm/downloader.h b/src/fm/downloader.h index 28616ac..825de31 100644 --- a/src/fm/downloader.h +++ b/src/fm/downloader.h @@ -1,60 +1,58 @@ #ifndef DOWNLOADER_H #define DOWNLOADER_H #include #include #include #include #include #ifndef STATIC_MAUIKIT #include "mauikit_export.h" #endif namespace FMH { #ifdef STATIC_MAUIKIT class Downloader : public QObject #else class MAUIKIT_EXPORT Downloader : public QObject #endif { Q_OBJECT public: Downloader(QObject *parent = nullptr); virtual ~Downloader(); - - void setFile(const QString &fileURL, const QString &fileName = QString()); - - void getArray(const QString &fileURL, const QMap &headers = {}); + void setFile(const QUrl &fileURL, const QUrl &fileName = QUrl()); + void getArray(const QUrl &fileURL, const QMap &headers = {}); private: QNetworkAccessManager *manager; QNetworkReply *reply; QFile *file; - QByteArray array; + QByteArray *array; signals: void progress(int percent); void downloadReady(); void fileSaved(QString path); void warning(QString warning); void dataReady(QByteArray array); void done(); private slots: void onDownloadProgress(qint64 bytesRead, qint64 bytesTotal); void onFinished(QNetworkReply* reply); void onReadyRead(); void onReplyFinished(); }; } #endif // DOWNLOADER_H diff --git a/src/maui-style/icons-png.qrc b/src/maui-style/icons_png.qrc similarity index 100% rename from src/maui-style/icons-png.qrc rename to src/maui-style/icons_png.qrc diff --git a/src/mauikit.cpp b/src/mauikit.cpp index 6a1f8de..8c561dd 100644 --- a/src/mauikit.cpp +++ b/src/mauikit.cpp @@ -1,231 +1,235 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mauikit.h" #include #include "handy.h" #include "mauimodel.h" #include "mauilist.h" #include "pathlist.h" #include "mauiapp.h" #include "fmstatic.h" #ifdef COMPONENT_ACCOUNTS #include "mauiaccounts.h" #endif #ifdef COMPONENT_FM #include "fm.h" #include "placeslist.h" #include "fmlist.h" #endif #ifdef COMPONENT_TAGGING #include "tagsmodel.h" #include "tagslist.h" #endif #ifdef COMPONENT_STORE #include "storemodel.h" #include "storelist.h" #endif #ifdef COMPONENT_EDITOR #include "documenthandler.h" #include "syntaxhighlighterutil.h" #include "kquicksyntaxhighlighter/kquicksyntaxhighlighter.h" #endif #ifdef Q_OS_ANDROID #include "mauiandroid.h" #elif defined Q_OS_LINUX #include "mauikde.h" #endif #if defined MAUIKIT_STYLE #include #include #endif QUrl MauiKit::componentUrl(const QString &fileName) const { #ifdef MAUI_APP return QUrl(QStringLiteral("qrc:/maui/kit/") + fileName); #else return QUrl(resolveFileUrl(fileName)); #endif } void MauiKit::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.mauikit")); qmlRegisterSingletonType(componentUrl(QStringLiteral("Style.qml")), uri, 1, 0, "Style"); qmlRegisterType(componentUrl(QStringLiteral("ToolBar.qml")), uri, 1, 0, "ToolBar"); qmlRegisterType(componentUrl(QStringLiteral("ApplicationWindow.qml")), uri, 1, 0, "ApplicationWindow"); qmlRegisterType(componentUrl(QStringLiteral("Page.qml")), uri, 1, 0, "Page"); qmlRegisterType(componentUrl(QStringLiteral("ShareDialog.qml")), uri, 1, 0, "ShareDialog"); qmlRegisterType(componentUrl(QStringLiteral("PieButton.qml")), uri, 1, 0, "PieButton"); qmlRegisterType(componentUrl(QStringLiteral("SideBar.qml")), uri, 1, 0, "SideBar"); qmlRegisterType(componentUrl(QStringLiteral("AbstractSideBar.qml")), uri, 1, 0, "AbstractSideBar"); qmlRegisterType(componentUrl(QStringLiteral("Holder.qml")), uri, 1, 0, "Holder"); qmlRegisterType(componentUrl(QStringLiteral("GlobalDrawer.qml")), uri, 1, 0, "GlobalDrawer"); qmlRegisterType(componentUrl(QStringLiteral("ListDelegate.qml")), uri, 1, 0, "ListDelegate"); qmlRegisterType(componentUrl(QStringLiteral("ListBrowserDelegate.qml")), uri, 1, 0, "ListBrowserDelegate"); qmlRegisterType(componentUrl(QStringLiteral("SwipeItemDelegate.qml")), uri, 1, 0, "SwipeItemDelegate"); qmlRegisterType(componentUrl(QStringLiteral("SwipeBrowserDelegate.qml")), uri, 1, 0, "SwipeBrowserDelegate"); qmlRegisterType(componentUrl(QStringLiteral("ItemDelegate.qml")), uri, 1, 0, "ItemDelegate"); qmlRegisterType(componentUrl(QStringLiteral("GridBrowserDelegate.qml")), uri, 1, 0, "GridBrowserDelegate"); qmlRegisterType(componentUrl(QStringLiteral("SelectionBar.qml")), uri, 1, 0, "SelectionBar"); qmlRegisterType(componentUrl(QStringLiteral("LabelDelegate.qml")), uri, 1, 0, "LabelDelegate"); qmlRegisterType(componentUrl(QStringLiteral("NewDialog.qml")), uri, 1, 0, "NewDialog"); qmlRegisterType(componentUrl(QStringLiteral("Dialog.qml")), uri, 1, 0, "Dialog"); qmlRegisterType(componentUrl(QStringLiteral("AboutDialog.qml")), uri, 1, 0, "AboutDialog"); qmlRegisterType(componentUrl(QStringLiteral("Popup.qml")), uri, 1, 0, "Popup"); qmlRegisterType(componentUrl(QStringLiteral("TextField.qml")), uri, 1, 0, "TextField"); qmlRegisterType(componentUrl(QStringLiteral("Badge.qml")), uri, 1, 0, "Badge"); qmlRegisterType(componentUrl(QStringLiteral("GridView.qml")), uri, 1, 0, "GridView"); qmlRegisterType(componentUrl(QStringLiteral("ColorsBar.qml")), uri, 1, 0, "ColorsBar"); qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer"); qmlRegisterType(componentUrl(QStringLiteral("TabBar.qml")), uri, 1, 0, "TabBar"); qmlRegisterType(componentUrl(QStringLiteral("TabButton.qml")), uri, 1, 0, "TabButton"); qmlRegisterType(componentUrl(QStringLiteral("ActionGroup.qml")), uri, 1, 0, "ActionGroup"); qmlRegisterType(componentUrl(QStringLiteral("ActionSideBar.qml")), uri, 1, 0, "ActionSideBar"); qmlRegisterType(componentUrl(QStringLiteral("ToolActions.qml")), uri, 1, 0, "ToolActions"); qmlRegisterType(componentUrl(QStringLiteral("ToolButtonMenu.qml")), uri, 1, 0, "ToolButtonMenu"); qmlRegisterType(componentUrl(QStringLiteral("ListItemTemplate.qml")), uri, 1, 0, "ListItemTemplate"); qmlRegisterType(componentUrl(QStringLiteral("FloatingButton.qml")), uri, 1, 0, "FloatingButton"); qmlRegisterType(componentUrl(QStringLiteral("PathBar.qml")), uri, 1, 0, "PathBar"); qmlRegisterType(uri, 1, 0, "PathList"); /** 1.1 **/ qmlRegisterType(componentUrl(QStringLiteral("labs/SelectionBar.qml")), uri, 1, 1, "SelectionBar"); /** STORE CONTROLS, MODELS AND INTERFACES **/ #ifdef COMPONENT_STORE qmlRegisterType("StoreList", 1, 0, "StoreList"); qmlRegisterType("StoreModel", 1, 0, "StoreModel"); qmlRegisterType(componentUrl(QStringLiteral("private/StoreDelegate.qml")), uri, 1, 0, "StoreDelegate"); qmlRegisterType(componentUrl(QStringLiteral("Store.qml")), uri, 1, 0, "Store"); #endif /** BROWSING CONTROLS **/ qmlRegisterType(componentUrl(QStringLiteral("ListBrowser.qml")), uri, 1, 0, "ListBrowser"); qmlRegisterType(componentUrl(QStringLiteral("GridBrowser.qml")), uri, 1, 0, "GridBrowser"); /** FM CONTROLS, MODELS AND INTERFACES **/ #ifdef COMPONENT_FM qmlRegisterType(uri, 1, 0, "PlacesList"); qmlRegisterType(uri, 1, 0, "FMList"); qmlRegisterSingletonType(uri, 1, 0, "FM", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new FMStatic; }); // qmlRegisterSingletonType(componentUrl(QStringLiteral("private/FileBrowser.qml")), uri, 1, 0, "FileMenu"); qmlRegisterType(componentUrl(QStringLiteral("FileBrowser.qml")), uri, 1, 0, "FileBrowser"); qmlRegisterType(componentUrl(QStringLiteral("PlacesSidebar.qml")), uri, 1, 0, "PlacesSidebar"); qmlRegisterType(componentUrl(QStringLiteral("PlacesListBrowser.qml")), uri, 1, 0, "PlacesListBrowser"); qmlRegisterType(componentUrl(QStringLiteral("FilePreviewer.qml")), uri, 1, 0, "FilePreviewer"); qmlRegisterType(componentUrl(QStringLiteral("FileDialog.qml")), uri, 1, 0, "FileDialog"); #endif #ifdef COMPONENT_EDITOR /** EDITOR CONTROLS **/ qmlRegisterType(uri, 1, 0, "DocumentHandler"); qmlRegisterType(); qmlRegisterType(componentUrl(QStringLiteral("Editor.qml")), uri, 1, 0, "Editor"); qmlRegisterType(componentUrl(QStringLiteral("private/DocumentPreview.qml")), uri, 1, 0, "DocumentPreview"); qmlRegisterType("org.kde.kquicksyntaxhighlighter", 0, 1, "KQuickSyntaxHighlighter"); #endif /** PLATFORMS SPECIFIC CONTROLS **/ #ifdef Q_OS_ANDROID qmlRegisterSingletonType(uri, 1, 0, "Android", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new MAUIAndroid; }); #elif defined Q_OS_LINUX qmlRegisterType(componentUrl(QStringLiteral("Terminal.qml")), uri, 1, 0, "Terminal"); qmlRegisterSingletonType(uri, 1, 0, "KDE", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new MAUIKDE; }); #elif defined Q_OS_WIN32 //here window platform integration interfaces #endif /** DATA MODELING TEMPLATED INTERFACES **/ qmlRegisterType(); //ABSTRACT BASE LIST qmlRegisterType(uri, 1, 0, "BaseModel"); //BASE MODEL /** TAGGING INTERFACES AND MODELS **/ qmlRegisterType("TagsList", 1, 0, "TagsList"); qmlRegisterType("TagsModel", 1, 0, "TagsModel"); qmlRegisterType(componentUrl(QStringLiteral("private/TagList.qml")), uri, 1, 0, "TagList"); qmlRegisterType(componentUrl(QStringLiteral("TagsBar.qml")), uri, 1, 0, "TagsBar"); qmlRegisterType(componentUrl(QStringLiteral("TagsDialog.qml")), uri, 1, 0, "TagsDialog"); /** MAUI APPLICATION SPECIFIC PROPS **/ #ifdef COMPONENT_ACCOUNTS qmlRegisterType(); qmlRegisterType(componentUrl(QStringLiteral("SyncDialog.qml")), uri, 1, 0, "SyncDialog"); //to be rename to accountsDialog #endif qmlRegisterUncreatableType(uri, 1, 0, "App", "Cannot be created App"); /** HELPERS **/ qmlRegisterSingletonType(uri, 1, 0, "Handy", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new Handy; }); #if defined MAUIKIT_STYLE this->initResources(); #endif qmlProtectModule(uri, 1); } void MauiKit::initResources() { #if defined QICON_H && defined QQUICKSTYLE_H Q_INIT_RESOURCE(mauikit); +#ifdef ICONS_PNG + Q_INIT_RESOURCE(icons_png); +#else Q_INIT_RESOURCE(icons); +#endif Q_INIT_RESOURCE(style); QIcon::setThemeSearchPaths({":/icons/luv-icon-theme"}); QIcon::setThemeName("Luv"); QQuickStyle::setStyle(":/style"); #endif } //#include "moc_mauikit.cpp"