Verified Commit ed4131f9 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/potd: move providers to providers folder

parent a0b6c134
Pipeline #180692 passed with stage
in 2 minutes and 17 seconds
......@@ -77,31 +77,4 @@ install(EXPORT plasmapotdproviderTargets
COMPONENT Devel
)
########### plugins ###############
kcoreaddons_add_plugin(plasma_potd_flickrprovider SOURCES flickrprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_flickrprovider plasmapotdprovidercore KF5::KIOCore KF5::CoreAddons)
kcoreaddons_add_plugin(plasma_potd_apodprovider SOURCES apodprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_apodprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_natgeoprovider SOURCES natgeoprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_natgeoprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_epodprovider SOURCES epodprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_epodprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_noaaprovider SOURCES noaaprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_noaaprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_wcpotdprovider SOURCES wcpotdprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_wcpotdprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_bingprovider SOURCES bingprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_bingprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_unsplashprovider SOURCES unsplashprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_unsplashprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_simonstalenhagprovider SOURCES simonstalenhagprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries( plasma_potd_simonstalenhagprovider plasmapotdprovidercore KF5::KIOCore)
add_subdirectory(providers)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..)
kcoreaddons_add_plugin(plasma_potd_flickrprovider SOURCES flickrprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_flickrprovider plasmapotdprovidercore KF5::KIOCore KF5::CoreAddons)
kcoreaddons_add_plugin(plasma_potd_apodprovider SOURCES apodprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_apodprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_natgeoprovider SOURCES natgeoprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_natgeoprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_epodprovider SOURCES epodprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_epodprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_noaaprovider SOURCES noaaprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_noaaprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_wcpotdprovider SOURCES wcpotdprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_wcpotdprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_bingprovider SOURCES bingprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_bingprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_unsplashprovider SOURCES unsplashprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_unsplashprovider plasmapotdprovidercore KF5::KIOCore)
kcoreaddons_add_plugin(plasma_potd_simonstalenhagprovider SOURCES simonstalenhagprovider.cpp INSTALL_NAMESPACE "potd")
target_link_libraries(plasma_potd_simonstalenhagprovider plasmapotdprovidercore KF5::KIOCore)
......@@ -34,7 +34,9 @@ void NatGeoProvider::pageRequestFinished(KJob *_job)
const QString data = QString::fromUtf8(job->data());
const QStringList lines = data.split(QLatin1Char('\n'));
// clang-format off
re.setPattern(QStringLiteral("<meta\\s+(?:\\S+=[\"']?(?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.[\"']?\\s*)*property=\"og:image\"\\s*(?:\\S+=[\"']?(?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.[\"']?\\s*)*content=[\"']?((?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.)[\"']?\\s*(?:\\S+=[\"']?(?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.[\"']?\\s*)*/>"));
// clang-format on
for (int i = 0; i < lines.size(); i++) {
QRegularExpressionMatch match = re.match(lines.at(i));
......@@ -50,10 +52,11 @@ void NatGeoProvider::pageRequestFinished(KJob *_job)
const QString simplifiedData(data.simplified());
/**
/* clang-format off
* Match link
* Example:
* <meta data-react-helmet="true" property="og:url" content="https://www.nationalgeographic.com/photo-of-the-day/media-spotlight/wanapum-horse-oregon-native-american"/>
* clang-format on
*/
const QRegularExpression linkRegEx(QStringLiteral("<meta.*?property=\"og:url\" content=\"(.+?)\".*?>"));
const QRegularExpressionMatch linkMatch = linkRegEx.match(simplifiedData);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment