mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +00:00
kdeplasma-addons: drop epod POTD provider
I fixed once, fixed it second time but now all queries that are not made from web browser (including attempt to download via curl) fail with access denied. bye then! Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
44a2ab9c9f
commit
4aee6e6fa6
4 changed files with 52 additions and 296 deletions
|
@ -3,12 +3,21 @@ set(potd_engine_SRCS
|
|||
potd.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin(plasma_engine_potd ${potd_engine_SRCS} )
|
||||
target_link_libraries(plasma_engine_potd plasmapotdprovidercore KDE4::kdeui KDE4::plasma )
|
||||
|
||||
install(TARGETS plasma_engine_potd DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
|
||||
install(FILES plasma-dataengine-potd.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
|
||||
kde4_add_plugin(plasma_engine_potd ${potd_engine_SRCS})
|
||||
target_link_libraries(plasma_engine_potd
|
||||
KDE4::kdeui
|
||||
KDE4::plasma
|
||||
plasmapotdprovidercore
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS plasma_engine_potd
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
install(
|
||||
FILES plasma-dataengine-potd.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
########### plugin core library ############
|
||||
|
||||
|
@ -21,9 +30,14 @@ target_link_libraries(plasmapotdprovidercore KDE4::kdeui)
|
|||
|
||||
generate_export_header(plasmapotdprovidercore BASE_NAME plasma_potd)
|
||||
|
||||
install( TARGETS plasmapotdprovidercore DESTINATION ${KDE4_LIB_INSTALL_DIR})
|
||||
install( FILES plasma_potdprovider.desktop DESTINATION ${KDE4_SERVICETYPES_INSTALL_DIR} )
|
||||
|
||||
install(
|
||||
TARGETS plasmapotdprovidercore
|
||||
DESTINATION ${KDE4_LIB_INSTALL_DIR}
|
||||
)
|
||||
install(
|
||||
FILES plasma_potdprovider.desktop
|
||||
DESTINATION ${KDE4_SERVICETYPES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
########### plugins ###############
|
||||
|
||||
|
@ -31,26 +45,39 @@ set( potd_flickr_provider_SRCS
|
|||
flickrprovider.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin( plasma_potd_flickrprovider ${potd_flickr_provider_SRCS} )
|
||||
target_link_libraries( plasma_potd_flickrprovider plasmapotdprovidercore KDE4::kio KDE4::kdecore ${QT_QTGUI_LIBRARY})
|
||||
install( TARGETS plasma_potd_flickrprovider DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
|
||||
install( FILES flickrprovider.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
|
||||
kde4_add_plugin(plasma_potd_flickrprovider ${potd_flickr_provider_SRCS})
|
||||
target_link_libraries(plasma_potd_flickrprovider
|
||||
KDE4::kio
|
||||
KDE4::kdecore
|
||||
${QT_QTGUI_LIBRARY}
|
||||
plasmapotdprovidercore
|
||||
)
|
||||
install(
|
||||
TARGETS plasma_potd_flickrprovider
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
install(
|
||||
FILES flickrprovider.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
||||
set( potd_apod_provider_SRCS
|
||||
set(potd_apod_provider_SRCS
|
||||
apodprovider.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin( plasma_potd_apodprovider ${potd_apod_provider_SRCS} )
|
||||
target_link_libraries( plasma_potd_apodprovider plasmapotdprovidercore KDE4::kio ${QT_QTGUI_LIBRARY} KDE4::kdecore)
|
||||
install( TARGETS plasma_potd_apodprovider DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
|
||||
install( FILES apodprovider.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
|
||||
|
||||
set( potd_epod_provider_SRCS
|
||||
epodprovider.cpp
|
||||
kde4_add_plugin(plasma_potd_apodprovider ${potd_apod_provider_SRCS})
|
||||
target_link_libraries(plasma_potd_apodprovider
|
||||
KDE4::kio
|
||||
KDE4::kdecore
|
||||
${QT_QTGUI_LIBRARY}
|
||||
plasmapotdprovidercore
|
||||
)
|
||||
install(
|
||||
TARGETS plasma_potd_apodprovider
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
install(
|
||||
FILES apodprovider.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
kde4_add_plugin( plasma_potd_epodprovider ${potd_epod_provider_SRCS} )
|
||||
target_link_libraries( plasma_potd_epodprovider plasmapotdprovidercore KDE4::kio KDE4::kdecore ${QT_QTGUI_LIBRARY})
|
||||
install( TARGETS plasma_potd_epodprovider DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
|
||||
install( FILES epodprovider.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2007 Tobias Koenig <tokoe@kde.org>
|
||||
* Copyright 2008 by Anne-Marie Mahfouf <annma@kde.org>
|
||||
*
|
||||
* 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 "epodprovider.h"
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtGui/QImage>
|
||||
|
||||
#include <KDebug>
|
||||
#include <kio/job.h>
|
||||
|
||||
POTDPROVIDER_EXPORT_PLUGIN(EpodProvider, "EpodProvider", "")
|
||||
|
||||
class EpodProvider::Private
|
||||
{
|
||||
public:
|
||||
Private(EpodProvider *parent)
|
||||
: mParent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void pageRequestFinished(KJob*);
|
||||
void imageRequestFinished(KJob*);
|
||||
void parsePage();
|
||||
|
||||
EpodProvider *mParent;
|
||||
QImage mImage;
|
||||
};
|
||||
|
||||
void EpodProvider::Private::pageRequestFinished(KJob *_job)
|
||||
{
|
||||
KIO::StoredTransferJob *job = static_cast<KIO::StoredTransferJob*>(_job);
|
||||
if (job->error()) {
|
||||
emit mParent->error(mParent);
|
||||
return;
|
||||
}
|
||||
|
||||
const QByteArray jobdata = job->data();
|
||||
const QString data = QString::fromUtf8(jobdata.constData(), jobdata.size());
|
||||
|
||||
const QString pattern( QLatin1String("https://epod.usra.edu/.a/*-pi"));
|
||||
QRegExp exp( pattern );
|
||||
exp.setPatternSyntax(QRegExp::Wildcard);
|
||||
|
||||
int pos = exp.indexIn( data ) + pattern.length();
|
||||
const QString sub = data.mid(pos - 4, pattern.length() + 5);
|
||||
KUrl url(QString::fromLatin1("https://epod.usra.edu/.a/%1-pi").arg(sub));
|
||||
kDebug() << "url" << url.prettyUrl();
|
||||
KIO::StoredTransferJob *imageJob = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo );
|
||||
QObject::connect(imageJob, SIGNAL(finished(KJob*)), mParent, SLOT(imageRequestFinished(KJob*)) );
|
||||
}
|
||||
|
||||
void EpodProvider::Private::imageRequestFinished( KJob *_job)
|
||||
{
|
||||
KIO::StoredTransferJob *job = static_cast<KIO::StoredTransferJob*>(_job);
|
||||
if (job->error()) {
|
||||
emit mParent->error(mParent);
|
||||
return;
|
||||
}
|
||||
|
||||
mImage = QImage::fromData(job->data());
|
||||
emit mParent->finished(mParent);
|
||||
}
|
||||
|
||||
EpodProvider::EpodProvider(QObject *parent, const QVariantList &args)
|
||||
: PotdProvider(parent, args),
|
||||
d(new Private(this))
|
||||
{
|
||||
KUrl url(QLatin1String("https://epod.usra.edu/blog/"));
|
||||
KIO::StoredTransferJob *job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo);
|
||||
|
||||
connect(job, SIGNAL(finished(KJob*)), SLOT(pageRequestFinished(KJob*)));
|
||||
}
|
||||
|
||||
EpodProvider::~EpodProvider()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
QImage EpodProvider::image() const
|
||||
{
|
||||
return d->mImage;
|
||||
}
|
||||
|
||||
#include "moc_epodprovider.cpp"
|
|
@ -1,104 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
X-KDE-ServiceTypes=PlasmaPoTD/Plugin
|
||||
X-KDE-Library=plasma_potd_epodprovider
|
||||
X-KDE-PlasmaPoTDProvider-Identifier=epod
|
||||
Icon=
|
||||
|
||||
Name=Earth Science Picture of the Day
|
||||
Name[ar]=صورة علم الأرض اليومية
|
||||
Name[bs]=Geonaučna slika dana
|
||||
Name[ca]=Imatge de ciències terràqüies del dia
|
||||
Name[ca@valencia]=Imatge de ciències terràqüies del dia
|
||||
Name[cs]=Obrázek dne z Earth Science
|
||||
Name[da]=Dagens geovidenskabsbillede
|
||||
Name[de]=Bild des Tages der Geowissenschaften
|
||||
Name[el]=Earth Science φωτογραφία της ημέρας
|
||||
Name[en_GB]=Earth Science Picture of the Day
|
||||
Name[es]=Imagen de ciencias de la Tierra del día
|
||||
Name[et]=Maateaduse päevapilt
|
||||
Name[fi]=Päivän geotiedekuva
|
||||
Name[fr]=Image du jour des sciences de la terre
|
||||
Name[ga]=Grianghraf Domhaneolaíochta an Lae
|
||||
Name[gl]=Imaxe do día sobre as ciencias da terra
|
||||
Name[hr]=Slika dana na Earth Science
|
||||
Name[hu]=A nap képe az Earth Science-en
|
||||
Name[it]=Earth Science Picture of the Day
|
||||
Name[ja]=今日の地学写真
|
||||
Name[kk]=Жер ғылым "Тәулік суреті" (Epod)
|
||||
Name[km]=រូបភាពប្រចាំថ្ងៃ Earth Science
|
||||
Name[ko]=오늘의 지구과학 사진
|
||||
Name[lv]=Zemes zinātņu dienas attēls
|
||||
Name[mr]=पृथ्वी शास्त्र दिवसाचे चित्र
|
||||
Name[nb]=Dagens geovitenskapelige bilde
|
||||
Name[nds]=Eerdwetenschappen-Bild för Vundaag
|
||||
Name[nl]=Geologische afbeelding van de dag
|
||||
Name[nn]=Dagens geovitskap-bilete
|
||||
Name[pa]=ਅੱਜ ਦੀ ਧਰਤੀ ਵਿਗਿਆਨ ਤਸਵੀਰ
|
||||
Name[pl]=Naukowy obraz dnia
|
||||
Name[pt]=Imagem do Dia nas Ciências Terrestres
|
||||
Name[pt_BR]=Imagem do dia da Ciência na Terra
|
||||
Name[ro]=Imaginea zilei din științele naturii
|
||||
Name[ru]=Природоведение: Изображение Дня
|
||||
Name[sk]=Obrázok dňa z Vedy o zemi
|
||||
Name[sl]=Slika dneva z Earth Science
|
||||
Name[sr]=геонаучна слика дана
|
||||
Name[sr@ijekavian]=геонаучна слика дана
|
||||
Name[sr@ijekavianlatin]=geonaučna slika dana
|
||||
Name[sr@latin]=geonaučna slika dana
|
||||
Name[sv]=Dagens geovetenskapliga bild
|
||||
Name[th]=ภาพวิทยาศาสตร์ของโลกประจำวัน
|
||||
Name[tr]=Günün Dünya Bilimi Fotoğrafı
|
||||
Name[uk]=Зображення дня Earth Science
|
||||
Name[x-test]=xxEarth Science Picture of the Dayxx
|
||||
Name[zh_CN]=每日一图(地球科学)
|
||||
Name[zh_TW]=本日地球科學圖片
|
||||
Comment=Epod Provider
|
||||
Comment[ar]=المزود Epod
|
||||
Comment[ast]=Fornidor d'Epod
|
||||
Comment[bs]=Dobavljač Epod-a
|
||||
Comment[ca]=Proveïdor Epod
|
||||
Comment[ca@valencia]=Proveïdor Epod
|
||||
Comment[cs]=Poskytovatel Epodu
|
||||
Comment[da]=Epod-udbyder.
|
||||
Comment[de]=Epod-Anbieter
|
||||
Comment[el]=Πάροχος Epod
|
||||
Comment[en_GB]=Epod Provider
|
||||
Comment[es]=Proveedor de Epod
|
||||
Comment[et]=Epodi pakkuja
|
||||
Comment[fi]=Epod-tarjoaja
|
||||
Comment[fr]=Fournisseur « EPOD »
|
||||
Comment[ga]=Soláthraí Epod
|
||||
Comment[gl]=Fornecedor de Epod
|
||||
Comment[hr]=Pružatelj Epoda
|
||||
Comment[hu]=Epod-szolgáltató
|
||||
Comment[is]=Epod þjónusta
|
||||
Comment[it]=Fornitore Epod
|
||||
Comment[ja]=Epod のプロバイダ
|
||||
Comment[kk]=Epod таратушысы
|
||||
Comment[km]=ក្រុមហ៊ុនផ្ដល់ Epod
|
||||
Comment[ko]=지구과학 사진 공급자
|
||||
Comment[lt]=Epod tiekėjas
|
||||
Comment[lv]=Epod piegādātājs
|
||||
Comment[mr]=इपोड पुरविठाकर्ता
|
||||
Comment[nb]=Epod-leverandør
|
||||
Comment[nds]=EBifV-Anbeder
|
||||
Comment[nl]=Epod-provider
|
||||
Comment[nn]=Epod-tilbydar
|
||||
Comment[pl]=Usługodawca Epod
|
||||
Comment[pt]=Fornecedor do Epod
|
||||
Comment[pt_BR]=Fornecedor Epod
|
||||
Comment[ro]=Furnizor Epod
|
||||
Comment[ru]=Источник данных Epod
|
||||
Comment[sk]=Poskytovateľ Epod
|
||||
Comment[sl]=Ponudnik Epod
|
||||
Comment[sr]=Добављач ЕПОД‑а
|
||||
Comment[sr@ijekavian]=Добављач ЕПОД‑а
|
||||
Comment[sr@ijekavianlatin]=Dobavljač EPOD‑a
|
||||
Comment[sr@latin]=Dobavljač EPOD‑a
|
||||
Comment[sv]=Tillhandahåll från Epod
|
||||
Comment[tr]=Epod Sağlayıcı
|
||||
Comment[uk]=Постачальник даних Epod
|
||||
Comment[x-test]=xxEpod Providerxx
|
||||
Comment[zh_CN]=Epod 提供方
|
||||
Comment[zh_TW]=Epod 提供者
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2007 Tobias Koenig <tokoe@kde.org>
|
||||
* Copyright 2008 by Anne-Marie Mahfouf <annma@kde.org>
|
||||
*
|
||||
* 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 EPODPROVIDER_H
|
||||
#define EPODPROVIDER_H
|
||||
|
||||
#include "potdprovider.h"
|
||||
|
||||
/**
|
||||
* This class provides the image for EPOD
|
||||
* "Earth Science Picture Of the Day"
|
||||
* located at http://epod.usra.edu/.
|
||||
*/
|
||||
class EpodProvider : public PotdProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a new EPOD provider.
|
||||
*
|
||||
* @param date The date for which the image shall be fetched.
|
||||
* @param parent The parent object.
|
||||
*/
|
||||
EpodProvider( QObject *parent, const QVariantList &args );
|
||||
|
||||
/**
|
||||
* Destroys the EPOD provider.
|
||||
*/
|
||||
~EpodProvider();
|
||||
|
||||
/**
|
||||
* Returns the requested image.
|
||||
*
|
||||
* Note: This method returns only a valid image after the
|
||||
* finished() signal has been emitted.
|
||||
*/
|
||||
virtual QImage image() const;
|
||||
|
||||
private:
|
||||
class Private;
|
||||
Private* const d;
|
||||
|
||||
Q_PRIVATE_SLOT( d, void pageRequestFinished( KJob* ) )
|
||||
Q_PRIVATE_SLOT( d, void imageRequestFinished( KJob* ) )
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue