From e38d2351b83fa65c66ccde443777647ef5cb6cff Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 1 Mar 2010 19:17:32 +0000 Subject: Added KDE3 version of Tellico git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1097620 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/newstuff/providerloader.h | 84 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/newstuff/providerloader.h (limited to 'src/newstuff/providerloader.h') diff --git a/src/newstuff/providerloader.h b/src/newstuff/providerloader.h new file mode 100644 index 0000000..3d2968c --- /dev/null +++ b/src/newstuff/providerloader.h @@ -0,0 +1,84 @@ +/*************************************************************************** + copyright : (C) 2006 by Robby Stephenson + email : robby@periapsis.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of version 2 of the GNU General Public License as * + * published by the Free Software Foundation; * + * * + ***************************************************************************/ + +// this class is largely copied from kdelibs/knewstuff/provider.h +// which is Copyright (c) 2002 Cornelius Schumacher +// and licensed under GPL v2, just like Tellico +// +// I want progress info for the download, and this was the +// easiest way to get it + +#ifndef TELLICO_NEWSTUFF_PROVIDERLOADER_H +#define TELLICO_NEWSTUFF_PROVIDERLOADER_H + +#include +#include + +namespace KIO { + class Job; +} +namespace KNS { + class Provider; +} + +namespace Tellico { + namespace NewStuff { + +class ProviderLoader : public QObject { +Q_OBJECT +public: + /** + * Constructor. + * + * @param parentWidget the parent widget + */ + ProviderLoader( QWidget *parentWidget ); + + /** + * Starts asynchronously loading the list of providers of the + * specified type. + * + * @param type data type such as 'kdesktop/wallpaper'. + * @param providerList the URl to the list of providers; if empty + * we first try the ProvidersUrl from KGlobal::config, then we + * fall back to a hardcoded value. + */ + void load( const QString &type, const QString &providerList = QString::null ); + + void setAlternativeProvider(const QString& alt) { mAltProvider = alt; } + + signals: + /** + * Indicates that the list of providers has been successfully loaded. + */ + void providersLoaded( QPtrList* ); + void percent(KIO::Job *job, unsigned long percent); + void error(); + + protected slots: + void slotJobData( KIO::Job *, const QByteArray & ); + void slotJobResult( KIO::Job * ); + + private: + QWidget *mParentWidget; + + QString mJobData; + + QPtrList mProviders; + QString mAltProvider; + bool mTryAlt; +}; + + } +} +#endif -- cgit v1.2.1