diff --git a/dataengines/potd/CMakeLists.txt b/dataengines/potd/CMakeLists.txt --- a/dataengines/potd/CMakeLists.txt +++ b/dataengines/potd/CMakeLists.txt @@ -136,11 +136,286 @@ install( TARGETS plasma_potd_bingprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) +# Unsplash + set( potd_unsplash_provider_SRCS unsplashprovider.cpp + unsplashbaseprovider.cpp ) add_library( plasma_potd_unsplashprovider MODULE ${potd_unsplash_provider_SRCS} ) target_link_libraries( plasma_potd_unsplashprovider plasmapotdprovidercore KF5::KIOCore ) install( TARGETS plasma_potd_unsplashprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + +# Unsplash Nature + +set( potd_unsplash_nature_provider_SRCS + unsplashnatureprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashnatureprovider MODULE ${potd_unsplash_nature_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashnatureprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashnatureprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + +# Unsplash Black + +set( potd_unsplash_black_provider_SRCS + unsplashblackprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashblackprovider MODULE ${potd_unsplash_black_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashblackprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashblackprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Background + +set( potd_unsplash_background_provider_SRCS + unsplashbackgroundprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashbackgroundprovider MODULE ${potd_unsplash_background_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashbackgroundprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashbackgroundprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Tumblr + +set( potd_unsplash_tumblr_provider_SRCS + unsplashtumblrprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashtumblrprovider MODULE ${potd_unsplash_tumblr_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashtumblrprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashtumblrprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Flower + +set( potd_unsplash_flower_provider_SRCS + unsplashflowerprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashflowerprovider MODULE ${potd_unsplash_flower_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashflowerprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashflowerprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Funny + +set( potd_unsplash_funny_provider_SRCS + unsplashfunnyprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashfunnyprovider MODULE ${potd_unsplash_funny_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashfunnyprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashfunnyprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Cute + +set( potd_unsplash_cute_provider_SRCS + unsplashcuteprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashcuteprovider MODULE ${potd_unsplash_cute_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashcuteprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashcuteprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Cool + +set( potd_unsplash_cool_provider_SRCS + unsplashcoolprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashcoolprovider MODULE ${potd_unsplash_cool_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashcoolprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashcoolprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Fall + +set( potd_unsplash_fall_provider_SRCS + unsplashfallprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashfallprovider MODULE ${potd_unsplash_fall_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashfallprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashfallprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Love + +set( potd_unsplash_love_provider_SRCS + unsplashloveprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashloveprovider MODULE ${potd_unsplash_love_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashloveprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashloveprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Design + +set( potd_unsplash_design_provider_SRCS + unsplashdesignprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashdesignprovider MODULE ${potd_unsplash_design_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashdesignprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashdesignprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Christmas + +set( potd_unsplash_christmas_provider_SRCS + unsplashchristmasprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashchristmasprovider MODULE ${potd_unsplash_christmas_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashchristmasprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashchristmasprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Travel + +set( potd_unsplash_travel_provider_SRCS + unsplashtravelprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashtravelprovider MODULE ${potd_unsplash_travel_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashtravelprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashtravelprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Beach + +set( potd_unsplash_beach_provider_SRCS + unsplashbeachprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashbeachprovider MODULE ${potd_unsplash_beach_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashbeachprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashbeachprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Car + +set( potd_unsplash_car_provider_SRCS + unsplashcarprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashcarprovider MODULE ${potd_unsplash_car_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashcarprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashcarprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Sports + +set( potd_unsplash_sports_provider_SRCS + unsplashsportsprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashsportsprovider MODULE ${potd_unsplash_sports_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashsportsprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashsportsprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Animal + +set( potd_unsplash_animal_provider_SRCS + unsplashanimalprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashanimalprovider MODULE ${potd_unsplash_animal_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashanimalprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashanimalprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash People + +set( potd_unsplash_people_provider_SRCS + unsplashpeopleprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashpeopleprovider MODULE ${potd_unsplash_people_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashpeopleprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashpeopleprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Music + +set( potd_unsplash_music_provider_SRCS + unsplashmusicprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashmusicprovider MODULE ${potd_unsplash_music_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashmusicprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashmusicprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Summer + +set( potd_unsplash_summer_provider_SRCS + unsplashsummerprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashsummerprovider MODULE ${potd_unsplash_summer_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashsummerprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashsummerprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + + +# Unsplash Galaxy + +set( potd_unsplash_galaxy_provider_SRCS + unsplashgalaxyprovider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplashgalaxyprovider MODULE ${potd_unsplash_galaxy_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplashgalaxyprovider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplashgalaxyprovider DESTINATION ${KDE_INSTALL_PLUGINDIR}/potd ) + diff --git a/dataengines/potd/generate_unsplash_provider.sh b/dataengines/potd/generate_unsplash_provider.sh new file mode 100755 --- /dev/null +++ b/dataengines/potd/generate_unsplash_provider.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# This script is used to generate new Unsplash provider +# +# ./generate_unsplash_provider.sh +# +# For example, you have a collection URL: +# https://unsplash.com/collections/649278/summertime +# +# ./generate_unsplash_provider.sh summertime 649278 +# +# Note the name must a single word without spaces, dashes and underscores. +# You can modify generated files if you think the name can be improved. + +NAME=$1 +NAME_UPPER=${NAME^^} +NAME_CAPITAL=${NAME^} +NAME_LOWER=${NAME,,} +ID=$2 + +BASENAME=unsplash${NAME_LOWER}provider +CPP_FILE=$BASENAME.cpp +H_FILE=$BASENAME.h +JSON_FILE=$BASENAME.json + +cp unsplashnatureprovider.cpp $CPP_FILE +cp unsplashnatureprovider.h $H_FILE +cp unsplashnatureprovider.json $JSON_FILE + +sed -i "s~NATURE~$NAME_UPPER~g" $CPP_FILE $H_FILE $JSON_FILE +sed -i "s~Nature~$NAME_CAPITAL~g" $CPP_FILE $H_FILE $JSON_FILE +sed -i "s~nature~$NAME_LOWER~g" $CPP_FILE $H_FILE $JSON_FILE +sed -i "s~1065376~$ID~g" $CPP_FILE $H_FILE $JSON_FILE + +echo " +# Unsplash $NAME_CAPITAL + +set( potd_unsplash_${NAME_LOWER}_provider_SRCS + unsplash${NAME_LOWER}provider.cpp + unsplashbaseprovider.cpp +) + +add_library( plasma_potd_unsplash${NAME_LOWER}provider MODULE \${potd_unsplash_${NAME_LOWER}_provider_SRCS} ) +target_link_libraries( plasma_potd_unsplash${NAME_LOWER}provider plasmapotdprovidercore KF5::KIOCore ) + +install( TARGETS plasma_potd_unsplash${NAME_LOWER}provider DESTINATION \${KDE_INSTALL_PLUGINDIR}/potd ) +" >> CMakeLists.txt diff --git a/dataengines/potd/unsplashanimalprovider.h b/dataengines/potd/unsplashanimalprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashanimalprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHANIMALPROVIDER_H +#define UNSPLASHANIMALPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Animal Wallpapers Collection + * https://unsplash.com/wallpaper/1065390/animal-wallpapers + */ +class UnsplashAnimalProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashAnimalProvider( QObject *parent, const QVariantList &args ); + ~UnsplashAnimalProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashanimalprovider.cpp b/dataengines/potd/unsplashanimalprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashanimalprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashanimalprovider.h" + +#include + +UnsplashAnimalProvider::UnsplashAnimalProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065390, parent, args) +{ +} + +UnsplashAnimalProvider::~UnsplashAnimalProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashAnimalProvider, "unsplashanimalprovider.json") + +#include "unsplashanimalprovider.moc" diff --git a/dataengines/potd/unsplashanimalprovider.json b/dataengines/potd/unsplashanimalprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashanimalprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Animal Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Animal Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashanimal" +} diff --git a/dataengines/potd/unsplashbackgroundprovider.h b/dataengines/potd/unsplashbackgroundprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbackgroundprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHBACKGROUNDPROVIDER_H +#define UNSPLASHBACKGROUNDPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Background Wallpapers Collection + * https://unsplash.com/wallpaper/1339276/background-wallpapers + */ +class UnsplashBackgroundProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashBackgroundProvider( QObject *parent, const QVariantList &args ); + ~UnsplashBackgroundProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashbackgroundprovider.cpp b/dataengines/potd/unsplashbackgroundprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbackgroundprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashbackgroundprovider.h" + +#include + +UnsplashBackgroundProvider::UnsplashBackgroundProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1339276, parent, args) +{ +} + +UnsplashBackgroundProvider::~UnsplashBackgroundProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashBackgroundProvider, "unsplashbackgroundprovider.json") + +#include "unsplashbackgroundprovider.moc" diff --git a/dataengines/potd/unsplashbackgroundprovider.json b/dataengines/potd/unsplashbackgroundprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbackgroundprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Background Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Background Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashbackground" +} diff --git a/dataengines/potd/unsplashprovider.h b/dataengines/potd/unsplashbaseprovider.h copy from dataengines/potd/unsplashprovider.h copy to dataengines/potd/unsplashbaseprovider.h --- a/dataengines/potd/unsplashprovider.h +++ b/dataengines/potd/unsplashbaseprovider.h @@ -17,20 +17,23 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef UNSPLASHPROVIDER_H -#define UNSPLASHPROVIDER_H +#ifndef UNSPLASHBASEPROVIDER_H +#define UNSPLASHBASEPROVIDER_H #include "potdprovider.h" // Qt #include class KJob; /** - * This class provides random wallpapers from Unsplash Wallpapers - * Image urls are parsed from https://unsplash.com/wallpaper/1065396/desktop-wallpapers + * This class provides random wallpapers from Unsplash Wallpapers Desktop Collection + * https://unsplash.com/wallpaper/1065396/desktop-wallpapers + * + * By extending this class and modify mCollection (the number in url), + * we can get photo wallpaper from any collections */ -class UnsplashProvider : public PotdProvider +class UnsplashBaseProvider : public PotdProvider { Q_OBJECT @@ -41,12 +44,12 @@ * @param parent The parent object. * @param args The arguments. */ - UnsplashProvider( QObject *parent, const QVariantList &args ); + UnsplashBaseProvider( const int collectionId, QObject *parent, const QVariantList &args ); /** * Destroys the Unsplash provider. */ - ~UnsplashProvider() override; + ~UnsplashBaseProvider() override; /** * Returns the requested image. @@ -57,7 +60,6 @@ QImage image() const override; private: - void pageRequestFinished(KJob *job); void imageRequestFinished(KJob *job); private: diff --git a/dataengines/potd/unsplashbaseprovider.cpp b/dataengines/potd/unsplashbaseprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbaseprovider.cpp @@ -0,0 +1,56 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashbaseprovider.h" + +#include +#include + +#include +#include + +UnsplashBaseProvider::UnsplashBaseProvider(const int collectionId, QObject* parent, const QVariantList& args) + : PotdProvider(parent, args) +{ + const QUrl url(QStringLiteral("https://source.unsplash.com/collection/%1/3840x2160/daily").arg(collectionId)); + + KIO::StoredTransferJob* job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo); + connect(job, &KIO::StoredTransferJob::finished, this, &UnsplashBaseProvider::imageRequestFinished); +} + +UnsplashBaseProvider::~UnsplashBaseProvider() = default; + +QImage UnsplashBaseProvider::image() const +{ + return mImage; +} + +void UnsplashBaseProvider::imageRequestFinished(KJob* _job) +{ + KIO::StoredTransferJob* job = static_cast(_job); + if (job->error()) { + emit error(this); + return; + } + QByteArray data = job->data(); + mImage = QImage::fromData(data); + emit finished(this); +} + +#include "unsplashbaseprovider.moc" diff --git a/dataengines/potd/unsplashbeachprovider.h b/dataengines/potd/unsplashbeachprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbeachprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHBEACHPROVIDER_H +#define UNSPLASHBEACHPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Beach Wallpapers Collection + * https://unsplash.com/wallpaper/1065423/beach-wallpapers + */ +class UnsplashBeachProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashBeachProvider( QObject *parent, const QVariantList &args ); + ~UnsplashBeachProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashbeachprovider.cpp b/dataengines/potd/unsplashbeachprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbeachprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashbeachprovider.h" + +#include + +UnsplashBeachProvider::UnsplashBeachProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065423, parent, args) +{ +} + +UnsplashBeachProvider::~UnsplashBeachProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashBeachProvider, "unsplashbeachprovider.json") + +#include "unsplashbeachprovider.moc" diff --git a/dataengines/potd/unsplashbeachprovider.json b/dataengines/potd/unsplashbeachprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashbeachprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Beach Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Beach Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashbeach" +} diff --git a/dataengines/potd/unsplashblackprovider.h b/dataengines/potd/unsplashblackprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashblackprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHBLACKPROVIDER_H +#define UNSPLASHBLACKPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Black Wallpapers Collection + * https://unsplash.com/wallpaper/1101680/black-wallpapers + */ +class UnsplashBlackProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashBlackProvider( QObject *parent, const QVariantList &args ); + ~UnsplashBlackProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashblackprovider.cpp b/dataengines/potd/unsplashblackprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashblackprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashblackprovider.h" + +#include + +UnsplashBlackProvider::UnsplashBlackProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1101680, parent, args) +{ +} + +UnsplashBlackProvider::~UnsplashBlackProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashBlackProvider, "unsplashblackprovider.json") + +#include "unsplashblackprovider.moc" diff --git a/dataengines/potd/unsplashblackprovider.json b/dataengines/potd/unsplashblackprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashblackprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Black Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Black Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashblack" +} diff --git a/dataengines/potd/unsplashcarprovider.h b/dataengines/potd/unsplashcarprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcarprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHCARPROVIDER_H +#define UNSPLASHCARPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Car Wallpapers Collection + * https://unsplash.com/wallpaper/1065408/car-wallpapers + */ +class UnsplashCarProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashCarProvider( QObject *parent, const QVariantList &args ); + ~UnsplashCarProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashcarprovider.cpp b/dataengines/potd/unsplashcarprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcarprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashcarprovider.h" + +#include + +UnsplashCarProvider::UnsplashCarProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065408, parent, args) +{ +} + +UnsplashCarProvider::~UnsplashCarProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashCarProvider, "unsplashcarprovider.json") + +#include "unsplashcarprovider.moc" diff --git a/dataengines/potd/unsplashcarprovider.json b/dataengines/potd/unsplashcarprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcarprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Car Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Car Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashcar" +} diff --git a/dataengines/potd/unsplashchristmasprovider.h b/dataengines/potd/unsplashchristmasprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashchristmasprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHCHRISTMASPROVIDER_H +#define UNSPLASHCHRISTMASPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Christmas Wallpapers Collection + * https://unsplash.com/wallpaper/1066273/christmas-wallpapers + */ +class UnsplashChristmasProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashChristmasProvider( QObject *parent, const QVariantList &args ); + ~UnsplashChristmasProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashchristmasprovider.cpp b/dataengines/potd/unsplashchristmasprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashchristmasprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashchristmasprovider.h" + +#include + +UnsplashChristmasProvider::UnsplashChristmasProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1066273, parent, args) +{ +} + +UnsplashChristmasProvider::~UnsplashChristmasProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashChristmasProvider, "unsplashchristmasprovider.json") + +#include "unsplashchristmasprovider.moc" diff --git a/dataengines/potd/unsplashchristmasprovider.json b/dataengines/potd/unsplashchristmasprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashchristmasprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Christmas Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Christmas Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashchristmas" +} diff --git a/dataengines/potd/unsplashcoolprovider.h b/dataengines/potd/unsplashcoolprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcoolprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHCOOLPROVIDER_H +#define UNSPLASHCOOLPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Cool Wallpapers Collection + * https://unsplash.com/wallpaper/1111678/cool-wallpapers + */ +class UnsplashCoolProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashCoolProvider( QObject *parent, const QVariantList &args ); + ~UnsplashCoolProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashcoolprovider.cpp b/dataengines/potd/unsplashcoolprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcoolprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashcoolprovider.h" + +#include + +UnsplashCoolProvider::UnsplashCoolProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1111678, parent, args) +{ +} + +UnsplashCoolProvider::~UnsplashCoolProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashCoolProvider, "unsplashcoolprovider.json") + +#include "unsplashcoolprovider.moc" diff --git a/dataengines/potd/unsplashcoolprovider.json b/dataengines/potd/unsplashcoolprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcoolprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Cool Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Cool Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashcool" +} diff --git a/dataengines/potd/unsplashcuteprovider.h b/dataengines/potd/unsplashcuteprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcuteprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHCUTEPROVIDER_H +#define UNSPLASHCUTEPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Cute Wallpapers Collection + * https://unsplash.com/wallpaper/1111680/cute-wallpapers + */ +class UnsplashCuteProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashCuteProvider( QObject *parent, const QVariantList &args ); + ~UnsplashCuteProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashcuteprovider.cpp b/dataengines/potd/unsplashcuteprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcuteprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashcuteprovider.h" + +#include + +UnsplashCuteProvider::UnsplashCuteProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1111680, parent, args) +{ +} + +UnsplashCuteProvider::~UnsplashCuteProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashCuteProvider, "unsplashcuteprovider.json") + +#include "unsplashcuteprovider.moc" diff --git a/dataengines/potd/unsplashcuteprovider.json b/dataengines/potd/unsplashcuteprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashcuteprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Cute Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Cute Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashcute" +} diff --git a/dataengines/potd/unsplashdesignprovider.h b/dataengines/potd/unsplashdesignprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashdesignprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHDESIGNPROVIDER_H +#define UNSPLASHDESIGNPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Design Wallpapers Collection + * https://unsplash.com/wallpaper/1066276/design-wallpapers + */ +class UnsplashDesignProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashDesignProvider( QObject *parent, const QVariantList &args ); + ~UnsplashDesignProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashdesignprovider.cpp b/dataengines/potd/unsplashdesignprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashdesignprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashdesignprovider.h" + +#include + +UnsplashDesignProvider::UnsplashDesignProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1066276, parent, args) +{ +} + +UnsplashDesignProvider::~UnsplashDesignProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashDesignProvider, "unsplashdesignprovider.json") + +#include "unsplashdesignprovider.moc" diff --git a/dataengines/potd/unsplashdesignprovider.json b/dataengines/potd/unsplashdesignprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashdesignprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Design Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Design Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashdesign" +} diff --git a/dataengines/potd/unsplashfallprovider.h b/dataengines/potd/unsplashfallprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashfallprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHFALLPROVIDER_H +#define UNSPLASHFALLPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Fall Wallpapers Collection + * https://unsplash.com/wallpaper/1100229/fall-wallpapers + */ +class UnsplashFallProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashFallProvider( QObject *parent, const QVariantList &args ); + ~UnsplashFallProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashfallprovider.cpp b/dataengines/potd/unsplashfallprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashfallprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashfallprovider.h" + +#include + +UnsplashFallProvider::UnsplashFallProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1100229, parent, args) +{ +} + +UnsplashFallProvider::~UnsplashFallProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashFallProvider, "unsplashfallprovider.json") + +#include "unsplashfallprovider.moc" diff --git a/dataengines/potd/unsplashfallprovider.json b/dataengines/potd/unsplashfallprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashfallprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Fall Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Fall Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashfall" +} diff --git a/dataengines/potd/unsplashflowerprovider.h b/dataengines/potd/unsplashflowerprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashflowerprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHFLOWERPROVIDER_H +#define UNSPLASHFLOWERPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Flower Wallpapers Collection + * https://unsplash.com/wallpaper/1100232/flower-wallpapers + */ +class UnsplashFlowerProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashFlowerProvider( QObject *parent, const QVariantList &args ); + ~UnsplashFlowerProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashflowerprovider.cpp b/dataengines/potd/unsplashflowerprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashflowerprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashflowerprovider.h" + +#include + +UnsplashFlowerProvider::UnsplashFlowerProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1100232, parent, args) +{ +} + +UnsplashFlowerProvider::~UnsplashFlowerProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashFlowerProvider, "unsplashflowerprovider.json") + +#include "unsplashflowerprovider.moc" diff --git a/dataengines/potd/unsplashflowerprovider.json b/dataengines/potd/unsplashflowerprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashflowerprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Flower Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Flower Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashflower" +} diff --git a/dataengines/potd/unsplashfunnyprovider.h b/dataengines/potd/unsplashfunnyprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashfunnyprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHFUNNYPROVIDER_H +#define UNSPLASHFUNNYPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Funny Wallpapers Collection + * https://unsplash.com/wallpaper/1111682/funny-wallpapers + */ +class UnsplashFunnyProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashFunnyProvider( QObject *parent, const QVariantList &args ); + ~UnsplashFunnyProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashfunnyprovider.cpp b/dataengines/potd/unsplashfunnyprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashfunnyprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashfunnyprovider.h" + +#include + +UnsplashFunnyProvider::UnsplashFunnyProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1111682, parent, args) +{ +} + +UnsplashFunnyProvider::~UnsplashFunnyProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashFunnyProvider, "unsplashfunnyprovider.json") + +#include "unsplashfunnyprovider.moc" diff --git a/dataengines/potd/unsplashfunnyprovider.json b/dataengines/potd/unsplashfunnyprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashfunnyprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Funny Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Funny Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashfunny" +} diff --git a/dataengines/potd/unsplashgalaxyprovider.h b/dataengines/potd/unsplashgalaxyprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashgalaxyprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHGALAXYPROVIDER_H +#define UNSPLASHGALAXYPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Galaxy Wallpapers Collection + * https://unsplash.com/wallpaper/1065374/galaxy-wallpapers + */ +class UnsplashGalaxyProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashGalaxyProvider( QObject *parent, const QVariantList &args ); + ~UnsplashGalaxyProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashgalaxyprovider.cpp b/dataengines/potd/unsplashgalaxyprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashgalaxyprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashgalaxyprovider.h" + +#include + +UnsplashGalaxyProvider::UnsplashGalaxyProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065374, parent, args) +{ +} + +UnsplashGalaxyProvider::~UnsplashGalaxyProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashGalaxyProvider, "unsplashgalaxyprovider.json") + +#include "unsplashgalaxyprovider.moc" diff --git a/dataengines/potd/unsplashgalaxyprovider.json b/dataengines/potd/unsplashgalaxyprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashgalaxyprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Galaxy Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Galaxy Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashgalaxy" +} diff --git a/dataengines/potd/unsplashloveprovider.h b/dataengines/potd/unsplashloveprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashloveprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHLOVEPROVIDER_H +#define UNSPLASHLOVEPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Love Wallpapers Collection + * https://unsplash.com/wallpaper/1066280/love-wallpapers + */ +class UnsplashLoveProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashLoveProvider( QObject *parent, const QVariantList &args ); + ~UnsplashLoveProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashloveprovider.cpp b/dataengines/potd/unsplashloveprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashloveprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashloveprovider.h" + +#include + +UnsplashLoveProvider::UnsplashLoveProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1066280, parent, args) +{ +} + +UnsplashLoveProvider::~UnsplashLoveProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashLoveProvider, "unsplashloveprovider.json") + +#include "unsplashloveprovider.moc" diff --git a/dataengines/potd/unsplashloveprovider.json b/dataengines/potd/unsplashloveprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashloveprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Love Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Love Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashlove" +} diff --git a/dataengines/potd/unsplashmusicprovider.h b/dataengines/potd/unsplashmusicprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashmusicprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHMUSICPROVIDER_H +#define UNSPLASHMUSICPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Music Wallpapers Collection + * https://unsplash.com/wallpaper/1065384/music-wallpapers + */ +class UnsplashMusicProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashMusicProvider( QObject *parent, const QVariantList &args ); + ~UnsplashMusicProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashmusicprovider.cpp b/dataengines/potd/unsplashmusicprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashmusicprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashmusicprovider.h" + +#include + +UnsplashMusicProvider::UnsplashMusicProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065384, parent, args) +{ +} + +UnsplashMusicProvider::~UnsplashMusicProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashMusicProvider, "unsplashmusicprovider.json") + +#include "unsplashmusicprovider.moc" diff --git a/dataengines/potd/unsplashmusicprovider.json b/dataengines/potd/unsplashmusicprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashmusicprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Music Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Music Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashmusic" +} diff --git a/dataengines/potd/unsplashnatureprovider.h b/dataengines/potd/unsplashnatureprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashnatureprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHNATUREPROVIDER_H +#define UNSPLASHNATUREPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Nature Wallpapers Collection + * https://unsplash.com/wallpaper/1065376/nature-wallpapers + */ +class UnsplashNatureProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashNatureProvider( QObject *parent, const QVariantList &args ); + ~UnsplashNatureProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashnatureprovider.cpp b/dataengines/potd/unsplashnatureprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashnatureprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashnatureprovider.h" + +#include + +UnsplashNatureProvider::UnsplashNatureProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065376, parent, args) +{ +} + +UnsplashNatureProvider::~UnsplashNatureProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashNatureProvider, "unsplashnatureprovider.json") + +#include "unsplashnatureprovider.moc" diff --git a/dataengines/potd/unsplashnatureprovider.json b/dataengines/potd/unsplashnatureprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashnatureprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Nature Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Nature Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashnature" +} diff --git a/dataengines/potd/unsplashpeopleprovider.h b/dataengines/potd/unsplashpeopleprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashpeopleprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHPEOPLEPROVIDER_H +#define UNSPLASHPEOPLEPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash People Wallpapers Collection + * https://unsplash.com/wallpaper/1065386/people-wallpapers + */ +class UnsplashPeopleProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashPeopleProvider( QObject *parent, const QVariantList &args ); + ~UnsplashPeopleProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashpeopleprovider.cpp b/dataengines/potd/unsplashpeopleprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashpeopleprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashpeopleprovider.h" + +#include + +UnsplashPeopleProvider::UnsplashPeopleProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065386, parent, args) +{ +} + +UnsplashPeopleProvider::~UnsplashPeopleProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashPeopleProvider, "unsplashpeopleprovider.json") + +#include "unsplashpeopleprovider.moc" diff --git a/dataengines/potd/unsplashpeopleprovider.json b/dataengines/potd/unsplashpeopleprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashpeopleprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash People Wallpaper Provider", + "Icon": "", + "Name": "Unsplash People Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashpeople" +} diff --git a/dataengines/potd/unsplashprovider.h b/dataengines/potd/unsplashprovider.h --- a/dataengines/potd/unsplashprovider.h +++ b/dataengines/potd/unsplashprovider.h @@ -20,48 +20,18 @@ #ifndef UNSPLASHPROVIDER_H #define UNSPLASHPROVIDER_H -#include "potdprovider.h" -// Qt -#include - -class KJob; +#include "unsplashbaseprovider.h" /** - * This class provides random wallpapers from Unsplash Wallpapers - * Image urls are parsed from https://unsplash.com/wallpaper/1065396/desktop-wallpapers + * This class provides random wallpapers from Unsplash Desktop Wallpapers Collection + * https://unsplash.com/wallpaper/1065396/desktop-wallpapers */ -class UnsplashProvider : public PotdProvider +class UnsplashProvider : public UnsplashBaseProvider { Q_OBJECT - - public: - /** - * Creates a new Unsplash provider. - * - * @param parent The parent object. - * @param args The arguments. - */ - UnsplashProvider( QObject *parent, const QVariantList &args ); - - /** - * Destroys the Unsplash provider. - */ - ~UnsplashProvider() override; - - /** - * Returns the requested image. - * - * Note: This method returns only a valid image after the - * finished() signal has been emitted. - */ - QImage image() const override; - - private: - void pageRequestFinished(KJob *job); - void imageRequestFinished(KJob *job); - - private: - QImage mImage; +public: + UnsplashProvider( QObject *parent, const QVariantList &args ); + ~UnsplashProvider(); }; #endif diff --git a/dataengines/potd/unsplashprovider.cpp b/dataengines/potd/unsplashprovider.cpp --- a/dataengines/potd/unsplashprovider.cpp +++ b/dataengines/potd/unsplashprovider.cpp @@ -19,73 +19,15 @@ #include "unsplashprovider.h" -#include -#include - #include -#include UnsplashProvider::UnsplashProvider(QObject* parent, const QVariantList& args) - : PotdProvider(parent, args) -{ - const QUrl url(QStringLiteral("https://unsplash.com/wallpaper/1065396/desktop-wallpapers")); - - KIO::StoredTransferJob* job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo); - connect(job, &KIO::StoredTransferJob::finished, this, &UnsplashProvider::pageRequestFinished); -} - -UnsplashProvider::~UnsplashProvider() = default; - -QImage UnsplashProvider::image() const + : UnsplashBaseProvider(1065396, parent, args) { - return mImage; -} - -void UnsplashProvider::pageRequestFinished(KJob* _job) -{ - KIO::StoredTransferJob* job = static_cast(_job); - if (job->error()) { - emit error(this); - return; - } - - const QString html = QString::fromUtf8(job->data()); - - // "?ixlib" will filter out the banner image which rarely change... - QRegularExpression re(QStringLiteral("src=\"(https://images\\.unsplash\\.com/photo-\\w+-\\w+)\\?ixlib")); - - QRegularExpressionMatchIterator i = re.globalMatch(html); - - QStringList urls; - - while (i.hasNext()) { - QRegularExpressionMatch match = i.next(); - QString url = match.captured(1); - urls << url; - } - - if (urls.size() > 0) { - // Pick a ramdom photo because the wallpaper page doesn't update every day - QUrl picUrl(urls.at(rand() % urls.size())); // url to full size photo (compressed) - KIO::StoredTransferJob* imageJob = KIO::storedGet(picUrl, KIO::NoReload, KIO::HideProgressInfo); - connect(imageJob, &KIO::StoredTransferJob::finished, this, &UnsplashProvider::imageRequestFinished); - return; - } else { - emit error(this); - return; - } } -void UnsplashProvider::imageRequestFinished(KJob* _job) +UnsplashProvider::~UnsplashProvider() { - KIO::StoredTransferJob* job = static_cast(_job); - if (job->error()) { - emit error(this); - return; - } - QByteArray data = job->data(); - mImage = QImage::fromData(data); - emit finished(this); } K_PLUGIN_CLASS_WITH_JSON(UnsplashProvider, "unsplashprovider.json") diff --git a/dataengines/potd/unsplashsportsprovider.h b/dataengines/potd/unsplashsportsprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashsportsprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHSPORTSPROVIDER_H +#define UNSPLASHSPORTSPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Sports Wallpapers Collection + * https://unsplash.com/wallpaper/1065402/sports-wallpapers + */ +class UnsplashSportsProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashSportsProvider( QObject *parent, const QVariantList &args ); + ~UnsplashSportsProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashsportsprovider.cpp b/dataengines/potd/unsplashsportsprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashsportsprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashsportsprovider.h" + +#include + +UnsplashSportsProvider::UnsplashSportsProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065402, parent, args) +{ +} + +UnsplashSportsProvider::~UnsplashSportsProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashSportsProvider, "unsplashsportsprovider.json") + +#include "unsplashsportsprovider.moc" diff --git a/dataengines/potd/unsplashsportsprovider.json b/dataengines/potd/unsplashsportsprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashsportsprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Sports Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Sports Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashsports" +} diff --git a/dataengines/potd/unsplashsummerprovider.h b/dataengines/potd/unsplashsummerprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashsummerprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHSUMMERPROVIDER_H +#define UNSPLASHSUMMERPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Summer Wallpapers Collection + * https://unsplash.com/wallpaper/1065380/summer-wallpapers + */ +class UnsplashSummerProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashSummerProvider( QObject *parent, const QVariantList &args ); + ~UnsplashSummerProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashsummerprovider.cpp b/dataengines/potd/unsplashsummerprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashsummerprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashsummerprovider.h" + +#include + +UnsplashSummerProvider::UnsplashSummerProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065380, parent, args) +{ +} + +UnsplashSummerProvider::~UnsplashSummerProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashSummerProvider, "unsplashsummerprovider.json") + +#include "unsplashsummerprovider.moc" diff --git a/dataengines/potd/unsplashsummerprovider.json b/dataengines/potd/unsplashsummerprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashsummerprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Summer Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Summer Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashsummer" +} diff --git a/dataengines/potd/unsplashtravelprovider.h b/dataengines/potd/unsplashtravelprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashtravelprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHTRAVELPROVIDER_H +#define UNSPLASHTRAVELPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Travel Wallpapers Collection + * https://unsplash.com/wallpaper/1065428/travel-wallpapers + */ +class UnsplashTravelProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashTravelProvider( QObject *parent, const QVariantList &args ); + ~UnsplashTravelProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashtravelprovider.cpp b/dataengines/potd/unsplashtravelprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashtravelprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashtravelprovider.h" + +#include + +UnsplashTravelProvider::UnsplashTravelProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1065428, parent, args) +{ +} + +UnsplashTravelProvider::~UnsplashTravelProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashTravelProvider, "unsplashtravelprovider.json") + +#include "unsplashtravelprovider.moc" diff --git a/dataengines/potd/unsplashtravelprovider.json b/dataengines/potd/unsplashtravelprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashtravelprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Travel Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Travel Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashtravel" +} diff --git a/dataengines/potd/unsplashtumblrprovider.h b/dataengines/potd/unsplashtumblrprovider.h new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashtumblrprovider.h @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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. + */ + +#ifndef UNSPLASHTUMBLRPROVIDER_H +#define UNSPLASHTUMBLRPROVIDER_H + +#include "unsplashbaseprovider.h" + +/** + * This class provides random wallpapers from Unsplash Tumblr Wallpapers Collection + * https://unsplash.com/wallpaper/1111644/tumblr-wallpapers + */ +class UnsplashTumblrProvider : public UnsplashBaseProvider +{ + Q_OBJECT +public: + UnsplashTumblrProvider( QObject *parent, const QVariantList &args ); + ~UnsplashTumblrProvider(); +}; + +#endif diff --git a/dataengines/potd/unsplashtumblrprovider.cpp b/dataengines/potd/unsplashtumblrprovider.cpp new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashtumblrprovider.cpp @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Guo Yunhe + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 "unsplashtumblrprovider.h" + +#include + +UnsplashTumblrProvider::UnsplashTumblrProvider(QObject* parent, const QVariantList& args) + : UnsplashBaseProvider(1111644, parent, args) +{ +} + +UnsplashTumblrProvider::~UnsplashTumblrProvider() +{ +} + +K_PLUGIN_CLASS_WITH_JSON(UnsplashTumblrProvider, "unsplashtumblrprovider.json") + +#include "unsplashtumblrprovider.moc" diff --git a/dataengines/potd/unsplashtumblrprovider.json b/dataengines/potd/unsplashtumblrprovider.json new file mode 100644 --- /dev/null +++ b/dataengines/potd/unsplashtumblrprovider.json @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "Description": "Unsplash Tumblr Wallpaper Provider", + "Icon": "", + "Name": "Unsplash Tumblr Wallpapers", + "ServiceTypes": [ + "PlasmaPoTD/Plugin" + ] + }, + "X-KDE-PlasmaPoTDProvider-Identifier": "unsplashtumblr" +}