Rename KLock and KTrader to avoid conflicts with KDE4

pull/16/head
Timothy Pearson 12 years ago
parent 59d153016b
commit 0c9d97065a

@ -15,7 +15,7 @@
* To check if kregexpeditor in tdeutils is installed and available use this line: * To check if kregexpeditor in tdeutils is installed and available use this line:
* *
* \code * \code
* bool installed=!KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty(); * bool installed=!TDETrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty();
* \endcode * \endcode
* *
* The following is a template for what you need to do to create an instance of the * The following is a template for what you need to do to create an instance of the

@ -227,7 +227,7 @@
* If you want to detect if KTTSD is installed without starting it, use this code. * If you want to detect if KTTSD is installed without starting it, use this code.
* *
@verbatim @verbatim
KTrader::OfferList offers = KTrader::self()->query("DCOP/Text-to-Speech", "Name == 'KTTSD'"); TDETrader::OfferList offers = TDETrader::self()->query("DCOP/Text-to-Speech", "Name == 'KTTSD'");
if (offers.count() > 0) if (offers.count() > 0)
{ {
// KTTSD is installed. // KTTSD is installed.

@ -46,14 +46,14 @@ EditorChooser::EditorChooser(TQWidget *parent,const char *name) :
grid->addWidget( d->chooser, 0, 0); grid->addWidget( d->chooser, 0, 0);
KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes"); TDETrader::OfferList offers = TDETrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
TDEConfig *config=new TDEConfig("default_components"); TDEConfig *config=new TDEConfig("default_components");
config->setGroup("KTextEditor"); config->setGroup("KTextEditor");
TQString editor = config->readPathEntry("embeddedEditor"); TQString editor = config->readPathEntry("embeddedEditor");
if (editor.isEmpty()) editor="katepart"; if (editor.isEmpty()) editor="katepart";
for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) for (TDETrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it)
{ {
if ((*it)->desktopEntryName().contains(editor)) if ((*it)->desktopEntryName().contains(editor))
{ {
@ -62,7 +62,7 @@ EditorChooser::EditorChooser(TQWidget *parent,const char *name) :
} }
} }
for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) for (TDETrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it)
{ {
d->chooser->editorCombo->insertItem((*it)->name()); d->chooser->editorCombo->insertItem((*it)->name());
d->elements.append((*it)->desktopEntryName()); d->elements.append((*it)->desktopEntryName());

@ -1 +1 @@
Factor out KLockFile. Factor out TDELockFile.

@ -71,7 +71,7 @@ KateFactory::KateFactory ()
I18N_NOOP( "Embeddable editor component" ), TDEAboutData::License_LGPL_V2, I18N_NOOP( "Embeddable editor component" ), TDEAboutData::License_LGPL_V2,
I18N_NOOP( "(c) 2000-2004 The Kate Authors" ), 0, "http://kate.kde.org") I18N_NOOP( "(c) 2000-2004 The Kate Authors" ), 0, "http://kate.kde.org")
, m_instance (&m_aboutData) , m_instance (&m_aboutData)
, m_plugins (KTrader::self()->query("KTextEditor/Plugin")) , m_plugins (TDETrader::self()->query("KTextEditor/Plugin"))
, m_jscript (0) , m_jscript (0)
{ {
// set s_self // set s_self

@ -150,7 +150,7 @@ class KateFactory
* on start detected plugins * on start detected plugins
* @return list of all at launch detected tdetexteditor::plugins * @return list of all at launch detected tdetexteditor::plugins
*/ */
inline const KTrader::OfferList &plugins () { return m_plugins; }; inline const TDETrader::OfferList &plugins () { return m_plugins; };
/** /**
* global dirwatch * global dirwatch
@ -261,7 +261,7 @@ class KateFactory
/** /**
* at start found plugins * at start found plugins
*/ */
KTrader::OfferList m_plugins; TDETrader::OfferList m_plugins;
/** /**
* fallback document config * fallback document config

@ -1443,8 +1443,8 @@ void TDEApplication::startKdeinit()
{ {
#ifndef Q_WS_WIN //TODO #ifndef Q_WS_WIN //TODO
TDEInstance inst( "starttdeinitlock" ); TDEInstance inst( "starttdeinitlock" );
KLockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst )); TDELockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst ));
if( lock.lock( KLockFile::LockNoBlock ) != KLockFile::LockOK ) { if( lock.lock( TDELockFile::LockNoBlock ) != TDELockFile::LockOK ) {
lock.lock(); lock.lock();
DCOPClient cl; DCOPClient cl;
if( cl.attach()) if( cl.attach())

@ -234,7 +234,7 @@
7011 kio (KSycoca) 7011 kio (KSycoca)
7012 kio (KService*) 7012 kio (KService*)
7013 kio (KPing) 7013 kio (KPing)
7014 kio (KTrader) 7014 kio (TDETrader)
7015 kio (KAutoMount) 7015 kio (KAutoMount)
7016 kio (KLauncher) 7016 kio (KLauncher)
7017 kio (KIOConnection) 7017 kio (KIOConnection)

@ -45,7 +45,7 @@
// TODO: http://www.spinnaker.de/linux/nfs-locking.html // TODO: http://www.spinnaker.de/linux/nfs-locking.html
// TODO: Make regression test // TODO: Make regression test
class KLockFile::KLockFilePrivate { class TDELockFile::TDELockFilePrivate {
public: public:
TQString file; TQString file;
int staleTime; int staleTime;
@ -62,9 +62,9 @@ public:
// 30 seconds // 30 seconds
KLockFile::KLockFile(const TQString &file) TDELockFile::TDELockFile(const TQString &file)
{ {
d = new KLockFilePrivate(); d = new TDELockFilePrivate();
d->file = file; d->file = file;
d->staleTime = 30; d->staleTime = 30;
d->isLocked = false; d->isLocked = false;
@ -72,21 +72,21 @@ KLockFile::KLockFile(const TQString &file)
d->linkCountSupport = true; d->linkCountSupport = true;
} }
KLockFile::~KLockFile() TDELockFile::~TDELockFile()
{ {
unlock(); unlock();
delete d; delete d;
} }
int int
KLockFile::staleTime() const TDELockFile::staleTime() const
{ {
return d->staleTime; return d->staleTime;
} }
void void
KLockFile::setStaleTime(int _staleTime) TDELockFile::setStaleTime(int _staleTime)
{ {
d->staleTime = _staleTime; d->staleTime = _staleTime;
} }
@ -109,17 +109,17 @@ static bool testLinkCountSupport(const TQCString &fileName)
return ((result == 0) && (st_buf.st_nlink == 2)); return ((result == 0) && (st_buf.st_nlink == 2));
} }
static KLockFile::LockResult lockFile(const TQString &lockFile, KDE_struct_stat &st_buf, bool &linkCountSupport) static TDELockFile::LockResult lockFile(const TQString &lockFile, KDE_struct_stat &st_buf, bool &linkCountSupport)
{ {
TQCString lockFileName = TQFile::encodeName( lockFile ); TQCString lockFileName = TQFile::encodeName( lockFile );
int result = KDE_lstat( lockFileName, &st_buf ); int result = KDE_lstat( lockFileName, &st_buf );
if (result == 0) if (result == 0)
return KLockFile::LockFail; return TDELockFile::LockFail;
KTempFile uniqueFile(lockFile, TQString::null, 0644); KTempFile uniqueFile(lockFile, TQString::null, 0644);
uniqueFile.setAutoDelete(true); uniqueFile.setAutoDelete(true);
if (uniqueFile.status() != 0) if (uniqueFile.status() != 0)
return KLockFile::LockError; return TDELockFile::LockError;
char hostname[256]; char hostname[256];
hostname[0] = 0; hostname[0] = 0;
@ -138,23 +138,23 @@ static KLockFile::LockResult lockFile(const TQString &lockFile, KDE_struct_stat
// Create lock file // Create lock file
result = ::link( uniqueName, lockFileName ); result = ::link( uniqueName, lockFileName );
if (result != 0) if (result != 0)
return KLockFile::LockError; return TDELockFile::LockError;
if (!linkCountSupport) if (!linkCountSupport)
return KLockFile::LockOK; return TDELockFile::LockOK;
#else #else
//TODO for win32 //TODO for win32
return KLockFile::LockOK; return TDELockFile::LockOK;
#endif #endif
KDE_struct_stat st_buf2; KDE_struct_stat st_buf2;
result = KDE_lstat( uniqueName, &st_buf2 ); result = KDE_lstat( uniqueName, &st_buf2 );
if (result != 0) if (result != 0)
return KLockFile::LockError; return TDELockFile::LockError;
result = KDE_lstat( lockFileName, &st_buf ); result = KDE_lstat( lockFileName, &st_buf );
if (result != 0) if (result != 0)
return KLockFile::LockError; return TDELockFile::LockError;
if (!statResultIsEqual(st_buf, st_buf2) || S_ISLNK(st_buf.st_mode) || S_ISLNK(st_buf2.st_mode)) if (!statResultIsEqual(st_buf, st_buf2) || S_ISLNK(st_buf.st_mode) || S_ISLNK(st_buf2.st_mode))
{ {
@ -163,15 +163,15 @@ static KLockFile::LockResult lockFile(const TQString &lockFile, KDE_struct_stat
{ {
linkCountSupport = testLinkCountSupport(uniqueName); linkCountSupport = testLinkCountSupport(uniqueName);
if (!linkCountSupport) if (!linkCountSupport)
return KLockFile::LockOK; // Link count support is missing... assume everything is OK. return TDELockFile::LockOK; // Link count support is missing... assume everything is OK.
} }
return KLockFile::LockFail; return TDELockFile::LockFail;
} }
return KLockFile::LockOK; return TDELockFile::LockOK;
} }
static KLockFile::LockResult deleteStaleLock(const TQString &lockFile, KDE_struct_stat &st_buf, bool &linkCountSupport) static TDELockFile::LockResult deleteStaleLock(const TQString &lockFile, KDE_struct_stat &st_buf, bool &linkCountSupport)
{ {
// This is dangerous, we could be deleting a new lock instead of // This is dangerous, we could be deleting a new lock instead of
// the old stale one, let's be very careful // the old stale one, let's be very careful
@ -179,7 +179,7 @@ static KLockFile::LockResult deleteStaleLock(const TQString &lockFile, KDE_struc
// Create temp file // Create temp file
KTempFile ktmpFile(lockFile); KTempFile ktmpFile(lockFile);
if (ktmpFile.status() != 0) if (ktmpFile.status() != 0)
return KLockFile::LockError; return TDELockFile::LockError;
TQCString lckFile = TQFile::encodeName(lockFile); TQCString lckFile = TQFile::encodeName(lockFile);
TQCString tmpFile = TQFile::encodeName(ktmpFile.name()); TQCString tmpFile = TQFile::encodeName(ktmpFile.name());
@ -189,10 +189,10 @@ static KLockFile::LockResult deleteStaleLock(const TQString &lockFile, KDE_struc
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
// link to lock file // link to lock file
if (::link(lckFile, tmpFile) != 0) if (::link(lckFile, tmpFile) != 0)
return KLockFile::LockFail; // Try again later return TDELockFile::LockFail; // Try again later
#else #else
//TODO for win32 //TODO for win32
return KLockFile::LockOK; return TDELockFile::LockOK;
#endif #endif
// check if link count increased with exactly one // check if link count increased with exactly one
@ -209,7 +209,7 @@ static KLockFile::LockResult deleteStaleLock(const TQString &lockFile, KDE_struc
tqWarning("WARNING: deleting stale lockfile %s", lckFile.data()); tqWarning("WARNING: deleting stale lockfile %s", lckFile.data());
::unlink(lckFile); ::unlink(lckFile);
::unlink(tmpFile); ::unlink(tmpFile);
return KLockFile::LockOK; return TDELockFile::LockOK;
} }
} }
@ -227,34 +227,34 @@ static KLockFile::LockResult deleteStaleLock(const TQString &lockFile, KDE_struc
tqWarning("WARNING: deleting stale lockfile %s", lckFile.data()); tqWarning("WARNING: deleting stale lockfile %s", lckFile.data());
::unlink(lckFile); ::unlink(lckFile);
::unlink(tmpFile); ::unlink(tmpFile);
return KLockFile::LockOK; return TDELockFile::LockOK;
} }
// Failed to delete stale lock file // Failed to delete stale lock file
tqWarning("WARNING: Problem deleting stale lockfile %s", lckFile.data()); tqWarning("WARNING: Problem deleting stale lockfile %s", lckFile.data());
::unlink(tmpFile); ::unlink(tmpFile);
return KLockFile::LockFail; return TDELockFile::LockFail;
} }
KLockFile::LockResult KLockFile::lock(int options) TDELockFile::LockResult TDELockFile::lock(int options)
{ {
if (d->isLocked) if (d->isLocked)
return KLockFile::LockOK; return TDELockFile::LockOK;
KLockFile::LockResult result; TDELockFile::LockResult result;
int hardErrors = 5; int hardErrors = 5;
int n = 5; int n = 5;
while(true) while(true)
{ {
KDE_struct_stat st_buf; KDE_struct_stat st_buf;
result = lockFile(d->file, st_buf, d->linkCountSupport); result = lockFile(d->file, st_buf, d->linkCountSupport);
if (result == KLockFile::LockOK) if (result == TDELockFile::LockOK)
{ {
d->staleTimer = TQTime(); d->staleTimer = TQTime();
break; break;
} }
else if (result == KLockFile::LockError) else if (result == TDELockFile::LockError)
{ {
d->staleTimer = TQTime(); d->staleTimer = TQTime();
if (--hardErrors == 0) if (--hardErrors == 0)
@ -262,7 +262,7 @@ KLockFile::LockResult KLockFile::lock(int options)
break; break;
} }
} }
else // KLockFile::Fail else // TDELockFile::Fail
{ {
if (!d->staleTimer.isNull() && !statResultIsEqual(d->statBuf, st_buf)) if (!d->staleTimer.isNull() && !statResultIsEqual(d->statBuf, st_buf))
d->staleTimer = TQTime(); d->staleTimer = TQTime();
@ -292,17 +292,17 @@ KLockFile::LockResult KLockFile::lock(int options)
if (isStale) if (isStale)
{ {
if ((options & LockForce) == 0) if ((options & LockForce) == 0)
return KLockFile::LockStale; return TDELockFile::LockStale;
result = deleteStaleLock(d->file, d->statBuf, d->linkCountSupport); result = deleteStaleLock(d->file, d->statBuf, d->linkCountSupport);
if (result == KLockFile::LockOK) if (result == TDELockFile::LockOK)
{ {
// Lock deletion successful // Lock deletion successful
d->staleTimer = TQTime(); d->staleTimer = TQTime();
continue; // Now try to get the new lock continue; // Now try to get the new lock
} }
else if (result != KLockFile::LockFail) else if (result != TDELockFile::LockFail)
{ {
return result; return result;
} }
@ -351,12 +351,12 @@ KLockFile::LockResult KLockFile::lock(int options)
return result; return result;
} }
bool KLockFile::isLocked() const bool TDELockFile::isLocked() const
{ {
return d->isLocked; return d->isLocked;
} }
void KLockFile::unlock() void TDELockFile::unlock()
{ {
if (d->isLocked) if (d->isLocked)
{ {
@ -365,7 +365,7 @@ void KLockFile::unlock()
} }
} }
bool KLockFile::getLockInfo(int &pid, TQString &hostname, TQString &appname) bool TDELockFile::getLockInfo(int &pid, TQString &hostname, TQString &appname)
{ {
if (d->pid == -1) if (d->pid == -1)
return false; return false;

@ -25,22 +25,22 @@
#include <ksharedptr.h> #include <ksharedptr.h>
/** /**
* The KLockFile class provides NFS safe lockfiles. * The TDELockFile class provides NFS safe lockfiles.
* *
* @author Waldo Bastian <bastian@kde.org> * @author Waldo Bastian <bastian@kde.org>
* @since 3.3 * @since 3.3
*/ */
class TDECORE_EXPORT KLockFile : public TDEShared class TDECORE_EXPORT TDELockFile : public TDEShared
{ {
public: public:
typedef TDESharedPtr<KLockFile> Ptr; typedef TDESharedPtr<TDELockFile> Ptr;
KLockFile(const TQString &file); TDELockFile(const TQString &file);
/** /**
* Destroys the object, releasing the lock if held * Destroys the object, releasing the lock if held
**/ **/
~KLockFile(); ~TDELockFile();
/** /**
* Possible return values of the lock function. * Possible return values of the lock function.
@ -116,8 +116,8 @@ public:
bool getLockInfo(int &pid, TQString &hostname, TQString &appname); bool getLockInfo(int &pid, TQString &hostname, TQString &appname);
private: private:
class KLockFilePrivate; class TDELockFilePrivate;
KLockFilePrivate *d; TDELockFilePrivate *d;
}; };
#endif #endif

@ -277,7 +277,7 @@ void TDEConfig::setFileWriteMode(int mode)
backEnd->setFileWriteMode(mode); backEnd->setFileWriteMode(mode);
} }
KLockFile::Ptr TDEConfig::lockFile(bool bGlobal) TDELockFile::Ptr TDEConfig::lockFile(bool bGlobal)
{ {
TDEConfigINIBackEnd *aBackEnd = dynamic_cast<TDEConfigINIBackEnd*>(backEnd); TDEConfigINIBackEnd *aBackEnd = dynamic_cast<TDEConfigINIBackEnd*>(backEnd);
if (!aBackEnd) return 0; if (!aBackEnd) return 0;

@ -176,7 +176,7 @@ public:
* Otherwise there is a risk of deadlock. * Otherwise there is a risk of deadlock.
* @since 3.3 * @since 3.3
*/ */
KLockFile::Ptr lockFile( bool bGlobal=false ); TDELockFile::Ptr lockFile( bool bGlobal=false );
protected: protected:

@ -236,8 +236,8 @@ class TDEConfigBackEnd::TDEConfigBackEndPrivate
public: public:
TQDateTime localLastModified; TQDateTime localLastModified;
uint localLastSize; uint localLastSize;
KLockFile::Ptr localLockFile; TDELockFile::Ptr localLockFile;
KLockFile::Ptr globalLockFile; TDELockFile::Ptr globalLockFile;
}; };
void TDEConfigBackEnd::changeFileName(const TQString &_fileName, void TDEConfigBackEnd::changeFileName(const TQString &_fileName,
@ -270,7 +270,7 @@ void TDEConfigBackEnd::changeFileName(const TQString &_fileName,
d->globalLockFile = 0; d->globalLockFile = 0;
} }
KLockFile::Ptr TDEConfigBackEnd::lockFile(bool bGlobal) TDELockFile::Ptr TDEConfigBackEnd::lockFile(bool bGlobal)
{ {
if (bGlobal) if (bGlobal)
{ {
@ -279,7 +279,7 @@ KLockFile::Ptr TDEConfigBackEnd::lockFile(bool bGlobal)
if (!mGlobalFileName.isEmpty()) if (!mGlobalFileName.isEmpty())
{ {
d->globalLockFile = new KLockFile(mGlobalFileName+".lock"); d->globalLockFile = new TDELockFile(mGlobalFileName+".lock");
return d->globalLockFile; return d->globalLockFile;
} }
} }
@ -290,7 +290,7 @@ KLockFile::Ptr TDEConfigBackEnd::lockFile(bool bGlobal)
if (!mLocalFileName.isEmpty()) if (!mLocalFileName.isEmpty())
{ {
d->localLockFile = new KLockFile(mLocalFileName+".lock"); d->localLockFile = new TDELockFile(mLocalFileName+".lock");
return d->localLockFile; return d->localLockFile;
} }
} }
@ -815,7 +815,7 @@ void TDEConfigINIBackEnd::sync(bool bMerge)
// it wasn't SUID. // it wasn't SUID.
if (checkAccess(mLocalFileName, W_OK)) { if (checkAccess(mLocalFileName, W_OK)) {
// File is writable // File is writable
KLockFile::Ptr lf; TDELockFile::Ptr lf;
bool mergeLocalFile = bMerge; bool mergeLocalFile = bMerge;
// Check if the file has been updated since. // Check if the file has been updated since.
@ -827,7 +827,7 @@ void TDEConfigINIBackEnd::sync(bool bMerge)
if (lf) if (lf)
{ {
lf->lock( KLockFile::LockForce ); lf->lock( TDELockFile::LockForce );
// But what if the locking failed? Ignore it for now... // But what if the locking failed? Ignore it for now...
} }
@ -873,13 +873,13 @@ void TDEConfigINIBackEnd::sync(bool bMerge)
// can we allow the write? (see above) // can we allow the write? (see above)
if (checkAccess ( mGlobalFileName, W_OK )) { if (checkAccess ( mGlobalFileName, W_OK )) {
KLockFile::Ptr lf = lockFile(true); // Lock file for global file TDELockFile::Ptr lf = lockFile(true); // Lock file for global file
if (lf && lf->isLocked()) if (lf && lf->isLocked())
lf = 0; // Already locked, we don't need to lock/unlock again lf = 0; // Already locked, we don't need to lock/unlock again
if (lf) if (lf)
{ {
lf->lock( KLockFile::LockForce ); lf->lock( TDELockFile::LockForce );
// But what if the locking failed? Ignore it for now... // But what if the locking failed? Ignore it for now...
} }
writeConfigFile( mGlobalFileName, true, bMerge ); // Always merge writeConfigFile( mGlobalFileName, true, bMerge ); // Always merge

@ -151,7 +151,7 @@ public:
* @param bGlobal If true, returns a lock file object for kdeglobals * @param bGlobal If true, returns a lock file object for kdeglobals
* @since 3.3 * @since 3.3
*/ */
KLockFile::Ptr lockFile( bool bGlobal = false ); TDELockFile::Ptr lockFile( bool bGlobal = false );
#ifdef KDE_NO_COMPAT #ifdef KDE_NO_COMPAT
private: private:

@ -291,9 +291,9 @@ PluginBase::PluginBase(ExecState *exec, bool loadPluginInfo)
plugins->setAutoDelete( true ); plugins->setAutoDelete( true );
mimes->setAutoDelete( true ); mimes->setAutoDelete( true );
// read in using KTrader // read in using TDETrader
KTrader::OfferList offers = KTrader::self()->query("Browser/View"); TDETrader::OfferList offers = TDETrader::self()->query("Browser/View");
KTrader::OfferList::iterator it; TDETrader::OfferList::iterator it;
for ( it = offers.begin(); it != offers.end(); ++it ) { for ( it = offers.begin(); it != offers.end(); ++it ) {
TQVariant pluginsinfo = (**it).property( "X-TDE-BrowserView-PluginsInfo" ); TQVariant pluginsinfo = (**it).property( "X-TDE-BrowserView-PluginsInfo" );

@ -812,7 +812,7 @@ void RenderPartObject::updateWidget()
// It is ActiveX, but the nsplugin system handling // It is ActiveX, but the nsplugin system handling
// should also work, that's why we don't override the // should also work, that's why we don't override the
// serviceType with application/x-activex-handler // serviceType with application/x-activex-handler
// but let the KTrader in tdehtmlpart::createPart() detect // but let the TDETrader in tdehtmlpart::createPart() detect
// the user's preference: launch with activex viewer or // the user's preference: launch with activex viewer or
// with nspluginviewer (Niko) // with nspluginviewer (Niko)
serviceType = "application/x-shockwave-flash"; serviceType = "application/x-shockwave-flash";

@ -4652,20 +4652,20 @@ KParts::ReadOnlyPart *TDEHTMLPart::createPart( TQWidget *parentWidget, const cha
if ( !serviceName.isEmpty() ) if ( !serviceName.isEmpty() )
constr.append( TQString::fromLatin1( "Name == '%1'" ).arg( serviceName ) ); constr.append( TQString::fromLatin1( "Name == '%1'" ).arg( serviceName ) );
KTrader::OfferList offers = KTrader::self()->query( mimetype, "KParts/ReadOnlyPart", constr, TQString() ); TDETrader::OfferList offers = TDETrader::self()->query( mimetype, "KParts/ReadOnlyPart", constr, TQString() );
if ( offers.isEmpty() ) { if ( offers.isEmpty() ) {
int pos = mimetype.find( "-plugin" ); int pos = mimetype.find( "-plugin" );
if (pos < 0) if (pos < 0)
return 0L; return 0L;
TQString stripped_mime = mimetype.left( pos ); TQString stripped_mime = mimetype.left( pos );
offers = KTrader::self()->query( stripped_mime, "KParts/ReadOnlyPart", constr, TQString() ); offers = TDETrader::self()->query( stripped_mime, "KParts/ReadOnlyPart", constr, TQString() );
if ( offers.isEmpty() ) if ( offers.isEmpty() )
return 0L; return 0L;
} }
KTrader::OfferList::ConstIterator it = offers.begin(); TDETrader::OfferList::ConstIterator it = offers.begin();
const KTrader::OfferList::ConstIterator itEnd = offers.end(); const TDETrader::OfferList::ConstIterator itEnd = offers.end();
for ( ; it != itEnd; ++it ) for ( ; it != itEnd; ++it )
{ {
KService::Ptr service = (*it); KService::Ptr service = (*it);

@ -28,7 +28,7 @@
* KServiceTypeProfile: * KServiceTypeProfile:
* Stores the user's preferences for services bound to mimetypes/servicetypes. * Stores the user's preferences for services bound to mimetypes/servicetypes.
* *
* KTrader: * TDETrader:
* Use it to query for which services implement a given mimetype/servicetype. * Use it to query for which services implement a given mimetype/servicetype.
* Has its own language, in order to allow complex queries. * Has its own language, in order to allow complex queries.
* *

@ -522,9 +522,9 @@ void KPropertiesDialog::insertPages()
" ([X-TDE-Protocol] == '%1' ) )" ).arg(item->url().protocol()); " ([X-TDE-Protocol] == '%1' ) )" ).arg(item->url().protocol());
kdDebug( 250 ) << "trader query: " << query << endl; kdDebug( 250 ) << "trader query: " << query << endl;
KTrader::OfferList offers = KTrader::self()->query( mimetype, query ); TDETrader::OfferList offers = TDETrader::self()->query( mimetype, query );
KTrader::OfferList::ConstIterator it = offers.begin(); TDETrader::OfferList::ConstIterator it = offers.begin();
KTrader::OfferList::ConstIterator end = offers.end(); TDETrader::OfferList::ConstIterator end = offers.end();
for (; it != end; ++it ) for (; it != end; ++it )
{ {
KPropsDlgPlugin *plugin = KParts::ComponentFactory KPropsDlgPlugin *plugin = KParts::ComponentFactory

@ -177,7 +177,7 @@ TQValueList<KDataToolInfo> KDataToolInfo::query( const TQString& datatype, const
else else
constr = constr + " and " + tmp; constr = constr + " and " + tmp;
} }
/* Bug in KTrader ? Test with HEAD-tdelibs! /* Bug in TDETrader ? Test with HEAD-tdelibs!
if ( instance ) if ( instance )
{ {
TQString tmp = TQString::fromLatin1( "not ('%1' in ExcludeFrom)" ).arg( instance->instanceName() ); TQString tmp = TQString::fromLatin1( "not ('%1' in ExcludeFrom)" ).arg( instance->instanceName() );
@ -189,9 +189,9 @@ TQValueList<KDataToolInfo> KDataToolInfo::query( const TQString& datatype, const
// Query the trader // Query the trader
//kdDebug() << "KDataToolInfo::query " << constr << endl; //kdDebug() << "KDataToolInfo::query " << constr << endl;
KTrader::OfferList offers = KTrader::self()->query( "KDataTool", constr ); TDETrader::OfferList offers = TDETrader::self()->query( "KDataTool", constr );
KTrader::OfferList::ConstIterator it = offers.begin(); TDETrader::OfferList::ConstIterator it = offers.begin();
for( ; it != offers.end(); ++it ) for( ; it != offers.end(); ++it )
{ {
// Temporary replacement for the non-working trader query above // Temporary replacement for the non-working trader query above

@ -164,7 +164,7 @@ public:
bool isValid() const; bool isValid() const;
/** /**
* Queries the KTrader about installed KDataTool implementations. * Queries the TDETrader about installed KDataTool implementations.
* @param datatype a type that the application can 'export' to the tools (e.g. TQString) * @param datatype a type that the application can 'export' to the tools (e.g. TQString)
* @param mimetype the mimetype of the data (e.g. text/plain) * @param mimetype the mimetype of the data (e.g. text/plain)
* @param instance the application (or the part)'s instance (to check if a tool is excluded from this part, * @param instance the application (or the part)'s instance (to check if a tool is excluded from this part,

@ -58,7 +58,7 @@ int KDCOPServiceStarter::findServiceFor( const TQString& serviceType,
if ( !constraint.isEmpty() ) if ( !constraint.isEmpty() )
constraint += " and "; constraint += " and ";
constraint += "exist [X-DCOP-ServiceName]"; constraint += "exist [X-DCOP-ServiceName]";
KTrader::OfferList offers = KTrader::self()->query(serviceType, "Application", constraint, preferences); TDETrader::OfferList offers = TDETrader::self()->query(serviceType, "Application", constraint, preferences);
if ( offers.isEmpty() ) { if ( offers.isEmpty() ) {
if ( error ) if ( error )
*error = i18n("No service implementing %1").arg( serviceType ); *error = i18n("No service implementing %1").arg( serviceType );
@ -88,7 +88,7 @@ int KDCOPServiceStarter::startServiceFor( const TQString& serviceType,
const TQString& preferences, const TQString& preferences,
TQString *error, TQCString* dcopService, int /*flags*/ ) TQString *error, TQCString* dcopService, int /*flags*/ )
{ {
KTrader::OfferList offers = KTrader::self()->query(serviceType, "Application", constraint, preferences); TDETrader::OfferList offers = TDETrader::self()->query(serviceType, "Application", constraint, preferences);
if ( offers.isEmpty() ) if ( offers.isEmpty() )
return -1; return -1;
KService::Ptr ptr = offers.first(); KService::Ptr ptr = offers.first();

@ -26,7 +26,7 @@ class KDCOPServiceStarter;
class TQCString; class TQCString;
/** /**
* A generic DCOP service starter, using KTrader. * A generic DCOP service starter, using TDETrader.
* The default implementation starts new processes, but this interface can * The default implementation starts new processes, but this interface can
* also be reimplemented by specific applications to provide dlopened in-process DCOP objects. * also be reimplemented by specific applications to provide dlopened in-process DCOP objects.
* @author David Faure <faure@kde.org> * @author David Faure <faure@kde.org>
@ -46,8 +46,8 @@ public:
* this method will call startServiceFor to start it. * this method will call startServiceFor to start it.
* *
* @param serviceType the type of service we're looking for * @param serviceType the type of service we're looking for
* @param constraint see KTrader * @param constraint see TDETrader
* @param preferences see KTrader * @param preferences see TDETrader
* @param error On failure, @p error contains a description of the error * @param error On failure, @p error contains a description of the error
* that occurred. If the pointer is 0, the argument will be * that occurred. If the pointer is 0, the argument will be
* ignored * ignored
@ -67,15 +67,15 @@ public:
/** /**
* Find an implementation of the given @p serviceType, * Find an implementation of the given @p serviceType,
* and start it, to use its DCOP interface. * and start it, to use its DCOP interface.
* The default implementation uses KTrader to find the preferred Application, * The default implementation uses TDETrader to find the preferred Application,
* and then starts it using kapp->startService... * and then starts it using kapp->startService...
* *
* However applications (like kontact) can reimplement this method, to provide * However applications (like kontact) can reimplement this method, to provide
* an in-process way of loading the implementation for this service type. * an in-process way of loading the implementation for this service type.
* *
* @param serviceType the type of service we're looking for * @param serviceType the type of service we're looking for
* @param constraint see KTrader * @param constraint see TDETrader
* @param preferences see KTrader * @param preferences see TDETrader
* @param error On failure, @p error contains a description of the error * @param error On failure, @p error contains a description of the error
* that occurred. If the pointer is 0, the argument will be * that occurred. If the pointer is 0, the argument will be
* ignored * ignored

@ -48,10 +48,10 @@ KFilterBase * KFilterBase::findFilterByFileName( const TQString & fileName )
KFilterBase * KFilterBase::findFilterByMimeType( const TQString & mimeType ) KFilterBase * KFilterBase::findFilterByMimeType( const TQString & mimeType )
{ {
KTrader::OfferList offers = KTrader::self()->query( "TDECompressionFilter", TDETrader::OfferList offers = TDETrader::self()->query( "TDECompressionFilter",
TQString("'") + mimeType + "' in ServiceTypes" ); TQString("'") + mimeType + "' in ServiceTypes" );
KTrader::OfferList::ConstIterator it = offers.begin(); TDETrader::OfferList::ConstIterator it = offers.begin();
KTrader::OfferList::ConstIterator end = offers.end(); TDETrader::OfferList::ConstIterator end = offers.end();
kdDebug(7005) << "KFilterBase::findFilterByMimeType(" << mimeType << ") got " << offers.count() << " offers" << endl; kdDebug(7005) << "KFilterBase::findFilterByMimeType(" << mimeType << ") got " << offers.count() << " offers" << endl;
for (; it != end; ++it ) for (; it != end; ++it )

@ -28,7 +28,7 @@
KScanDialog * KScanDialog::getScanDialog( TQWidget *parent, const char *name, KScanDialog * KScanDialog::getScanDialog( TQWidget *parent, const char *name,
bool modal ) bool modal )
{ {
KTrader::OfferList offers = KTrader::self()->query("KScan/KScanDialog"); TDETrader::OfferList offers = TDETrader::self()->query("KScan/KScanDialog");
if ( offers.isEmpty() ) if ( offers.isEmpty() )
return 0L; return 0L;
@ -71,7 +71,7 @@ bool KScanDialog::setup()
KOCRDialog * KOCRDialog::getOCRDialog( TQWidget *parent, const char *name, KOCRDialog * KOCRDialog::getOCRDialog( TQWidget *parent, const char *name,
bool modal ) bool modal )
{ {
KTrader::OfferList offers = KTrader::self()->query("KScan/KOCRDialog"); TDETrader::OfferList offers = TDETrader::self()->query("KScan/KOCRDialog");
if ( offers.isEmpty() ) if ( offers.isEmpty() )
return 0L; return 0L;

@ -210,7 +210,7 @@ public:
* Returns all services supporting the given servicetype name. * Returns all services supporting the given servicetype name.
* This doesn't take care of the user profile. * This doesn't take care of the user profile.
* In fact it is used by KServiceTypeProfile, * In fact it is used by KServiceTypeProfile,
* which is used by KTrader, and that's the one you should use. * which is used by TDETrader, and that's the one you should use.
* @param _servicetype the name of the service type to search * @param _servicetype the name of the service type to search
* @return the list of all services of the given type * @return the list of all services of the given type
*/ */

@ -27,18 +27,18 @@
#include <kstaticdeleter.h> #include <kstaticdeleter.h>
#include <kdebug.h> #include <kdebug.h>
template class KStaticDeleter<KTrader>; template class KStaticDeleter<TDETrader>;
using namespace TDEIO; using namespace TDEIO;
class KTraderSorter class TDETraderSorter
{ {
public: public:
KTraderSorter() { m_pService = 0; }; TDETraderSorter() { m_pService = 0; };
KTraderSorter( const KTraderSorter& s ) : m_userPreference( s.m_userPreference ), TDETraderSorter( const TDETraderSorter& s ) : m_userPreference( s.m_userPreference ),
m_bAllowAsDefault( s.m_bAllowAsDefault ), m_bAllowAsDefault( s.m_bAllowAsDefault ),
m_traderPreference( s.m_traderPreference ), m_pService( s.m_pService ) { } m_traderPreference( s.m_traderPreference ), m_pService( s.m_pService ) { }
KTraderSorter( const KService::Ptr &_service, double _pref1, int _pref2, bool _default ) TDETraderSorter( const KService::Ptr &_service, double _pref1, int _pref2, bool _default )
{ m_pService = _service; { m_pService = _service;
m_userPreference = _pref2; m_userPreference = _pref2;
m_traderPreference = _pref1; m_traderPreference = _pref1;
@ -47,7 +47,7 @@ public:
KService::Ptr service() const { return m_pService; } KService::Ptr service() const { return m_pService; }
bool operator< ( const KTraderSorter& ) const; bool operator< ( const TDETraderSorter& ) const;
private: private:
/** /**
@ -69,7 +69,7 @@ private:
KService::Ptr m_pService; KService::Ptr m_pService;
}; };
bool KTraderSorter::operator< ( const KTraderSorter& _o ) const bool TDETraderSorter::operator< ( const TDETraderSorter& _o ) const
{ {
if ( _o.m_bAllowAsDefault && !m_bAllowAsDefault ) if ( _o.m_bAllowAsDefault && !m_bAllowAsDefault )
return true; return true;
@ -84,32 +84,32 @@ bool KTraderSorter::operator< ( const KTraderSorter& _o ) const
// -------------------------------------------------- // --------------------------------------------------
KTrader* KTrader::s_self = 0; TDETrader* TDETrader::s_self = 0;
static KStaticDeleter<KTrader> ktradersd; static KStaticDeleter<TDETrader> ktradersd;
KTrader* KTrader::self() TDETrader* TDETrader::self()
{ {
if ( !s_self ) if ( !s_self )
ktradersd.setObject( s_self, new KTrader ); ktradersd.setObject( s_self, new TDETrader );
return s_self; return s_self;
} }
KTrader::KTrader() TDETrader::TDETrader()
{ {
} }
KTrader::~KTrader() TDETrader::~TDETrader()
{ {
} }
KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString& _constraint, TDETrader::OfferList TDETrader::query( const TQString& _servicetype, const TQString& _constraint,
const TQString& _preferences ) const const TQString& _preferences ) const
{ {
return query( _servicetype, TQString::null, _constraint, _preferences ); return query( _servicetype, TQString::null, _constraint, _preferences );
} }
KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString& _genericServiceType, TDETrader::OfferList TDETrader::query( const TQString& _servicetype, const TQString& _genericServiceType,
const TQString& _constraint, const TQString& _constraint,
const TQString& _preferences ) const const TQString& _preferences ) const
{ {
@ -124,7 +124,7 @@ KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString&
prefs = TDEIO::parsePreferences( _preferences ); prefs = TDEIO::parsePreferences( _preferences );
KServiceTypeProfile::OfferList lst; KServiceTypeProfile::OfferList lst;
KTrader::OfferList ret; TDETrader::OfferList ret;
// Get all services of this service type. // Get all services of this service type.
lst = KServiceTypeProfile::offers( _servicetype, _genericServiceType ); lst = KServiceTypeProfile::offers( _servicetype, _genericServiceType );
@ -147,17 +147,17 @@ KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString&
if ( !!prefs ) if ( !!prefs )
{ {
TQValueList<KTraderSorter> sorter; TQValueList<TDETraderSorter> sorter;
KServiceTypeProfile::OfferList::Iterator it = lst.begin(); KServiceTypeProfile::OfferList::Iterator it = lst.begin();
for( ; it != lst.end(); ++it ) for( ; it != lst.end(); ++it )
{ {
PreferencesReturn p = matchPreferences( prefs, (*it).service(), lst ); PreferencesReturn p = matchPreferences( prefs, (*it).service(), lst );
if ( p.type == PreferencesReturn::PRT_DOUBLE ) if ( p.type == PreferencesReturn::PRT_DOUBLE )
sorter.append( KTraderSorter( (*it).service(), p.f, (*it).preference(), (*it).allowAsDefault() ) ); sorter.append( TDETraderSorter( (*it).service(), p.f, (*it).preference(), (*it).allowAsDefault() ) );
} }
qBubbleSort( sorter ); qBubbleSort( sorter );
TQValueList<KTraderSorter>::Iterator it2 = sorter.begin(); TQValueList<TDETraderSorter>::Iterator it2 = sorter.begin();
for( ; it2 != sorter.end(); ++it2 ) for( ; it2 != sorter.end(); ++it2 )
ret.prepend( (*it2).service() ); ret.prepend( (*it2).service() );
} }
@ -180,7 +180,7 @@ KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString&
return ret; return ret;
} }
void KTrader::virtual_hook( int, void* ) void TDETrader::virtual_hook( int, void* )
{ /*BASE::virtual_hook( id, data );*/ } { /*BASE::virtual_hook( id, data );*/ }
#include "ktrader.moc" #include "ktrader.moc"

@ -48,7 +48,7 @@
* then will use KRun::run() to invoke the application. In "trader-speak", * then will use KRun::run() to invoke the application. In "trader-speak",
* this looks like this: * this looks like this:
* \code * \code
* KTrader::OfferList offers = KTrader::self()->query("text/html", "Type == 'Application'"); * TDETrader::OfferList offers = TDETrader::self()->query("text/html", "Type == 'Application'");
* KService::Ptr ptr = offers.first(); * KService::Ptr ptr = offers.first();
* KURL::List lst; * KURL::List lst;
* lst.append("http://www.kde.org/index.html"); * lst.append("http://www.kde.org/index.html");
@ -57,7 +57,7 @@
* *
* Now, say that you want to list all KParts component that can handle HTML. * Now, say that you want to list all KParts component that can handle HTML.
* \code * \code
* KTrader::OfferList offers = KTrader::self()->query("text/html", "KParts/ReadOnlyPart"); * TDETrader::OfferList offers = TDETrader::self()->query("text/html", "KParts/ReadOnlyPart");
* \endcode * \endcode
* *
* If you want to get the preferred KParts component for text/html you could use * If you want to get the preferred KParts component for text/html you could use
@ -82,7 +82,7 @@
* applications or components. * applications or components.
* @author Torben Weis <weis@kde.org> * @author Torben Weis <weis@kde.org>
*/ */
class TDEIO_EXPORT KTrader : public TQObject class TDEIO_EXPORT TDETrader : public TQObject
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -95,10 +95,10 @@ public:
/** /**
* Standard destructor * Standard destructor
*/ */
virtual ~KTrader(); virtual ~TDETrader();
/** /**
* The main function in the KTrader class. * The main function in the TDETrader class.
* *
* It will return a list of services that match your * It will return a list of services that match your
* specifications. The only required parameter is the service * specifications. The only required parameter is the service
@ -158,24 +158,24 @@ public:
const TQString& preferences /*= TQString::null*/) const; const TQString& preferences /*= TQString::null*/) const;
/** /**
* This is a static pointer to a KTrader instance. * This is a static pointer to a TDETrader instance.
* *
* You will need * You will need
* to use this to access the KTrader functionality since the * to use this to access the TDETrader functionality since the
* constuctors are protected. * constuctors are protected.
* *
* @return Static KTrader instance * @return Static TDETrader instance
*/ */
static KTrader* self(); static TDETrader* self();
protected: protected:
/** /**
* @internal * @internal
*/ */
KTrader(); TDETrader();
private: private:
static KTrader* s_self; static TDETrader* s_self;
protected: protected:
virtual void virtual_hook( int id, void* data ); virtual void virtual_hook( int id, void* data );
}; };
@ -185,7 +185,7 @@ protected:
* *
* @section Literals * @section Literals
* *
* As elementary atoms of the constraint language, KTrader supports * As elementary atoms of the constraint language, TDETrader supports
* booleans, integers, floats and strings. Boolean literals are * booleans, integers, floats and strings. Boolean literals are
* @a TRUE and @a FALSE . Integers can be positive or negative, * @a TRUE and @a FALSE . Integers can be positive or negative,
* i.e. @a 42 and @a -10 are legal values. Floating point * i.e. @a 42 and @a -10 are legal values. Floating point
@ -277,7 +277,7 @@ protected:
* *
* The following examples show filters for .desktop files. * The following examples show filters for .desktop files.
* <tt>Type</tt>, <tt>ServiceTypes</tt> and <tt>MimeType</tt> are * <tt>Type</tt>, <tt>ServiceTypes</tt> and <tt>MimeType</tt> are
* properties in .desktop files. Be aware that within KTrader MimeType * properties in .desktop files. Be aware that within TDETrader MimeType
* properties are understood as ServiceTypes ones. * properties are understood as ServiceTypes ones.
* *
* *

@ -39,7 +39,7 @@ ParseTreeBase::Ptr TDEIO::parseConstraints( const TQString& _constr )
{ {
TQCString str = _constr.utf8(); TQCString str = _constr.utf8();
sCode = str.data(); sCode = str.data();
KTraderParse_mainParse( sCode ); TDETraderParse_mainParse( sCode );
sCode = 0; sCode = 0;
assert( pTree ); assert( pTree );
return *pTree; return *pTree;
@ -49,13 +49,13 @@ ParseTreeBase::Ptr TDEIO::parsePreferences( const TQString& _prefs )
{ {
TQCString str = _prefs.utf8(); TQCString str = _prefs.utf8();
sCode = str.data(); sCode = str.data();
KTraderParse_mainParse( sCode ); TDETraderParse_mainParse( sCode );
sCode = 0; sCode = 0;
assert( pTree ); assert( pTree );
return *pTree; return *pTree;
} }
void KTraderParse_setParseTree( void *_ptr1 ) void TDETraderParse_setParseTree( void *_ptr1 )
{ {
if ( !pTree ) if ( !pTree )
pTree = new ParseTreeBase::Ptr; // ### leak; should use KStaticDeleter pTree = new ParseTreeBase::Ptr; // ### leak; should use KStaticDeleter
@ -63,95 +63,95 @@ void KTraderParse_setParseTree( void *_ptr1 )
} }
void KTraderParse_error( const char* err ) void TDETraderParse_error( const char* err )
{ {
kdWarning(7014) << "Parsing '" << sCode << "' gave " << err << endl; kdWarning(7014) << "Parsing '" << sCode << "' gave " << err << endl;
} }
void* KTraderParse_newOR( void *_ptr1, void *_ptr2 ) void* TDETraderParse_newOR( void *_ptr1, void *_ptr2 )
{ {
return new ParseTreeOR( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 ); return new ParseTreeOR( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 );
} }
void* KTraderParse_newAND( void *_ptr1, void *_ptr2 ) void* TDETraderParse_newAND( void *_ptr1, void *_ptr2 )
{ {
return new ParseTreeAND( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 ); return new ParseTreeAND( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 );
} }
void* KTraderParse_newCMP( void *_ptr1, void *_ptr2, int _i ) void* TDETraderParse_newCMP( void *_ptr1, void *_ptr2, int _i )
{ {
return new ParseTreeCMP( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2, _i ); return new ParseTreeCMP( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2, _i );
} }
void* KTraderParse_newIN( void *_ptr1, void *_ptr2 ) void* TDETraderParse_newIN( void *_ptr1, void *_ptr2 )
{ {
return new ParseTreeIN( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 ); return new ParseTreeIN( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 );
} }
void* KTraderParse_newMATCH( void *_ptr1, void *_ptr2 ) void* TDETraderParse_newMATCH( void *_ptr1, void *_ptr2 )
{ {
return new ParseTreeMATCH( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 ); return new ParseTreeMATCH( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2 );
} }
void* KTraderParse_newCALC( void *_ptr1, void *_ptr2, int _i ) void* TDETraderParse_newCALC( void *_ptr1, void *_ptr2, int _i )
{ {
return new ParseTreeCALC( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2, _i ); return new ParseTreeCALC( (ParseTreeBase*)_ptr1, (ParseTreeBase*)_ptr2, _i );
} }
void* KTraderParse_newBRACKETS( void *_ptr1 ) void* TDETraderParse_newBRACKETS( void *_ptr1 )
{ {
return new ParseTreeBRACKETS( (ParseTreeBase*)_ptr1 ); return new ParseTreeBRACKETS( (ParseTreeBase*)_ptr1 );
} }
void* KTraderParse_newNOT( void *_ptr1 ) void* TDETraderParse_newNOT( void *_ptr1 )
{ {
return new ParseTreeNOT( (ParseTreeBase*)_ptr1 ); return new ParseTreeNOT( (ParseTreeBase*)_ptr1 );
} }
void* KTraderParse_newEXIST( char *_ptr1 ) void* TDETraderParse_newEXIST( char *_ptr1 )
{ {
ParseTreeEXIST *t = new ParseTreeEXIST( _ptr1 ); ParseTreeEXIST *t = new ParseTreeEXIST( _ptr1 );
free(_ptr1); free(_ptr1);
return t; return t;
} }
void* KTraderParse_newID( char *_ptr1 ) void* TDETraderParse_newID( char *_ptr1 )
{ {
ParseTreeID *t = new ParseTreeID( _ptr1 ); ParseTreeID *t = new ParseTreeID( _ptr1 );
free(_ptr1); free(_ptr1);
return t; return t;
} }
void* KTraderParse_newSTRING( char *_ptr1 ) void* TDETraderParse_newSTRING( char *_ptr1 )
{ {
ParseTreeSTRING *t = new ParseTreeSTRING( _ptr1 ); ParseTreeSTRING *t = new ParseTreeSTRING( _ptr1 );
free(_ptr1); free(_ptr1);
return t; return t;
} }
void* KTraderParse_newNUM( int _i ) void* TDETraderParse_newNUM( int _i )
{ {
return new ParseTreeNUM( _i ); return new ParseTreeNUM( _i );
} }
void* KTraderParse_newFLOAT( float _f ) void* TDETraderParse_newFLOAT( float _f )
{ {
return new ParseTreeDOUBLE( _f ); return new ParseTreeDOUBLE( _f );
} }
void* KTraderParse_newBOOL( char _b ) void* TDETraderParse_newBOOL( char _b )
{ {
return new ParseTreeBOOL( (bool)_b ); return new ParseTreeBOOL( (bool)_b );
} }
void* KTraderParse_newMAX2( char *_id ) void* TDETraderParse_newMAX2( char *_id )
{ {
ParseTreeMAX2 *t = new ParseTreeMAX2( _id ); ParseTreeMAX2 *t = new ParseTreeMAX2( _id );
free(_id); free(_id);
return t; return t;
} }
void* KTraderParse_newMIN2( char *_id ) void* TDETraderParse_newMIN2( char *_id )
{ {
ParseTreeMIN2 *t = new ParseTreeMIN2( _id ); ParseTreeMIN2 *t = new ParseTreeMIN2( _id );
free(_id); free(_id);

@ -23,30 +23,30 @@
/* /*
* Functions definition for yacc * Functions definition for yacc
*/ */
void KTraderParse_mainParse( const char *_code ); void TDETraderParse_mainParse( const char *_code );
void KTraderParse_setParseTree( void *_ptr1 ); void TDETraderParse_setParseTree( void *_ptr1 );
void KTraderParse_error( const char* err ); void TDETraderParse_error( const char* err );
void* KTraderParse_newOR( void *_ptr1, void *_ptr2 ); void* TDETraderParse_newOR( void *_ptr1, void *_ptr2 );
void* KTraderParse_newAND( void *_ptr1, void *_ptr2 ); void* TDETraderParse_newAND( void *_ptr1, void *_ptr2 );
void* KTraderParse_newCMP( void *_ptr1, void *_ptr2, int _i ); void* TDETraderParse_newCMP( void *_ptr1, void *_ptr2, int _i );
void* KTraderParse_newIN( void *_ptr1, void *_ptr2 ); void* TDETraderParse_newIN( void *_ptr1, void *_ptr2 );
void* KTraderParse_newMATCH( void *_ptr1, void *_ptr2 ); void* TDETraderParse_newMATCH( void *_ptr1, void *_ptr2 );
void* KTraderParse_newCALC( void *_ptr1, void *_ptr2, int _i ); void* TDETraderParse_newCALC( void *_ptr1, void *_ptr2, int _i );
void* KTraderParse_newBRACKETS( void *_ptr1 ); void* TDETraderParse_newBRACKETS( void *_ptr1 );
void* KTraderParse_newNOT( void *_ptr1 ); void* TDETraderParse_newNOT( void *_ptr1 );
void* KTraderParse_newEXIST( char *_ptr1 ); void* TDETraderParse_newEXIST( char *_ptr1 );
void* KTraderParse_newID( char *_ptr1 ); void* TDETraderParse_newID( char *_ptr1 );
void* KTraderParse_newSTRING( char *_ptr1 ); void* TDETraderParse_newSTRING( char *_ptr1 );
void* KTraderParse_newNUM( int _i ); void* TDETraderParse_newNUM( int _i );
void* KTraderParse_newFLOAT( float _f ); void* TDETraderParse_newFLOAT( float _f );
void* KTraderParse_newBOOL( char _b ); void* TDETraderParse_newBOOL( char _b );
void* KTraderParse_newWITH( void *_ptr1 ); void* TDETraderParse_newWITH( void *_ptr1 );
void* KTraderParse_newMAX( void *_ptr1 ); void* TDETraderParse_newMAX( void *_ptr1 );
void* KTraderParse_newMIN( void *_ptr1 ); void* TDETraderParse_newMIN( void *_ptr1 );
void* KTraderParse_newMAX2( char *_id ); void* TDETraderParse_newMAX2( char *_id );
void* KTraderParse_newMIN2( char *_id ); void* TDETraderParse_newMIN2( char *_id );
void* KTraderParse_newFIRST(); void* TDETraderParse_newFIRST();
void* KTraderParse_newRANDOM(); void* TDETraderParse_newRANDOM();
#endif #endif

@ -426,10 +426,10 @@ TQStringList KURIFilter::pluginNames() const
void KURIFilter::loadPlugins() void KURIFilter::loadPlugins()
{ {
KTrader::OfferList offers = KTrader::self()->query( "KURIFilter/Plugin" ); TDETrader::OfferList offers = TDETrader::self()->query( "KURIFilter/Plugin" );
KTrader::OfferList::ConstIterator it = offers.begin(); TDETrader::OfferList::ConstIterator it = offers.begin();
KTrader::OfferList::ConstIterator end = offers.end(); TDETrader::OfferList::ConstIterator end = offers.end();
for (; it != end; ++it ) for (; it != end; ++it )
{ {

@ -105,13 +105,13 @@ private:
* of a service type. * of a service type.
* It consists of a list of services (service offers) for the service type * It consists of a list of services (service offers) for the service type
* that is sorted by the user's preference. * that is sorted by the user's preference.
* KTrader uses KServiceTypeProfile to sort its results, so usually * TDETrader uses KServiceTypeProfile to sort its results, so usually
* you can just use KTrader to find the user's preferred service. * you can just use TDETrader to find the user's preferred service.
* *
* @see KService * @see KService
* @see KServiceType * @see KServiceType
* @see KServiceOffer * @see KServiceOffer
* @see KTrader * @see TDETrader
* @short Represents the user's preferences for services of a service type * @short Represents the user's preferences for services of a service type
*/ */
class TDEIO_EXPORT KServiceTypeProfile class TDEIO_EXPORT KServiceTypeProfile
@ -168,12 +168,12 @@ public:
/** /**
* Returns the offers associated with a given servicetype, sorted by preference. * Returns the offers associated with a given servicetype, sorted by preference.
* This is what KTrader uses to get the list of offers, before applying the * This is what TDETrader uses to get the list of offers, before applying the
* constraints and preferences. * constraints and preferences.
* *
* If @p genericServiceType is specified, a list is returned with * If @p genericServiceType is specified, a list is returned with
* the offers associated with the combination of the two service types. * the offers associated with the combination of the two service types.
* This is almost like an "foo in ServiceTypes" constraint in the KTrader, * This is almost like an "foo in ServiceTypes" constraint in the TDETrader,
* but the difference is that to order the offers, we will look at entries * but the difference is that to order the offers, we will look at entries
* specifically for those two service types. Typically, this is used for * specifically for those two service types. Typically, this is used for
* getting the list of embeddable components that can handle a given mimetype. * getting the list of embeddable components that can handle a given mimetype.

@ -436,12 +436,12 @@ char *yytext;
#include <stdlib.h> #include <stdlib.h>
#define YY_NO_UNPUT #define YY_NO_UNPUT
char* KTraderParse_putSymbol( char *_name ); char* TDETraderParse_putSymbol( char *_name );
char *KTraderParse_putSymbolInBrackets( char *_name ); char *TDETraderParse_putSymbolInBrackets( char *_name );
char* KTraderParse_putString( char *_name ); char* TDETraderParse_putString( char *_name );
int yywrap(); int yywrap();
int kiotraderlex(void); int kiotraderlex(void);
void KTraderParse_initFlex( const char *_code ); void TDETraderParse_initFlex( const char *_code );
#line 447 "lex.c" #line 447 "lex.c"
@ -763,7 +763,7 @@ YY_RULE_SETUP
case 17: case 17:
YY_RULE_SETUP YY_RULE_SETUP
#line 42 "lex.l" #line 42 "lex.l"
{ yylval.name = KTraderParse_putString( yytext ); return VAL_STRING; } { yylval.name = TDETraderParse_putString( yytext ); return VAL_STRING; }
YY_BREAK YY_BREAK
case 18: case 18:
YY_RULE_SETUP YY_RULE_SETUP
@ -783,12 +783,12 @@ YY_RULE_SETUP
case 21: case 21:
YY_RULE_SETUP YY_RULE_SETUP
#line 49 "lex.l" #line 49 "lex.l"
{ yylval.name = KTraderParse_putSymbolInBrackets( yytext ); return VAL_ID; } { yylval.name = TDETraderParse_putSymbolInBrackets( yytext ); return VAL_ID; }
YY_BREAK YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 51 "lex.l" #line 51 "lex.l"
{ yylval.name = KTraderParse_putSymbol( yytext ); return VAL_ID; } { yylval.name = TDETraderParse_putSymbol( yytext ); return VAL_ID; }
YY_BREAK YY_BREAK
case 23: case 23:
YY_RULE_SETUP YY_RULE_SETUP
@ -1689,7 +1689,7 @@ int main()
#line 57 "lex.l" #line 57 "lex.l"
char* KTraderParse_putSymbolInBrackets( char *_name ) char* TDETraderParse_putSymbolInBrackets( char *_name )
{ {
int l = strlen( _name )-1; int l = strlen( _name )-1;
char *p = (char *)malloc( l ); char *p = (char *)malloc( l );
@ -1702,7 +1702,7 @@ char* KTraderParse_putSymbolInBrackets( char *_name )
return p; return p;
} }
char *KTraderParse_putSymbol( char *_name ) char *TDETraderParse_putSymbol( char *_name )
{ {
char *p = (char*)malloc( strlen( _name ) + 1 ); char *p = (char*)malloc( strlen( _name ) + 1 );
if (p != NULL) if (p != NULL)
@ -1712,7 +1712,7 @@ char *KTraderParse_putSymbol( char *_name )
return p; return p;
} }
char* KTraderParse_putString( char *_str ) char* TDETraderParse_putString( char *_str )
{ {
int l = strlen( _str ); int l = strlen( _str );
char *p = (char*)malloc( l ); char *p = (char*)malloc( l );
@ -1747,7 +1747,7 @@ char* KTraderParse_putString( char *_str )
return p; return p;
} }
void KTraderParse_initFlex( const char *_code ) void TDETraderParse_initFlex( const char *_code )
{ {
yy_switch_to_buffer( yy_scan_string( _code ) ); yy_switch_to_buffer( yy_scan_string( _code ) );
} }

@ -7,12 +7,12 @@
#include <stdlib.h> #include <stdlib.h>
#define YY_NO_UNPUT #define YY_NO_UNPUT
char* KTraderParse_putSymbol( char *_name ); char* TDETraderParse_putSymbol( char *_name );
char *KTraderParse_putSymbolInBrackets( char *_name ); char *TDETraderParse_putSymbolInBrackets( char *_name );
char* KTraderParse_putString( char *_name ); char* TDETraderParse_putString( char *_name );
int yywrap(); int yywrap();
int kiotraderlex(void); int kiotraderlex(void);
void KTraderParse_initFlex( const char *_code ); void TDETraderParse_initFlex( const char *_code );
%} %}
@ -39,16 +39,16 @@ DIGIT [0-9]
"TRUE" { yylval.valb = 1; return VAL_BOOL; } "TRUE" { yylval.valb = 1; return VAL_BOOL; }
"FALSE" { yylval.valb = 0; return VAL_BOOL; } "FALSE" { yylval.valb = 0; return VAL_BOOL; }
"'"[^']*"'" { yylval.name = KTraderParse_putString( yytext ); return VAL_STRING; } "'"[^']*"'" { yylval.name = TDETraderParse_putString( yytext ); return VAL_STRING; }
"-"{DIGIT}+ { yylval.vali = atoi( yytext ); return VAL_NUM; } "-"{DIGIT}+ { yylval.vali = atoi( yytext ); return VAL_NUM; }
{DIGIT}+ { yylval.vali = atoi( yytext ); return VAL_NUM; } {DIGIT}+ { yylval.vali = atoi( yytext ); return VAL_NUM; }
{DIGIT}*"\."{DIGIT}+ { yylval.vald = atof( yytext ); return VAL_FLOAT; } {DIGIT}*"\."{DIGIT}+ { yylval.vald = atof( yytext ); return VAL_FLOAT; }
\[[a-zA-Z][a-zA-Z0-9\-]*\] { yylval.name = KTraderParse_putSymbolInBrackets( yytext ); return VAL_ID; } \[[a-zA-Z][a-zA-Z0-9\-]*\] { yylval.name = TDETraderParse_putSymbolInBrackets( yytext ); return VAL_ID; }
[a-zA-Z][a-zA-Z0-9]* { yylval.name = KTraderParse_putSymbol( yytext ); return VAL_ID; } [a-zA-Z][a-zA-Z0-9]* { yylval.name = TDETraderParse_putSymbol( yytext ); return VAL_ID; }
[ \t\n]+ /* eat up whitespace */ [ \t\n]+ /* eat up whitespace */
@ -56,7 +56,7 @@ DIGIT [0-9]
%% %%
char* KTraderParse_putSymbolInBrackets( char *_name ) char* TDETraderParse_putSymbolInBrackets( char *_name )
{ {
int l = strlen( _name )-1; int l = strlen( _name )-1;
char *p = (char *)malloc( l ); char *p = (char *)malloc( l );
@ -69,7 +69,7 @@ char* KTraderParse_putSymbolInBrackets( char *_name )
return p; return p;
} }
char *KTraderParse_putSymbol( char *_name ) char *TDETraderParse_putSymbol( char *_name )
{ {
char *p = (char*)malloc( strlen( _name ) + 1 ); char *p = (char*)malloc( strlen( _name ) + 1 );
if (p != NULL) if (p != NULL)
@ -79,7 +79,7 @@ char *KTraderParse_putSymbol( char *_name )
return p; return p;
} }
char* KTraderParse_putString( char *_str ) char* TDETraderParse_putString( char *_str )
{ {
int l = strlen( _str ); int l = strlen( _str );
char *p = (char*)malloc( l ); char *p = (char*)malloc( l );
@ -114,7 +114,7 @@ char* KTraderParse_putString( char *_str )
return p; return p;
} }
void KTraderParse_initFlex( const char *_code ) void TDETraderParse_initFlex( const char *_code )
{ {
yy_switch_to_buffer( yy_scan_string( _code ) ); yy_switch_to_buffer( yy_scan_string( _code ) );
} }

@ -154,8 +154,8 @@ void MetaInfoJob::slotMetaInfo(TDEIO::Job*, const TQByteArray &data)
TQStringList MetaInfoJob::availablePlugins() TQStringList MetaInfoJob::availablePlugins()
{ {
TQStringList result; TQStringList result;
KTrader::OfferList plugins = KTrader::self()->query("KFilePlugin"); TDETrader::OfferList plugins = TDETrader::self()->query("KFilePlugin");
for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
result.append((*it)->desktopEntryName()); result.append((*it)->desktopEntryName());
return result; return result;
} }
@ -163,8 +163,8 @@ TQStringList MetaInfoJob::availablePlugins()
TQStringList MetaInfoJob::supportedMimeTypes() TQStringList MetaInfoJob::supportedMimeTypes()
{ {
TQStringList result; TQStringList result;
KTrader::OfferList plugins = KTrader::self()->query("KFilePlugin"); TDETrader::OfferList plugins = TDETrader::self()->query("KFilePlugin");
for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
result += (*it)->property("MimeTypes").toStringList(); result += (*it)->property("MimeTypes").toStringList();
return result; return result;
} }

@ -159,10 +159,10 @@ PreviewJob::~PreviewJob()
void PreviewJob::startPreview() void PreviewJob::startPreview()
{ {
// Load the list of plugins to determine which mimetypes are supported // Load the list of plugins to determine which mimetypes are supported
KTrader::OfferList plugins = KTrader::self()->query("ThumbCreator"); TDETrader::OfferList plugins = TDETrader::self()->query("ThumbCreator");
TQMap<TQString, KService::Ptr> mimeMap; TQMap<TQString, KService::Ptr> mimeMap;
for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
if (!d->enabledPlugins || d->enabledPlugins->contains((*it)->desktopEntryName())) if (!d->enabledPlugins || d->enabledPlugins->contains((*it)->desktopEntryName()))
{ {
TQStringList mimeTypes = (*it)->property("MimeTypes").toStringList(); TQStringList mimeTypes = (*it)->property("MimeTypes").toStringList();
@ -551,8 +551,8 @@ void PreviewJob::emitFailed(const KFileItem *item)
TQStringList PreviewJob::availablePlugins() TQStringList PreviewJob::availablePlugins()
{ {
TQStringList result; TQStringList result;
KTrader::OfferList plugins = KTrader::self()->query("ThumbCreator"); TDETrader::OfferList plugins = TDETrader::self()->query("ThumbCreator");
for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
if (!result.contains((*it)->desktopEntryName())) if (!result.contains((*it)->desktopEntryName()))
result.append((*it)->desktopEntryName()); result.append((*it)->desktopEntryName());
return result; return result;
@ -561,8 +561,8 @@ TQStringList PreviewJob::availablePlugins()
TQStringList PreviewJob::supportedMimeTypes() TQStringList PreviewJob::supportedMimeTypes()
{ {
TQStringList result; TQStringList result;
KTrader::OfferList plugins = KTrader::self()->query("ThumbCreator"); TDETrader::OfferList plugins = TDETrader::self()->query("ThumbCreator");
for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
result += (*it)->property("MimeTypes").toStringList(); result += (*it)->property("MimeTypes").toStringList();
return result; return result;
} }

@ -168,17 +168,17 @@ RenameDlg::RenameDlg(TQWidget *parent, const TQString & _caption,
// Figure out the mimetype and load one plugin // Figure out the mimetype and load one plugin
// (This is the only mode that is handled by plugins) // (This is the only mode that is handled by plugins)
pluginHandling(); pluginHandling();
KTrader::OfferList plugin_offers; TDETrader::OfferList plugin_offers;
if( d->mimeSrc != KMimeType::defaultMimeType() ){ if( d->mimeSrc != KMimeType::defaultMimeType() ){
plugin_offers = KTrader::self()->query(d->mimeSrc, "'RenameDlg/Plugin' in ServiceTypes"); plugin_offers = TDETrader::self()->query(d->mimeSrc, "'RenameDlg/Plugin' in ServiceTypes");
}else if(d->mimeDest != KMimeType::defaultMimeType() ) { }else if(d->mimeDest != KMimeType::defaultMimeType() ) {
plugin_offers = KTrader::self()->query(d->mimeDest, "'RenameDlg/Plugin' in ServiceTypes"); plugin_offers = TDETrader::self()->query(d->mimeDest, "'RenameDlg/Plugin' in ServiceTypes");
} }
if(!plugin_offers.isEmpty() ){ if(!plugin_offers.isEmpty() ){
kdDebug(7024) << "Offers" << endl; kdDebug(7024) << "Offers" << endl;
KTrader::OfferList::ConstIterator it = plugin_offers.begin(); TDETrader::OfferList::ConstIterator it = plugin_offers.begin();
KTrader::OfferList::ConstIterator end = plugin_offers.end(); TDETrader::OfferList::ConstIterator end = plugin_offers.end();
for( ; it != end; ++it ){ for( ; it != end; ++it ){
TQString libName = (*it)->library(); TQString libName = (*it)->library();
if( libName.isEmpty() ){ if( libName.isEmpty() ){

@ -942,7 +942,7 @@ KFilePlugin* KFileMetaInfoProvider::loadPlugin( const TQString& mimeType, const
queryMimeType = "KFilePlugin"; queryMimeType = "KFilePlugin";
// hopefully using KFilePlugin as genericMimeType too isn't a problem // hopefully using KFilePlugin as genericMimeType too isn't a problem
} }
const KTrader::OfferList offers = KTrader::self()->query( queryMimeType, "KFilePlugin", query, TQString::null ); const TDETrader::OfferList offers = TDETrader::self()->query( queryMimeType, "KFilePlugin", query, TQString::null );
if ( offers.isEmpty() ) if ( offers.isEmpty() )
return 0; return 0;
KService::Ptr service = *(offers.begin()); KService::Ptr service = *(offers.begin());
@ -1122,8 +1122,8 @@ TQStringList KFileMetaInfoProvider::supportedMimeTypes() const
TQStringList allMimeTypes; TQStringList allMimeTypes;
TQString tdefilePlugin = "KFilePlugin"; TQString tdefilePlugin = "KFilePlugin";
KTrader::OfferList offers = KTrader::self()->query( "KFilePlugin" ); TDETrader::OfferList offers = TDETrader::self()->query( "KFilePlugin" );
KTrader::OfferListIterator it = offers.begin(); TDETrader::OfferListIterator it = offers.begin();
for ( ; it != offers.end(); ++it ) for ( ; it != offers.end(); ++it )
{ {
const TQStringList mimeTypes = (*it)->serviceTypes(); const TQStringList mimeTypes = (*it)->serviceTypes();

@ -113,7 +113,7 @@
void yyerror(const char *s); void yyerror(const char *s);
int yylex(); int yylex();
void KTraderParse_initFlex( const char *s ); void TDETraderParse_initFlex( const char *s );
@ -1101,12 +1101,12 @@ yyreduce:
{ {
case 2: case 2:
#line 56 "yacc.y" #line 56 "yacc.y"
{ KTraderParse_setParseTree( 0L ); ;} { TDETraderParse_setParseTree( 0L ); ;}
break; break;
case 3: case 3:
#line 57 "yacc.y" #line 57 "yacc.y"
{ KTraderParse_setParseTree( (yyvsp[0].ptr) ); ;} { TDETraderParse_setParseTree( (yyvsp[0].ptr) ); ;}
break; break;
case 4: case 4:
@ -1116,7 +1116,7 @@ yyreduce:
case 5: case 5:
#line 63 "yacc.y" #line 63 "yacc.y"
{ (yyval.ptr) = KTraderParse_newOR( (yyvsp[-2].ptr), (yyvsp[0].ptr) ); ;} { (yyval.ptr) = TDETraderParse_newOR( (yyvsp[-2].ptr), (yyvsp[0].ptr) ); ;}
break; break;
case 6: case 6:
@ -1126,7 +1126,7 @@ yyreduce:
case 7: case 7:
#line 67 "yacc.y" #line 67 "yacc.y"
{ (yyval.ptr) = KTraderParse_newAND( (yyvsp[-2].ptr), (yyvsp[0].ptr) ); ;} { (yyval.ptr) = TDETraderParse_newAND( (yyvsp[-2].ptr), (yyvsp[0].ptr) ); ;}
break; break;
case 8: case 8:
@ -1136,32 +1136,32 @@ yyreduce:
case 9: case 9:
#line 71 "yacc.y" #line 71 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 1 ); ;} { (yyval.ptr) = TDETraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 1 ); ;}
break; break;
case 10: case 10:
#line 72 "yacc.y" #line 72 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 2 ); ;} { (yyval.ptr) = TDETraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 2 ); ;}
break; break;
case 11: case 11:
#line 73 "yacc.y" #line 73 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 3 ); ;} { (yyval.ptr) = TDETraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 3 ); ;}
break; break;
case 12: case 12:
#line 74 "yacc.y" #line 74 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 4 ); ;} { (yyval.ptr) = TDETraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 4 ); ;}
break; break;
case 13: case 13:
#line 75 "yacc.y" #line 75 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 5 ); ;} { (yyval.ptr) = TDETraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 5 ); ;}
break; break;
case 14: case 14:
#line 76 "yacc.y" #line 76 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 6 ); ;} { (yyval.ptr) = TDETraderParse_newCMP( (yyvsp[-2].ptr), (yyvsp[0].ptr), 6 ); ;}
break; break;
case 15: case 15:
@ -1171,7 +1171,7 @@ yyreduce:
case 16: case 16:
#line 80 "yacc.y" #line 80 "yacc.y"
{ (yyval.ptr) = KTraderParse_newIN( (yyvsp[-2].ptr), KTraderParse_newID( (yyvsp[0].name) ) ); ;} { (yyval.ptr) = TDETraderParse_newIN( (yyvsp[-2].ptr), TDETraderParse_newID( (yyvsp[0].name) ) ); ;}
break; break;
case 17: case 17:
@ -1181,7 +1181,7 @@ yyreduce:
case 18: case 18:
#line 84 "yacc.y" #line 84 "yacc.y"
{ (yyval.ptr) = KTraderParse_newMATCH( (yyvsp[-2].ptr), (yyvsp[0].ptr) ); ;} { (yyval.ptr) = TDETraderParse_newMATCH( (yyvsp[-2].ptr), (yyvsp[0].ptr) ); ;}
break; break;
case 19: case 19:
@ -1191,12 +1191,12 @@ yyreduce:
case 20: case 20:
#line 88 "yacc.y" #line 88 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 1 ); ;} { (yyval.ptr) = TDETraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 1 ); ;}
break; break;
case 21: case 21:
#line 89 "yacc.y" #line 89 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 2 ); ;} { (yyval.ptr) = TDETraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 2 ); ;}
break; break;
case 22: case 22:
@ -1206,12 +1206,12 @@ yyreduce:
case 23: case 23:
#line 93 "yacc.y" #line 93 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 3 ); ;} { (yyval.ptr) = TDETraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 3 ); ;}
break; break;
case 24: case 24:
#line 94 "yacc.y" #line 94 "yacc.y"
{ (yyval.ptr) = KTraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 4 ); ;} { (yyval.ptr) = TDETraderParse_newCALC( (yyvsp[-2].ptr), (yyvsp[0].ptr), 4 ); ;}
break; break;
case 25: case 25:
@ -1221,7 +1221,7 @@ yyreduce:
case 26: case 26:
#line 98 "yacc.y" #line 98 "yacc.y"
{ (yyval.ptr) = KTraderParse_newNOT( (yyvsp[0].ptr) ); ;} { (yyval.ptr) = TDETraderParse_newNOT( (yyvsp[0].ptr) ); ;}
break; break;
case 27: case 27:
@ -1231,47 +1231,47 @@ yyreduce:
case 28: case 28:
#line 102 "yacc.y" #line 102 "yacc.y"
{ (yyval.ptr) = KTraderParse_newBRACKETS( (yyvsp[-1].ptr) ); ;} { (yyval.ptr) = TDETraderParse_newBRACKETS( (yyvsp[-1].ptr) ); ;}
break; break;
case 29: case 29:
#line 103 "yacc.y" #line 103 "yacc.y"
{ (yyval.ptr) = KTraderParse_newEXIST( (yyvsp[0].name) ); ;} { (yyval.ptr) = TDETraderParse_newEXIST( (yyvsp[0].name) ); ;}
break; break;
case 30: case 30:
#line 104 "yacc.y" #line 104 "yacc.y"
{ (yyval.ptr) = KTraderParse_newID( (yyvsp[0].name) ); ;} { (yyval.ptr) = TDETraderParse_newID( (yyvsp[0].name) ); ;}
break; break;
case 31: case 31:
#line 105 "yacc.y" #line 105 "yacc.y"
{ (yyval.ptr) = KTraderParse_newNUM( (yyvsp[0].vali) ); ;} { (yyval.ptr) = TDETraderParse_newNUM( (yyvsp[0].vali) ); ;}
break; break;
case 32: case 32:
#line 106 "yacc.y" #line 106 "yacc.y"
{ (yyval.ptr) = KTraderParse_newFLOAT( (yyvsp[0].vald) ); ;} { (yyval.ptr) = TDETraderParse_newFLOAT( (yyvsp[0].vald) ); ;}
break; break;
case 33: case 33:
#line 107 "yacc.y" #line 107 "yacc.y"
{ (yyval.ptr) = KTraderParse_newSTRING( (yyvsp[0].name) ); ;} { (yyval.ptr) = TDETraderParse_newSTRING( (yyvsp[0].name) ); ;}
break; break;
case 34: case 34:
#line 108 "yacc.y" #line 108 "yacc.y"
{ (yyval.ptr) = KTraderParse_newBOOL( (yyvsp[0].valb) ); ;} { (yyval.ptr) = TDETraderParse_newBOOL( (yyvsp[0].valb) ); ;}
break; break;
case 35: case 35:
#line 109 "yacc.y" #line 109 "yacc.y"
{ (yyval.ptr) = KTraderParse_newMAX2( (yyvsp[0].name) ); ;} { (yyval.ptr) = TDETraderParse_newMAX2( (yyvsp[0].name) ); ;}
break; break;
case 36: case 36:
#line 110 "yacc.y" #line 110 "yacc.y"
{ (yyval.ptr) = KTraderParse_newMIN2( (yyvsp[0].name) ); ;} { (yyval.ptr) = TDETraderParse_newMIN2( (yyvsp[0].name) ); ;}
break; break;
@ -1511,12 +1511,12 @@ yyreturn:
void yyerror ( const char *s ) /* Called by yyparse on error */ void yyerror ( const char *s ) /* Called by yyparse on error */
{ {
KTraderParse_error( s ); TDETraderParse_error( s );
} }
void KTraderParse_mainParse( const char *_code ) void TDETraderParse_mainParse( const char *_code )
{ {
KTraderParse_initFlex( _code ); TDETraderParse_initFlex( _code );
yyparse(); yyparse();
} }

@ -5,7 +5,7 @@
void yyerror(const char *s); void yyerror(const char *s);
int yylex(); int yylex();
void KTraderParse_initFlex( const char *s ); void TDETraderParse_initFlex( const char *s );
%} %}
@ -53,61 +53,61 @@ void KTraderParse_initFlex( const char *s );
%% %%
constraint: /* empty */ { KTraderParse_setParseTree( 0L ); } constraint: /* empty */ { TDETraderParse_setParseTree( 0L ); }
| bool { KTraderParse_setParseTree( $<ptr>1 ); } | bool { TDETraderParse_setParseTree( $<ptr>1 ); }
; ;
bool: bool_or { $$ = $<ptr>1; } bool: bool_or { $$ = $<ptr>1; }
; ;
bool_or: bool_and OR bool_or { $$ = KTraderParse_newOR( $<ptr>1, $<ptr>3 ); } bool_or: bool_and OR bool_or { $$ = TDETraderParse_newOR( $<ptr>1, $<ptr>3 ); }
| bool_and { $$ = $<ptr>1; } | bool_and { $$ = $<ptr>1; }
; ;
bool_and: bool_compare AND bool_and { $$ = KTraderParse_newAND( $<ptr>1, $<ptr>3 ); } bool_and: bool_compare AND bool_and { $$ = TDETraderParse_newAND( $<ptr>1, $<ptr>3 ); }
| bool_compare { $$ = $<ptr>1; } | bool_compare { $$ = $<ptr>1; }
; ;
bool_compare: expr_in EQ expr_in { $$ = KTraderParse_newCMP( $<ptr>1, $<ptr>3, 1 ); } bool_compare: expr_in EQ expr_in { $$ = TDETraderParse_newCMP( $<ptr>1, $<ptr>3, 1 ); }
| expr_in NEQ expr_in { $$ = KTraderParse_newCMP( $<ptr>1, $<ptr>3, 2 ); } | expr_in NEQ expr_in { $$ = TDETraderParse_newCMP( $<ptr>1, $<ptr>3, 2 ); }
| expr_in GEQ expr_in { $$ = KTraderParse_newCMP( $<ptr>1, $<ptr>3, 3 ); } | expr_in GEQ expr_in { $$ = TDETraderParse_newCMP( $<ptr>1, $<ptr>3, 3 ); }
| expr_in LEQ expr_in { $$ = KTraderParse_newCMP( $<ptr>1, $<ptr>3, 4 ); } | expr_in LEQ expr_in { $$ = TDETraderParse_newCMP( $<ptr>1, $<ptr>3, 4 ); }
| expr_in LE expr_in { $$ = KTraderParse_newCMP( $<ptr>1, $<ptr>3, 5 ); } | expr_in LE expr_in { $$ = TDETraderParse_newCMP( $<ptr>1, $<ptr>3, 5 ); }
| expr_in GR expr_in { $$ = KTraderParse_newCMP( $<ptr>1, $<ptr>3, 6 ); } | expr_in GR expr_in { $$ = TDETraderParse_newCMP( $<ptr>1, $<ptr>3, 6 ); }
| expr_in { $$ = $<ptr>1; } | expr_in { $$ = $<ptr>1; }
; ;
expr_in: expr_twiddle TOKEN_IN VAL_ID { $$ = KTraderParse_newIN( $<ptr>1, KTraderParse_newID( $<name>3 ) ); } expr_in: expr_twiddle TOKEN_IN VAL_ID { $$ = TDETraderParse_newIN( $<ptr>1, TDETraderParse_newID( $<name>3 ) ); }
| expr_twiddle { $$ = $<ptr>1; } | expr_twiddle { $$ = $<ptr>1; }
; ;
expr_twiddle: expr '~' expr { $$ = KTraderParse_newMATCH( $<ptr>1, $<ptr>3 ); } expr_twiddle: expr '~' expr { $$ = TDETraderParse_newMATCH( $<ptr>1, $<ptr>3 ); }
| expr { $$ = $<ptr>1; } | expr { $$ = $<ptr>1; }
; ;
expr: expr '+' term { $$ = KTraderParse_newCALC( $<ptr>1, $<ptr>3, 1 ); } expr: expr '+' term { $$ = TDETraderParse_newCALC( $<ptr>1, $<ptr>3, 1 ); }
| expr '-' term { $$ = KTraderParse_newCALC( $<ptr>1, $<ptr>3, 2 ); } | expr '-' term { $$ = TDETraderParse_newCALC( $<ptr>1, $<ptr>3, 2 ); }
| term { $$ = $<ptr>1; } | term { $$ = $<ptr>1; }
; ;
term: term '*' factor_non { $$ = KTraderParse_newCALC( $<ptr>1, $<ptr>3, 3 ); } term: term '*' factor_non { $$ = TDETraderParse_newCALC( $<ptr>1, $<ptr>3, 3 ); }
| term '/' factor_non { $$ = KTraderParse_newCALC( $<ptr>1, $<ptr>3, 4 ); } | term '/' factor_non { $$ = TDETraderParse_newCALC( $<ptr>1, $<ptr>3, 4 ); }
| factor_non { $$ = $<ptr>1; } | factor_non { $$ = $<ptr>1; }
; ;
factor_non: NOT factor { $$ = KTraderParse_newNOT( $<ptr>2 ); } factor_non: NOT factor { $$ = TDETraderParse_newNOT( $<ptr>2 ); }
| factor { $$ = $<ptr>1; } | factor { $$ = $<ptr>1; }
; ;
factor: '(' bool_or ')' { $$ = KTraderParse_newBRACKETS( $<ptr>2 ); } factor: '(' bool_or ')' { $$ = TDETraderParse_newBRACKETS( $<ptr>2 ); }
| EXIST VAL_ID { $$ = KTraderParse_newEXIST( $<name>2 ); } | EXIST VAL_ID { $$ = TDETraderParse_newEXIST( $<name>2 ); }
| VAL_ID { $$ = KTraderParse_newID( $<name>1 ); } | VAL_ID { $$ = TDETraderParse_newID( $<name>1 ); }
| VAL_NUM { $$ = KTraderParse_newNUM( $<vali>1 ); } | VAL_NUM { $$ = TDETraderParse_newNUM( $<vali>1 ); }
| VAL_FLOAT { $$ = KTraderParse_newFLOAT( $<vald>1 ); } | VAL_FLOAT { $$ = TDETraderParse_newFLOAT( $<vald>1 ); }
| VAL_STRING { $$ = KTraderParse_newSTRING( $<name>1 ); } | VAL_STRING { $$ = TDETraderParse_newSTRING( $<name>1 ); }
| VAL_BOOL { $$ = KTraderParse_newBOOL( $<valb>1 ); } | VAL_BOOL { $$ = TDETraderParse_newBOOL( $<valb>1 ); }
| MAX VAL_ID { $$ = KTraderParse_newMAX2( $<name>2 ); } | MAX VAL_ID { $$ = TDETraderParse_newMAX2( $<name>2 ); }
| MIN VAL_ID { $$ = KTraderParse_newMIN2( $<name>2 ); } | MIN VAL_ID { $$ = TDETraderParse_newMIN2( $<name>2 ); }
; ;
/* End of grammar */ /* End of grammar */
@ -116,11 +116,11 @@ factor: '(' bool_or ')' { $$ = KTraderParse_newBRACKETS( $<ptr>2 ); }
void yyerror ( const char *s ) /* Called by yyparse on error */ void yyerror ( const char *s ) /* Called by yyparse on error */
{ {
KTraderParse_error( s ); TDETraderParse_error( s );
} }
void KTraderParse_mainParse( const char *_code ) void TDETraderParse_mainParse( const char *_code )
{ {
KTraderParse_initFlex( _code ); TDETraderParse_initFlex( _code );
yyparse(); yyparse();
} }

@ -182,9 +182,9 @@ int main(int argc, char *argv[])
} }
debug("Querying trader for Konqueror/Plugin"); debug("Querying trader for Konqueror/Plugin");
KTrader::OfferList traderoffers = KTrader::self()->query("Konqueror/Plugin"); TDETrader::OfferList traderoffers = TDETrader::self()->query("Konqueror/Plugin");
debug(TQString("got %1 offers").arg(traderoffers.count())); debug(TQString("got %1 offers").arg(traderoffers.count()));
KTrader::OfferList::Iterator trit = traderoffers.begin(); TDETrader::OfferList::Iterator trit = traderoffers.begin();
for ( ; trit != traderoffers.end() ; trit++ ) for ( ; trit != traderoffers.end() ; trit++ )
{ {
debug((*trit)->name()); debug((*trit)->name());

@ -33,7 +33,7 @@ static KCmdLineOptions options[] =
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
TDECmdLineArgs::init( argc, argv, "tdetradertest", "KTradertest", "A KTrader testing tool", "0.0" ); TDECmdLineArgs::init( argc, argv, "tdetradertest", "TDETradertest", "A TDETrader testing tool", "0.0" );
TDECmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
@ -62,13 +62,13 @@ int main( int argc, char **argv )
printf( "constraint is : %s\n", constraint.local8Bit().data() ); printf( "constraint is : %s\n", constraint.local8Bit().data() );
printf( "preference is : %s\n", preference.local8Bit().data() ); printf( "preference is : %s\n", preference.local8Bit().data() );
KTrader::OfferList offers = KTrader::self()->query( query, genericServiceType, constraint, preference ); TDETrader::OfferList offers = TDETrader::self()->query( query, genericServiceType, constraint, preference );
printf("got %d offers.\n", offers.count()); printf("got %d offers.\n", offers.count());
int i = 0; int i = 0;
KTrader::OfferList::ConstIterator it = offers.begin(); TDETrader::OfferList::ConstIterator it = offers.begin();
KTrader::OfferList::ConstIterator end = offers.end(); TDETrader::OfferList::ConstIterator end = offers.end();
for (; it != end; ++it, ++i ) for (; it != end; ++it, ++i )
{ {
printf("---- Offer %d ----\n", i); printf("---- Offer %d ----\n", i);

@ -307,7 +307,7 @@ namespace KParts
* \endcode * \endcode
* *
* @param serviceType the type of service for which to find a plugin * @param serviceType the type of service for which to find a plugin
* @param constraint an optional constraint to pass to the trader (see TDEIO::KTrader) * @param constraint an optional constraint to pass to the trader (see TDEIO::TDETrader)
* @param parent the parent object for the part itself * @param parent the parent object for the part itself
* @param name the name that will be given to the part * @param name the name that will be given to the part
* @param args A list of string arguments, passed to the factory and possibly * @param args A list of string arguments, passed to the factory and possibly
@ -325,7 +325,7 @@ namespace KParts
const TQStringList &args = TQStringList(), const TQStringList &args = TQStringList(),
int *error = 0 ) int *error = 0 )
{ {
KTrader::OfferList offers = KTrader::self()->query( serviceType, constraint ); TDETrader::OfferList offers = TDETrader::self()->query( serviceType, constraint );
if ( offers.isEmpty() ) if ( offers.isEmpty() )
{ {
if ( error ) if ( error )
@ -354,7 +354,7 @@ namespace KParts
* \endcode * \endcode
* *
* @param serviceType the type of service for which to find a part, e.g. a mimetype * @param serviceType the type of service for which to find a part, e.g. a mimetype
* @param constraint an optional constraint to pass to the trader (see KTrader) * @param constraint an optional constraint to pass to the trader (see TDETrader)
* @param parentWidget the parent widget, will be set as the parent of the part's widget * @param parentWidget the parent widget, will be set as the parent of the part's widget
* @param widgetName the name that will be given to the part's widget * @param widgetName the name that will be given to the part's widget
* @param parent the parent object for the part itself * @param parent the parent object for the part itself
@ -376,7 +376,7 @@ namespace KParts
const TQStringList &args = TQStringList(), const TQStringList &args = TQStringList(),
int *error = 0 ) int *error = 0 )
{ {
KTrader::OfferList offers = KTrader::self()->query( serviceType, TQString::fromLatin1("KParts/ReadOnlyPart"), constraint, TQString::null ); TDETrader::OfferList offers = TDETrader::self()->query( serviceType, TQString::fromLatin1("KParts/ReadOnlyPart"), constraint, TQString::null );
if ( offers.isEmpty() ) if ( offers.isEmpty() )
{ {
if ( error ) if ( error )

@ -26,11 +26,11 @@ Shell::Shell()
KAction * paQuit = new KAction( "&Quit" , "exit", 0, this, TQT_SLOT( close() ), actionCollection(), "file_quit" ); KAction * paQuit = new KAction( "&Quit" , "exit", 0, this, TQT_SLOT( close() ), actionCollection(), "file_quit" );
// Try to find a postscript component first // Try to find a postscript component first
KTrader::OfferList offers = KTrader::self()->query("application/postscript", "('KParts/ReadOnlyPart' in ServiceTypes) or ('Browser/View' in ServiceTypes)"); TDETrader::OfferList offers = TDETrader::self()->query("application/postscript", "('KParts/ReadOnlyPart' in ServiceTypes) or ('Browser/View' in ServiceTypes)");
KLibFactory *factory = 0; KLibFactory *factory = 0;
m_gvpart = 0; m_gvpart = 0;
KTrader::OfferList::Iterator it(offers.begin()); TDETrader::OfferList::Iterator it(offers.begin());
for( ; it != offers.end(); ++it) for( ; it != offers.end(); ++it)
{ {
KService::Ptr ptr = (*it); KService::Ptr ptr = (*it);

@ -111,8 +111,8 @@ static KLibFactory* componentFactory()
factory = KLibLoader::self()->factory("libkghostviewpart"); factory = KLibLoader::self()->factory("libkghostviewpart");
if( factory ) if( factory )
return factory; return factory;
KTrader::OfferList offers = KTrader::self()->query(TQString::fromLatin1("application/postscript"), TQString::fromLatin1("KParts/ReadOnlyPart"), TQString::null, TQString::null); TDETrader::OfferList offers = TDETrader::self()->query(TQString::fromLatin1("application/postscript"), TQString::fromLatin1("KParts/ReadOnlyPart"), TQString::null, TQString::null);
for (KTrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it) for (TDETrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it)
{ {
KService::Ptr service = *it; KService::Ptr service = *it;
factory = KLibLoader::self()->factory(TQFile::encodeName(service->library())); factory = KLibLoader::self()->factory(TQFile::encodeName(service->library()));

@ -174,17 +174,17 @@ void ConfigPage::load()
// KDE-3.3 compatibility code: get families from the plugins // KDE-3.3 compatibility code: get families from the plugins
TQStringList compatFamilyNames; TQStringList compatFamilyNames;
const KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin" ); const TDETrader::OfferList plugins = TDETrader::self()->query( "KResources/Plugin" );
KTrader::OfferList::ConstIterator it = plugins.begin(); TDETrader::OfferList::ConstIterator it = plugins.begin();
KTrader::OfferList::ConstIterator end = plugins.end(); TDETrader::OfferList::ConstIterator end = plugins.end();
for ( ; it != end; ++it ) { for ( ; it != end; ++it ) {
const TQString family = (*it)->property( "X-TDE-ResourceFamily" ).toString(); const TQString family = (*it)->property( "X-TDE-ResourceFamily" ).toString();
if ( compatFamilyNames.find( family ) == compatFamilyNames.end() ) if ( compatFamilyNames.find( family ) == compatFamilyNames.end() )
compatFamilyNames.append( family ); compatFamilyNames.append( family );
} }
const KTrader::OfferList managers = KTrader::self()->query( "KResources/Manager" ); const TDETrader::OfferList managers = TDETrader::self()->query( "KResources/Manager" );
KTrader::OfferList::ConstIterator m_it; TDETrader::OfferList::ConstIterator m_it;
for( m_it = managers.begin(); m_it != managers.end(); ++m_it ) { for( m_it = managers.begin(); m_it != managers.end(); ++m_it ) {
TQString displayName = (*m_it)->property( "Name" ).toString(); TQString displayName = (*m_it)->property( "Name" ).toString();
familyDisplayNames.append( displayName ); familyDisplayNames.append( displayName );

@ -58,9 +58,9 @@ Factory *Factory::self( const TQString& resourceFamily )
Factory::Factory( const TQString& resourceFamily ) : Factory::Factory( const TQString& resourceFamily ) :
mResourceFamily( resourceFamily ) mResourceFamily( resourceFamily )
{ {
KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", TQString( "[X-TDE-ResourceFamily] == '%1'" ) TDETrader::OfferList plugins = TDETrader::self()->query( "KResources/Plugin", TQString( "[X-TDE-ResourceFamily] == '%1'" )
.arg( resourceFamily ) ); .arg( resourceFamily ) );
KTrader::OfferList::ConstIterator it; TDETrader::OfferList::ConstIterator it;
for ( it = plugins.begin(); it != plugins.end(); ++it ) { for ( it = plugins.begin(); it != plugins.end(); ++it ) {
TQVariant type = (*it)->property( "X-TDE-ResourceType" ); TQVariant type = (*it)->property( "X-TDE-ResourceType" );
if ( !type.toString().isEmpty() ) if ( !type.toString().isEmpty() )

@ -174,7 +174,7 @@ Settings* Broker::settings() const
void Broker::loadPlugins() void Broker::loadPlugins()
{ {
d->plugins = KPluginInfo::fromServices( d->plugins = KPluginInfo::fromServices(
KTrader::self()->query( "KSpell/Client" ) ); TDETrader::self()->query( "KSpell/Client" ) );
for ( KPluginInfo::List::Iterator itr = d->plugins.begin(); for ( KPluginInfo::List::Iterator itr = d->plugins.begin();
itr != d->plugins.end(); ++itr ) { itr != d->plugins.end(); ++itr ) {

@ -3,7 +3,7 @@ INCLUDES = -I$(top_srcdir)/interfaces/kregexpeditor $(all_includes)
lib_LTLIBRARIES = libtdeutils.la lib_LTLIBRARIES = libtdeutils.la
libtdeutils_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2 libtdeutils_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2
# Needs KTrader # Needs TDETrader
libtdeutils_la_LIBADD = ../tdeio/libtdeio.la ksettings/libksettings.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) $(LIB_X11) libtdeutils_la_LIBADD = ../tdeio/libtdeio.la ksettings/libksettings.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) $(LIB_X11)
libtdeutils_la_SOURCES = kfind.cpp kfinddialog.cpp kreplace.cpp \ libtdeutils_la_SOURCES = kfind.cpp kfinddialog.cpp kreplace.cpp \

@ -276,7 +276,7 @@ const TQValueList<KService::Ptr> & KPluginInfo::kcmServices() const
{ {
if ( !d->kcmservicesCached ) if ( !d->kcmservicesCached )
{ {
d->kcmservices = KTrader::self()->query( "TDECModule", "'" + d->pluginName + d->kcmservices = TDETrader::self()->query( "TDECModule", "'" + d->pluginName +
"' in [X-TDE-ParentComponents]" ); "' in [X-TDE-ParentComponents]" );
kdDebug( 703 ) << "found " << d->kcmservices.count() << " offers for " << kdDebug( 703 ) << "found " << d->kcmservices.count() << " offers for " <<
d->pluginName << endl; d->pluginName << endl;

@ -467,7 +467,7 @@ TQValueList<KService::Ptr> Dialog::parentComponentsServices(
constraint = "('" + constraint + "' in [X-TDE-ParentComponents])"; constraint = "('" + constraint + "' in [X-TDE-ParentComponents])";
kdDebug( 700 ) << "constraint = " << constraint << endl; kdDebug( 700 ) << "constraint = " << constraint << endl;
return KTrader::self()->query( "TDECModule", constraint ); return TDETrader::self()->query( "TDECModule", constraint );
} }
bool Dialog::isPluginForKCMEnabled( TDECModuleInfo * moduleinfo ) const bool Dialog::isPluginForKCMEnabled( TDECModuleInfo * moduleinfo ) const

Loading…
Cancel
Save