Update for recent TDENewStuff changes

pull/1/head
Slávek Banko 10 years ago
parent 683b668876
commit e4b4d01f65

@ -2087,7 +2087,7 @@ if test $kde_qtver = 3; then
AC_SUBST(LIB_TDEUTILS, "-ltdeutils") AC_SUBST(LIB_TDEUTILS, "-ltdeutils")
AC_SUBST(LIB_TDEPIM, "-ltdepim") AC_SUBST(LIB_TDEPIM, "-ltdepim")
AC_SUBST(LIB_TDEIMPROXY, "-ltdeimproxy") AC_SUBST(LIB_TDEIMPROXY, "-ltdeimproxy")
AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff") AC_SUBST(LIB_TDENEWSTUFF, "-ltdenewstuff")
AC_SUBST(LIB_TDEDNSSD, "-ltdednssd") AC_SUBST(LIB_TDEDNSSD, "-ltdednssd")
AC_SUBST(LIB_TDEUNITTEST, "-ltdeunittest") AC_SUBST(LIB_TDEUNITTEST, "-ltdeunittest")
# these are for backward compatibility # these are for backward compatibility

@ -26,8 +26,8 @@
#include <tdeio/job.h> #include <tdeio/job.h>
#include <tdeio/netaccess.h> #include <tdeio/netaccess.h>
#include <tdeaccelmanager.h> #include <tdeaccelmanager.h>
#include <knewstuff/entry.h> #include <tdenewstuff/entry.h>
#include <knewstuff/provider.h> #include <tdenewstuff/provider.h>
#include <tdetempfile.h> #include <tdetempfile.h>
#include <tqlabel.h> #include <tqlabel.h>
@ -228,21 +228,15 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_)
connect(loader, TQT_SIGNAL(percent(TDEIO::Job*, unsigned long)), TQT_SLOT(slotShowPercent(TDEIO::Job*, unsigned long))); connect(loader, TQT_SIGNAL(percent(TDEIO::Job*, unsigned long)), TQT_SLOT(slotShowPercent(TDEIO::Job*, unsigned long)));
connect(loader, TQT_SIGNAL(error()), TQT_SLOT(slotProviderError())); connect(loader, TQT_SIGNAL(error()), TQT_SLOT(slotProviderError()));
TDEConfigGroup config(TDEGlobal::config(), "KNewStuff"); TDEConfigGroup config(TDEGlobal::config(), "TDENewStuff");
TQString prov = config.readEntry("ProvidersUrl"); TQString prov = config.readEntry("ProvidersUrl");
if(prov.isEmpty()) { if(prov.isEmpty()) {
if(m_type == EntryTemplate) { prov = TQString::fromLatin1("https://www.trinitydesktop.org/ocs/providers.xml");
prov = TQString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php");
TQString alt = TQString::fromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml");
loader->setAlternativeProvider(alt);
} else {
prov = TQString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php");
}
} }
if(m_type == EntryTemplate) { if(m_type == EntryTemplate) {
m_typeName = TQString::fromLatin1("tellico/entry-template"); m_typeName = TQString::fromLatin1("tellico template");
} else { } else {
m_typeName = TQString::fromLatin1("tellico/data-source"); m_typeName = TQString::fromLatin1("tellico script");
} }
loader->load(m_typeName, prov); loader->load(m_typeName, prov);
@ -301,9 +295,9 @@ void Dialog::slotResult(TDEIO::Job* job_) {
return; return;
} }
TQDomElement knewstuff = dom.documentElement(); TQDomElement tdenewstuff = dom.documentElement();
for(TQDomNode pn = knewstuff.firstChild(); !pn.isNull(); pn = pn.nextSibling()) { for(TQDomNode pn = tdenewstuff.firstChild(); !pn.isNull(); pn = pn.nextSibling()) {
TQDomElement stuff = pn.toElement(); TQDomElement stuff = pn.toElement();
if(stuff.isNull()) { if(stuff.isNull()) {
continue; continue;

@ -28,7 +28,7 @@
#include <tdeio/job.h> #include <tdeio/job.h>
#include <tdefileitem.h> #include <tdefileitem.h>
#include <tdeversion.h> #include <tdeversion.h>
#include <knewstuff/entry.h> #include <tdenewstuff/entry.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <tqfileinfo.h> #include <tqfileinfo.h>
@ -94,7 +94,7 @@ bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) {
} else { } else {
// remove ".xsl" // remove ".xsl"
xslFile.truncate(xslFile.length()-4); xslFile.truncate(xslFile.length()-4);
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffFiles"); TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffFiles");
config.writeEntry(xslFile, allFiles); config.writeEntry(xslFile, allFiles);
m_urlNameMap.insert(url_, xslFile); m_urlNameMap.insert(url_, xslFile);
} }
@ -106,7 +106,7 @@ bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) {
} }
bool Manager::removeTemplate(const TQString& name_) { bool Manager::removeTemplate(const TQString& name_) {
TDEConfigGroup fileGroup(TDEGlobal::config(), "KNewStuffFiles"); TDEConfigGroup fileGroup(TDEGlobal::config(), "TDENewStuffFiles");
TQStringList files = fileGroup.readListEntry(name_); TQStringList files = fileGroup.readListEntry(name_);
// at least, delete xsl file // at least, delete xsl file
if(files.isEmpty()) { if(files.isEmpty()) {
@ -130,7 +130,7 @@ bool Manager::removeTemplate(const TQString& name_) {
// remove config entries even if unsuccessful // remove config entries even if unsuccessful
fileGroup.deleteEntry(name_); fileGroup.deleteEntry(name_);
TDEConfigGroup statusGroup(TDEGlobal::config(), "KNewStuffStatus"); TDEConfigGroup statusGroup(TDEGlobal::config(), "TDENewStuffStatus");
TQString entryName = statusGroup.readEntry(name_); TQString entryName = statusGroup.readEntry(name_);
statusGroup.deleteEntry(name_); statusGroup.deleteEntry(name_);
statusGroup.deleteEntry(entryName); statusGroup.deleteEntry(entryName);
@ -209,7 +209,7 @@ bool Manager::installScript(const KURL& url_) {
} }
{ {
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffFiles"); TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffFiles");
config.writeEntry(info->sourceName, archiveFiles(archiveDir)); config.writeEntry(info->sourceName, archiveFiles(archiveDir));
m_urlNameMap.insert(url_, info->sourceName); m_urlNameMap.insert(url_, info->sourceName);
} }
@ -225,7 +225,7 @@ bool Manager::installScript(const KURL& url_) {
} }
bool Manager::removeScript(const TQString& name_) { bool Manager::removeScript(const TQString& name_) {
TDEConfigGroup fileGroup(TDEGlobal::config(), "KNewStuffFiles"); TDEConfigGroup fileGroup(TDEGlobal::config(), "TDENewStuffFiles");
TQStringList files = fileGroup.readListEntry(name_); TQStringList files = fileGroup.readListEntry(name_);
bool success = true; bool success = true;
@ -244,7 +244,7 @@ bool Manager::removeScript(const TQString& name_) {
// remove config entries even if unsuccessful // remove config entries even if unsuccessful
fileGroup.deleteEntry(name_); fileGroup.deleteEntry(name_);
TDEConfigGroup statusGroup(TDEGlobal::config(), "KNewStuffStatus"); TDEConfigGroup statusGroup(TDEGlobal::config(), "TDENewStuffStatus");
TQString entryName = statusGroup.readEntry(name_); TQString entryName = statusGroup.readEntry(name_);
statusGroup.deleteEntry(name_); statusGroup.deleteEntry(name_);
statusGroup.deleteEntry(entryName); statusGroup.deleteEntry(entryName);
@ -253,7 +253,7 @@ bool Manager::removeScript(const TQString& name_) {
} }
Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) { Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) {
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffStatus"); TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffStatus");
TQString datestring = config.readEntry(entry_->name()); TQString datestring = config.readEntry(entry_->name());
if(datestring.isEmpty()) { if(datestring.isEmpty()) {
return NotInstalled; return NotInstalled;
@ -268,7 +268,7 @@ Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) {
} }
// also check that executable files exists // also check that executable files exists
TDEConfigGroup fileGroup(TDEGlobal::config(), "KNewStuffFiles"); TDEConfigGroup fileGroup(TDEGlobal::config(), "TDENewStuffFiles");
TQStringList files = fileGroup.readListEntry(entry_->name()); TQStringList files = fileGroup.readListEntry(entry_->name());
TQString path = Tellico::saveLocation(TQString::fromLatin1("data-sources/")); TQString path = Tellico::saveLocation(TQString::fromLatin1("data-sources/"));
for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
@ -394,7 +394,7 @@ void Manager::slotInstallFinished() {
if(newScript && newScript->successfulInstall()) { if(newScript && newScript->successfulInstall()) {
const TQString name = m_urlNameMap[newScript->url()]; const TQString name = m_urlNameMap[newScript->url()];
KNS::Entry* entry = m_scriptEntryMap[newScript]; KNS::Entry* entry = m_scriptEntryMap[newScript];
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffStatus"); TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffStatus");
// have to keep a config entry that maps the name of the file to the name // have to keep a config entry that maps the name of the file to the name
// of the newstuff entry, so we can track which entries are installed // of the newstuff entry, so we can track which entries are installed
// name and entry-name() are probably the same for scripts, but not a problem // name and entry-name() are probably the same for scripts, but not a problem

@ -22,7 +22,7 @@ using Tellico::NewStuff::NewScript;
NewScript::NewScript(Manager* manager_, TQWidget* parentWidget_) NewScript::NewScript(Manager* manager_, TQWidget* parentWidget_)
#if KDE_IS_VERSION(3,3,90) #if KDE_IS_VERSION(3,3,90)
: KNewStuffSecure(TQString::fromLatin1("tellico/data-source"), parentWidget_) : TDENewStuffSecure(TQString::fromLatin1("tellico script"), parentWidget_)
#else #else
: TQObject(parentWidget_) : TQObject(parentWidget_)
#endif #endif
@ -38,8 +38,8 @@ void NewScript::installResource() {
} }
#if KDE_IS_VERSION(3,3,90) #if KDE_IS_VERSION(3,3,90)
#include <knewstuff/knewstuffsecure.h> #include <tdenewstuff/knewstuffsecure.h>
#define SUPERCLASS KNewStuffSecure #define SUPERCLASS TDENewStuffSecure
#else #else
#define SUPERCLASS TQObject #define SUPERCLASS TQObject
#endif #endif

@ -18,8 +18,8 @@
#include <kurl.h> #include <kurl.h>
#if KDE_IS_VERSION(3,3,90) #if KDE_IS_VERSION(3,3,90)
#include <knewstuff/knewstuffsecure.h> #include <tdenewstuff/knewstuffsecure.h>
#define SUPERCLASS KNewStuffSecure #define SUPERCLASS TDENewStuffSecure
#else #else
#define SUPERCLASS TQObject #define SUPERCLASS TQObject
#endif #endif
@ -47,7 +47,7 @@ private:
Manager* m_manager; Manager* m_manager;
#if !KDE_IS_VERSION(3,3,90) #if !KDE_IS_VERSION(3,3,90)
// KNewStuffSecure has a protected variable // TDENewStuffSecure has a protected variable
TQString m_tarName; TQString m_tarName;
#endif #endif
KURL m_url; KURL m_url;

@ -11,7 +11,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
// this class is largely copied from tdelibs/knewstuff/provider.cpp // this class is largely copied from tdelibs/tdenewstuff/provider.cpp
// which is Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> // which is Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
// and licensed under GPL v2, just like Tellico // and licensed under GPL v2, just like Tellico
@ -20,7 +20,7 @@
#include "../latin1literal.h" #include "../latin1literal.h"
#include <tdeio/job.h> #include <tdeio/job.h>
#include <knewstuff/provider.h> #include <tdenewstuff/provider.h>
#include <tdeglobal.h> #include <tdeglobal.h>
#include <tdeconfig.h> #include <tdeconfig.h>
#include <tdemessagebox.h> #include <tdemessagebox.h>

@ -11,7 +11,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
// this class is largely copied from tdelibs/knewstuff/provider.h // this class is largely copied from tdelibs/tdenewstuff/provider.h
// which is Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> // which is Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
// and licensed under GPL v2, just like Tellico // and licensed under GPL v2, just like Tellico
// //

Loading…
Cancel
Save