Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b53048bebc | |||
| e95606be63 | |||
| b1270ec0f2 | |||
| 67a7d9cc8f | |||
| 2cb14c7f8a | |||
| 03295cd579 |
@@ -31,9 +31,33 @@
|
||||
#define NETWORK_TIMEOUT 10000
|
||||
|
||||
#ifdef KOMPLEX_LOCAL_DEV
|
||||
#define KOMPLEX_API_HOST "https://komplex.net.hlab"
|
||||
#define KOMPLEX_API_HOST "https://komplexapi.hlab"
|
||||
#else
|
||||
#define KOMPLEX_API_HOST "https://digitalartifex.dev"
|
||||
#define KOMPLEX_API_HOST "https://komplex.digitalartifex.dev"
|
||||
#endif
|
||||
|
||||
#define KOMPLEX_API_VERSION "v2"
|
||||
|
||||
#define KOMPLEX_ENDPOINT_IMAGES_SEARCH "images/search"
|
||||
#define KOMPLEX_ENDPOINT_IMAGES_FEATURED "images/featured"
|
||||
#define KOMPLEX_ENDPOINT_IMAGES_ITEM "images/item"
|
||||
|
||||
#define KOMPLEX_ENDPOINT_VIDEOS_SEARCH "videos/search"
|
||||
#define KOMPLEX_ENDPOINT_VIDEOS_ITEM "videos/item"
|
||||
|
||||
#define KOMPLEX_ENDPOINT_SHADERS_SEARCH "shaders/search"
|
||||
#define KOMPLEX_ENDPOINT_SHADERS_FEATURED "shaders/featured"
|
||||
#define KOMPLEX_ENDPOINT_SHADERS_ITEM "shaders/item"
|
||||
#define KOMPLEX_ENDPOINT_SHADERS_NEWEST "shaders/newest"
|
||||
|
||||
#define KOMPLEX_ENDPOINT_CUBEMAPS_SEARCH "cubemaps/search"
|
||||
#define KOMPLEX_ENDPOINT_CUBEMAPS_FEATURED "cubemaps/featured"
|
||||
#define KOMPLEX_ENDPOINT_CUBEMAPS_ITEM "cubemaps/item"
|
||||
#define KOMPLEX_ENDPOINT_CUBEMAPS_NEWEST "cubemaps/newest"
|
||||
|
||||
#define KOMPLEX_ENDPOINT_PACKS_SEARCH "packs/search"
|
||||
#define KOMPLEX_ENDPOINT_PACKS_FEATURED "packs/featured"
|
||||
#define KOMPLEX_ENDPOINT_PACKS_ITEM "packs/item"
|
||||
#define KOMPLEX_ENDPOINT_PACKS_NEWEST "packs/newest"
|
||||
|
||||
#endif // KOMPLEX_GLOBAL_H
|
||||
|
||||
@@ -39,7 +39,7 @@ Q_DECLARE_METATYPE(WallpaperInstallData)
|
||||
|
||||
struct KOMPLEX_EXPORT WallpaperCache
|
||||
{
|
||||
QString uri;
|
||||
QString uuid;
|
||||
QString name;
|
||||
QString author;
|
||||
QString authorId;
|
||||
@@ -54,7 +54,7 @@ struct KOMPLEX_EXPORT WallpaperCache
|
||||
auto operator == (const WallpaperCache &other) const -> bool
|
||||
{
|
||||
return (
|
||||
other.uri == uri &&
|
||||
other.uuid == uuid &&
|
||||
other.name == name &&
|
||||
other.author == author &&
|
||||
other.authorId == authorId &&
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT FeaturedCubemapsPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit FeaturedCubemapsPaginator() : WallpaperPaginator()
|
||||
explicit FeaturedCubemapsPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/cubemaps/featured/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_CUBEMAPS_FEATURED)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT FeaturedImagesPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit FeaturedImagesPaginator() : WallpaperPaginator()
|
||||
explicit FeaturedImagesPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/images/featured/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_IMAGES_FEATURED)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT FeaturedPacksPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit FeaturedPacksPaginator() : WallpaperPaginator()
|
||||
explicit FeaturedPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/packs/featured/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_PACKS_FEATURED)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT FeaturedShadersPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit FeaturedShadersPaginator() : WallpaperPaginator()
|
||||
explicit FeaturedShadersPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/shaders/featured/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_SHADERS_FEATURED)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT NewestCubemapsPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit NewestCubemapsPaginator() : WallpaperPaginator()
|
||||
explicit NewestCubemapsPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/cubemaps/newest/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_CUBEMAPS_NEWEST)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT NewestPacksPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit NewestPacksPaginator() : WallpaperPaginator()
|
||||
explicit NewestPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/packs/newest/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_PACKS_NEWEST)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT NewestShadersPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit NewestShadersPaginator() : WallpaperPaginator()
|
||||
explicit NewestShadersPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/shaders/newest/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_SHADERS_NEWEST)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT SearchCubemapsPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit SearchCubemapsPaginator() : WallpaperPaginator()
|
||||
explicit SearchCubemapsPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/cubemaps/search/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_CUBEMAPS_SEARCH)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,13 +31,15 @@
|
||||
|
||||
#include "wallpaperpaginator.h"
|
||||
|
||||
#include "common/komplex_global.h"
|
||||
|
||||
class KOMPLEX_EXPORT SearchImagesPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit SearchImagesPaginator() : WallpaperPaginator()
|
||||
explicit SearchImagesPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/images/search/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_IMAGES_SEARCH)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT SearchPacksPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit SearchPacksPaginator() : WallpaperPaginator()
|
||||
explicit SearchPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/packs/search/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_PACKS_SEARCH)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT SearchShadersPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit SearchShadersPaginator() : WallpaperPaginator()
|
||||
explicit SearchShadersPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/shaders/search/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_SHADERS_SEARCH)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
class KOMPLEX_EXPORT SearchVideosPaginator : public WallpaperPaginator
|
||||
{
|
||||
public:
|
||||
explicit SearchVideosPaginator() : WallpaperPaginator()
|
||||
explicit SearchVideosPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||
{
|
||||
setUri(
|
||||
QString::fromUtf8("%1/v2/videos/search/").arg(KOMPLEX_API_HOST)
|
||||
QString::fromUtf8(KOMPLEX_ENDPOINT_VIDEOS_SEARCH)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ class KOMPLEX_EXPORT WallpaperPaginator : public Paginator<WallpaperCache>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WallpaperPaginator() : Paginator<WallpaperCache>()
|
||||
explicit WallpaperPaginator(QObject *parent = nullptr) : Paginator<WallpaperCache>(parent)
|
||||
{
|
||||
SlidingCacheController<WallpaperCache> *controller = this->controller();
|
||||
controller->setFetch(
|
||||
@@ -125,7 +125,13 @@ protected:
|
||||
{}
|
||||
);
|
||||
|
||||
QUrl url(m_uri);
|
||||
QUrl url(
|
||||
QString::fromUtf8("%1/%2/%3").arg(
|
||||
KOMPLEX_API_HOST,
|
||||
KOMPLEX_API_VERSION,
|
||||
m_uri
|
||||
)
|
||||
);
|
||||
|
||||
QNetworkRequest request(url);
|
||||
request.setHeaders(
|
||||
|
||||
Reference in New Issue
Block a user