Use TDE data source for new stuff

pull/1/head
Slávek Banko 10 years ago
parent b78d37d1dd
commit 4efcfec98c

@ -18,10 +18,10 @@
#include <tdeapplication.h> #include <tdeapplication.h>
#include <tdefiledialog.h> #include <tdefiledialog.h>
#include <tdemessagebox.h> #include <tdemessagebox.h>
#include <knewstuff/downloaddialog.h> // knewstuff theme fetching #include <tdenewstuff/downloaddialog.h> // tdenewstuff theme fetching
#include <knewstuff/engine.h> // " #include <tdenewstuff/engine.h> // "
#include <knewstuff/knewstuff.h> // " #include <tdenewstuff/knewstuff.h> // "
#include <knewstuff/provider.h> // " #include <tdenewstuff/provider.h> // "
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <ktar.h> #include <ktar.h>
#include <tdeio/netaccess.h> #include <tdeio/netaccess.h>
@ -38,11 +38,11 @@
/** /**
* GHNS Customised Download implementation. * GHNS Customised Download implementation.
*/ */
class AmarokThemeNewStuff : public KNewStuff class AmarokThemeNewStuff : public TDENewStuff
{ {
public: public:
AmarokThemeNewStuff(const TQString &type, TQWidget *parentWidget=0) AmarokThemeNewStuff(const TQString &type, TQWidget *parentWidget=0)
: KNewStuff( type, parentWidget ) : TDENewStuff( type, parentWidget )
{} {}
bool install( const TQString& fileName ) bool install( const TQString& fileName )
@ -105,12 +105,12 @@ void Options2::installPushButton_clicked()
void Options2::retrievePushButton_clicked() void Options2::retrievePushButton_clicked()
{ {
// Delete KNewStuff's configuration entries. These entries reflect which styles // Delete TDENewStuff's configuration entries. These entries reflect which styles
// are already installed. As we cannot yet keep them in sync after uninstalling // are already installed. As we cannot yet keep them in sync after uninstalling
// styles, we deactivate the check marks entirely. // styles, we deactivate the check marks entirely.
Amarok::config()->deleteGroup( "KNewStuffStatus" ); Amarok::config()->deleteGroup( "TDENewStuffStatus" );
// we need this because KNewStuffGeneric's install function isn't clever enough // we need this because TDENewStuffGeneric's install function isn't clever enough
AmarokThemeNewStuff *kns = new AmarokThemeNewStuff( "amarok/themes", this ); AmarokThemeNewStuff *kns = new AmarokThemeNewStuff( "amarok/themes", this );
KNS::Engine *engine = new KNS::Engine( kns, "amarok/theme", this ); KNS::Engine *engine = new KNS::Engine( kns, "amarok/theme", this );
KNS::DownloadDialog* d = new KNS::DownloadDialog( engine, this ); KNS::DownloadDialog* d = new KNS::DownloadDialog( engine, this );
@ -118,7 +118,7 @@ void Options2::retrievePushButton_clicked()
// you have to do this by hand when providing your own Engine // you have to do this by hand when providing your own Engine
KNS::ProviderLoader *p = new KNS::ProviderLoader( this ); KNS::ProviderLoader *p = new KNS::ProviderLoader( this );
connect( p, TQT_SIGNAL( providersLoaded(Provider::List*) ), d, TQT_SLOT( slotProviders(Provider::List *) ) ); connect( p, TQT_SIGNAL( providersLoaded(Provider::List*) ), d, TQT_SLOT( slotProviders(Provider::List *) ) );
p->load( "amarok/theme", "http://amarok.kde.org/knewstuff/amarokthemes-providers.xml" ); p->load( "amarok theme", "https://www.trinitydesktop.org/ocs/providers.xml" );
connect( d, TQT_SIGNAL( finished() ), d, TQT_SLOT( delayedDestruct() ) ); connect( d, TQT_SIGNAL( finished() ), d, TQT_SLOT( delayedDestruct() ) );
connect( d, TQT_SIGNAL( finished() ), this, TQT_SLOT( updateStyleComboBox() ) ); connect( d, TQT_SIGNAL( finished() ), this, TQT_SLOT( updateStyleComboBox() ) );

@ -8,7 +8,7 @@ CurrentPane=ContextBrowser
#see PlaylistWidget::setColumnWidth() for explanation for below #see PlaylistWidget::setColumnWidth() for explanation for below
ColumnWidths=0,200,100,100,0,0,0,0,0,80,0 ColumnWidths=0,200,100,100,0,0,0,0,0,80,0
[KNewStuff] [TDENewStuff]
TargetDir=amarok/themes TargetDir=amarok/themes
Uncompress=application/x-gzip Uncompress=application/x-gzip
ProvidersUrl=http://amarok.kde.org/knewstuff/amarokthemes-providers.xml ProvidersUrl=https://www.trinitydesktop.org/ocs/providers.xml

@ -61,10 +61,10 @@
#include <ktextedit.h> #include <ktextedit.h>
#include <twin.h> #include <twin.h>
#include <knewstuff/downloaddialog.h> // knewstuff script fetching #include <tdenewstuff/downloaddialog.h> // tdenewstuff script fetching
#include <knewstuff/engine.h> // " #include <tdenewstuff/engine.h> // "
#include <knewstuff/knewstuff.h> // " #include <tdenewstuff/knewstuff.h> // "
#include <knewstuff/provider.h> // " #include <tdenewstuff/provider.h> // "
namespace Amarok { namespace Amarok {
@ -111,11 +111,11 @@ namespace Amarok {
/** /**
* GHNS Customised Download implementation. * GHNS Customised Download implementation.
*/ */
class AmarokScriptNewStuff : public KNewStuff class AmarokScriptNewStuff : public TDENewStuff
{ {
public: public:
AmarokScriptNewStuff(const TQString &type, TQWidget *parentWidget=0) AmarokScriptNewStuff(const TQString &type, TQWidget *parentWidget=0)
: KNewStuff( type, parentWidget ) : TDENewStuff( type, parentWidget )
{} {}
bool install( const TQString& fileName ) bool install( const TQString& fileName )
@ -488,12 +488,12 @@ ScriptManager::recurseInstall( const KArchiveDirectory* archiveDir, const TQStri
void void
ScriptManager::slotRetrieveScript() ScriptManager::slotRetrieveScript()
{ {
// Delete KNewStuff's configuration entries. These entries reflect which scripts // Delete TDENewStuff's configuration entries. These entries reflect which scripts
// are already installed. As we cannot yet keep them in sync after uninstalling // are already installed. As we cannot yet keep them in sync after uninstalling
// scripts, we deactivate the check marks entirely. // scripts, we deactivate the check marks entirely.
Amarok::config()->deleteGroup( "KNewStuffStatus" ); Amarok::config()->deleteGroup( "TDENewStuffStatus" );
// we need this because KNewStuffGeneric's install function isn't clever enough // we need this because TDENewStuffGeneric's install function isn't clever enough
AmarokScriptNewStuff *kns = new AmarokScriptNewStuff( "amarok/script", this ); AmarokScriptNewStuff *kns = new AmarokScriptNewStuff( "amarok/script", this );
KNS::Engine *engine = new KNS::Engine( kns, "amarok/script", this ); KNS::Engine *engine = new KNS::Engine( kns, "amarok/script", this );
KNS::DownloadDialog *d = new KNS::DownloadDialog( engine, this ); KNS::DownloadDialog *d = new KNS::DownloadDialog( engine, this );
@ -501,7 +501,7 @@ ScriptManager::slotRetrieveScript()
// you have to do this by hand when providing your own Engine // you have to do this by hand when providing your own Engine
KNS::ProviderLoader *p = new KNS::ProviderLoader( this ); KNS::ProviderLoader *p = new KNS::ProviderLoader( this );
TQObject::connect( p, TQT_SIGNAL( providersLoaded(Provider::List*) ), d, TQT_SLOT( slotProviders (Provider::List *) ) ); TQObject::connect( p, TQT_SIGNAL( providersLoaded(Provider::List*) ), d, TQT_SLOT( slotProviders (Provider::List *) ) );
p->load( "amarok/script", "http://amarok.kde.org/knewstuff/amarokscripts-providers.xml" ); p->load( "amarok script", "https://www.trinitydesktop.org/ocs/providers.xml" );
d->exec(); d->exec();
} }

Loading…
Cancel
Save