From 7b252551266e921a226d8477f55f126c4a0ac5ca Mon Sep 17 00:00:00 2001 From: Digital Artifex <7929434+DigitalArtifex@users.noreply.github.com> Date: Fri, 21 Aug 2026 07:11:31 -0400 Subject: [PATCH] Final alpha fixes. BETA1 release --- KomplexHubContent/pages/LiveSearchPage.qml | 1 + KomplexHubPlugin/downloadmanager.cpp | 34 +++++++++++++++++----- KomplexHubPlugin/packcompiler.cpp | 33 +++++++-------------- KomplexHubPlugin/packcompiler.h | 2 +- README.md | 18 +++++------- 5 files changed, 46 insertions(+), 42 deletions(-) diff --git a/KomplexHubContent/pages/LiveSearchPage.qml b/KomplexHubContent/pages/LiveSearchPage.qml index cc24dbb..072c741 100644 --- a/KomplexHubContent/pages/LiveSearchPage.qml +++ b/KomplexHubContent/pages/LiveSearchPage.qml @@ -112,6 +112,7 @@ Item viewMoreWallpaperPopup.authorId = searchModel.data(searchModel.index(index,0), PackSearchModel.AuthorIdRole) viewMoreWallpaperPopup.description = searchModel.data(searchModel.index(index,0), PackSearchModel.DescriptionRole) viewMoreWallpaperPopup.thumbnail = searchModel.data(searchModel.index(index,0), PackSearchModel.ThumbnailRole) + viewMoreWallpaperPopup.uuid = searchModel.data(searchModel.index(index,0), PackSearchModel.UuidRole) viewMoreWallpaperPopup.opacity = 1 popupContainer.opacity = 1 paginator.opacity = 0 diff --git a/KomplexHubPlugin/downloadmanager.cpp b/KomplexHubPlugin/downloadmanager.cpp index bfd911c..8e25805 100644 --- a/KomplexHubPlugin/downloadmanager.cpp +++ b/KomplexHubPlugin/downloadmanager.cpp @@ -105,6 +105,7 @@ auto DownloadManager::downloadImage(const QString &author, const QString &author metadata.setDescription(description); metadata.setName(QStringLiteral("Pexels Image (%1)").arg(id)); metadata.setSource(QStringLiteral("./images/%1").arg(result.fileName())); + metadata.setId(id); QUrl packUri ( @@ -187,18 +188,26 @@ auto DownloadManager::downloadImage(const QString &author, const QString &author ) .onFailed ( - [this] (const NetworkException &e) + [this] (const std::filesystem::filesystem_error &e) { reset(); - setError(QStringLiteral("Network Exception %1").arg(QString::number(e.errorCode)), e.message); + setError(QStringLiteral("Network Exception %1").arg(QString::number(e.code().value())), e.what()); } ) .onFailed ( - [this] (const FileException &e) + [this] (const std::logic_error &e) { reset(); - setError(QStringLiteral("File Exception %1").arg(QString::number(e.errorCode)), e.message); + setError(QStringLiteral("Logic Exception %1"), e.what()); + } + ) + .onFailed + ( + [this] (const std::exception &e) + { + reset(); + setError(QStringLiteral("Logic Exception %1"), e.what()); } ) .onFailed @@ -235,6 +244,7 @@ auto DownloadManager::downloadVideo(const QString &author, const QString &author metadata.setType(ShaderPack::Video); metadata.setName(QStringLiteral("Pexels Video (%1)").arg(id)); metadata.setSource(QStringLiteral("./videos/%1").arg(result.fileName())); + metadata.setId(id); QUrl packUri ( @@ -312,18 +322,26 @@ auto DownloadManager::downloadVideo(const QString &author, const QString &author ) .onFailed ( - [this] (const NetworkException &e) + [this] (const std::filesystem::filesystem_error &e) { reset(); - setError(QStringLiteral("Network Exception %1").arg(QString::number(e.errorCode)), e.message); + setError(QStringLiteral("Network Exception %1").arg(QString::number(e.code().value())), e.what()); } ) .onFailed ( - [this] (const FileException &e) + [this] (const std::logic_error &e) { reset(); - setError(QStringLiteral("File Exception %1").arg(QString::number(e.errorCode)), e.message); + setError(QStringLiteral("Logic Exception %1"), e.what()); + } + ) + .onFailed + ( + [this] (const std::exception &e) + { + reset(); + setError(QStringLiteral("Logic Exception %1"), e.what()); } ) .onFailed diff --git a/KomplexHubPlugin/packcompiler.cpp b/KomplexHubPlugin/packcompiler.cpp index bf5d383..d0b1ae8 100644 --- a/KomplexHubPlugin/packcompiler.cpp +++ b/KomplexHubPlugin/packcompiler.cpp @@ -42,20 +42,7 @@ auto PackCompiler::process(const QUrl &uri) -> QFuture ( [this, uri] () -> QUrl { - if(!uri.isLocalFile()) - { - setError - ( - QStringLiteral("File Error"), - QStringLiteral("URI %1 is not a local file").arg - ( - uri.toString() - ) - ); - - return {}; - } - + validateUri(uri); reset(); setStatus(QStringLiteral("Compiling %1").arg(uri.fileName())); setState(Compiling); @@ -295,7 +282,7 @@ auto PackCompiler::prepareShaders(const QUrl &uri) noexcept(false) -> void auto PackCompiler::loadCommonFragmentData(const QUrl &uri) -> QByteArray { - localCheck(uri); + validateUri(uri); QDir sourceDirectory ( @@ -358,7 +345,7 @@ auto PackCompiler::loadCommonFragmentData(const QUrl &uri) -> QByteArray auto PackCompiler::loadCommonVertexData(const QUrl &uri) -> QByteArray { - localCheck(uri); + validateUri(uri); QDir sourceDirectory ( @@ -421,7 +408,7 @@ auto PackCompiler::loadCommonVertexData(const QUrl &uri) -> QByteArray auto PackCompiler::loadGlobalData(const QUrl &uri) -> QByteArray { - localCheck(uri); + validateUri(uri); QDir sourceDirectory ( @@ -490,7 +477,7 @@ auto PackCompiler::validateDirectory(const QUrl &uri) -> bool auto PackCompiler::createDirectory(const QUrl &uri) -> void { - localCheck(uri); + validateUri(uri); QStringList arguments = { @@ -573,7 +560,7 @@ auto PackCompiler::createDirectory(const QUrl &uri) -> void } } -auto PackCompiler::localCheck(const QUrl &uri) noexcept(false) -> void +auto PackCompiler::validateUri(const QUrl &uri) noexcept(false) -> void { if(!uri.isValid() || !uri.isLocalFile()) { @@ -594,7 +581,7 @@ auto PackCompiler::localCheck(const QUrl &uri) noexcept(false) -> void auto PackCompiler::extract(const QUrl &sourceUri) noexcept(false) -> QUrl { - localCheck(sourceUri); + validateUri(sourceUri); QFileInfo info(sourceUri.toLocalFile()); @@ -718,7 +705,7 @@ auto PackCompiler::copyFile(const QUrl &sourceUri, const QUrl &destinationUri) n auto PackCompiler::compile(const QUrl &uri) noexcept(false) -> void { - localCheck(uri); + validateUri(uri); setState(Compiling); @@ -869,7 +856,7 @@ auto PackCompiler::preprocess(const QUrl &uri) noexcept(false) -> void auto PackCompiler::appendVersion(const QUrl &uri) noexcept(false) -> void { - localCheck(uri); + validateUri(uri); QFile file(uri.toLocalFile()); @@ -899,7 +886,7 @@ auto PackCompiler::appendVersion(const QUrl &uri) noexcept(false) -> void auto PackCompiler::compileShader(const QUrl &uri) noexcept(false) -> void { - localCheck(uri); + validateUri(uri); QString qsb = QStringLiteral("/usr/lib/qt6/bin/qsb"); diff --git a/KomplexHubPlugin/packcompiler.h b/KomplexHubPlugin/packcompiler.h index 083f4a1..4d5dddb 100644 --- a/KomplexHubPlugin/packcompiler.h +++ b/KomplexHubPlugin/packcompiler.h @@ -114,7 +114,7 @@ protected: auto createDirectory(const QUrl &uri) -> void; - auto localCheck(const QUrl &uri) noexcept(false) -> void; + auto validateUri(const QUrl &uri) noexcept(false) -> void; auto extract(const QUrl &sourceUri) noexcept(false) -> QUrl; auto copyFile(const QUrl &sourceUri, const QUrl &destinationUri) noexcept(false) -> void; auto compile(const QUrl &uri) noexcept(false) -> void; diff --git a/README.md b/README.md index 87401d7..95b3a24 100644 --- a/README.md +++ b/README.md @@ -139,19 +139,19 @@ Content purchases will be processed through the website using Paypal as will art | - Popular Videos | ✅ | | | - View More | ✅ | | | | | | -| Media Search | ✔ | | +| Media Search | ✅ | | | - Packs | ✅ | | | - Videos | ✅ | | | - Images | ✅ | | | | | | -| Media Downloader | ✔ | | -| - Packs | ❌ | | -| - Videos | ❌ | | +| Media Downloader | ✅ | | +| - Packs | ✅ | | +| - Videos | ✅ | | | - Images | ✅ | | | | | | -| Detailed Views | ✔ | | -| - Packs | ✔ | | -| - Videos | ✔ | | +| Detailed Views | ✅ | | +| - Packs | ✅ | | +| - Videos | ✅ | | | - Images | ✅ | | | | | | | App Management | ✔ | | @@ -182,8 +182,6 @@ Content purchases will be processed through the website using Paypal as will art | - Artist Payout | ❌ | | | - User Media Purchase | ❌ | | -This app is currently under development and is currently alpha. The API is now being hosted on https://komplex.dev. +This app is currently under development and is currently BETA1 and the new API is live. Please do expect bugs in pack compiling at this stage. -I have begun adding download functionality, however it is not yet complete. "Featured" Live wallpapers is currently a duplicated of "Newest". The featured endpoint will take manual curation, so this will take some time. -BETA should be here within a few weeks.