Compare commits
6 Commits
1dc136647a
...
b53048bebc
| Author | SHA1 | Date | |
|---|---|---|---|
| b53048bebc | |||
| e95606be63 | |||
| b1270ec0f2 | |||
| 67a7d9cc8f | |||
| 2cb14c7f8a | |||
| 03295cd579 |
@@ -31,9 +31,33 @@
|
|||||||
#define NETWORK_TIMEOUT 10000
|
#define NETWORK_TIMEOUT 10000
|
||||||
|
|
||||||
#ifdef KOMPLEX_LOCAL_DEV
|
#ifdef KOMPLEX_LOCAL_DEV
|
||||||
#define KOMPLEX_API_HOST "https://komplex.net.hlab"
|
#define KOMPLEX_API_HOST "https://komplexapi.hlab"
|
||||||
#else
|
#else
|
||||||
#define KOMPLEX_API_HOST "https://digitalartifex.dev"
|
#define KOMPLEX_API_HOST "https://komplex.digitalartifex.dev"
|
||||||
#endif
|
#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
|
#endif // KOMPLEX_GLOBAL_H
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Q_DECLARE_METATYPE(WallpaperInstallData)
|
|||||||
|
|
||||||
struct KOMPLEX_EXPORT WallpaperCache
|
struct KOMPLEX_EXPORT WallpaperCache
|
||||||
{
|
{
|
||||||
QString uri;
|
QString uuid;
|
||||||
QString name;
|
QString name;
|
||||||
QString author;
|
QString author;
|
||||||
QString authorId;
|
QString authorId;
|
||||||
@@ -54,7 +54,7 @@ struct KOMPLEX_EXPORT WallpaperCache
|
|||||||
auto operator == (const WallpaperCache &other) const -> bool
|
auto operator == (const WallpaperCache &other) const -> bool
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
other.uri == uri &&
|
other.uuid == uuid &&
|
||||||
other.name == name &&
|
other.name == name &&
|
||||||
other.author == author &&
|
other.author == author &&
|
||||||
other.authorId == authorId &&
|
other.authorId == authorId &&
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
class KOMPLEX_EXPORT FeaturedCubemapsPaginator : public WallpaperPaginator
|
class KOMPLEX_EXPORT FeaturedCubemapsPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit FeaturedCubemapsPaginator() : WallpaperPaginator()
|
explicit FeaturedCubemapsPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT FeaturedImagesPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit FeaturedImagesPaginator() : WallpaperPaginator()
|
explicit FeaturedImagesPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT FeaturedPacksPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit FeaturedPacksPaginator() : WallpaperPaginator()
|
explicit FeaturedPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT FeaturedShadersPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit FeaturedShadersPaginator() : WallpaperPaginator()
|
explicit FeaturedShadersPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT NewestCubemapsPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit NewestCubemapsPaginator() : WallpaperPaginator()
|
explicit NewestCubemapsPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT NewestPacksPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit NewestPacksPaginator() : WallpaperPaginator()
|
explicit NewestPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT NewestShadersPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit NewestShadersPaginator() : WallpaperPaginator()
|
explicit NewestShadersPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT SearchCubemapsPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SearchCubemapsPaginator() : WallpaperPaginator()
|
explicit SearchCubemapsPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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 "wallpaperpaginator.h"
|
||||||
|
|
||||||
|
#include "common/komplex_global.h"
|
||||||
|
|
||||||
class KOMPLEX_EXPORT SearchImagesPaginator : public WallpaperPaginator
|
class KOMPLEX_EXPORT SearchImagesPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SearchImagesPaginator() : WallpaperPaginator()
|
explicit SearchImagesPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT SearchPacksPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SearchPacksPaginator() : WallpaperPaginator()
|
explicit SearchPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT SearchShadersPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SearchShadersPaginator() : WallpaperPaginator()
|
explicit SearchShadersPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
class KOMPLEX_EXPORT SearchVideosPaginator : public WallpaperPaginator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SearchVideosPaginator() : WallpaperPaginator()
|
explicit SearchVideosPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
|
||||||
{
|
{
|
||||||
setUri(
|
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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit WallpaperPaginator() : Paginator<WallpaperCache>()
|
explicit WallpaperPaginator(QObject *parent = nullptr) : Paginator<WallpaperCache>(parent)
|
||||||
{
|
{
|
||||||
SlidingCacheController<WallpaperCache> *controller = this->controller();
|
SlidingCacheController<WallpaperCache> *controller = this->controller();
|
||||||
controller->setFetch(
|
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);
|
QNetworkRequest request(url);
|
||||||
request.setHeaders(
|
request.setHeaders(
|
||||||
|
|||||||
Reference in New Issue
Block a user