summaryrefslogtreecommitdiffstats
path: root/kded
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kded
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kded')
-rw-r--r--kded/kbuildimageiofactory.cpp18
-rw-r--r--kded/kbuildimageiofactory.h10
-rw-r--r--kded/kbuildprotocolinfofactory.cpp6
-rw-r--r--kded/kbuildprotocolinfofactory.h6
-rw-r--r--kded/kbuildservicefactory.cpp36
-rw-r--r--kded/kbuildservicefactory.h22
-rw-r--r--kded/kbuildservicegroupfactory.cpp20
-rw-r--r--kded/kbuildservicegroupfactory.h18
-rw-r--r--kded/kbuildservicetypefactory.cpp54
-rw-r--r--kded/kbuildservicetypefactory.h14
-rw-r--r--kded/kbuildsycoca.cpp182
-rw-r--r--kded/kbuildsycoca.h24
-rw-r--r--kded/kctimefactory.cpp16
-rw-r--r--kded/kctimefactory.h16
-rw-r--r--kded/kde-menu.cpp16
-rw-r--r--kded/kded.cpp238
-rw-r--r--kded/kded.h58
-rw-r--r--kded/kdedmodule.cpp18
-rw-r--r--kded/kdedmodule.h16
-rw-r--r--kded/khostname.cpp98
-rw-r--r--kded/kresourcelist.h14
-rw-r--r--kded/test/test.cpp12
-rw-r--r--kded/test/test.h6
-rw-r--r--kded/vfolder_menu.cpp458
-rw-r--r--kded/vfolder_menu.h128
25 files changed, 752 insertions, 752 deletions
diff --git a/kded/kbuildimageiofactory.cpp b/kded/kbuildimageiofactory.cpp
index 933ac338a..a0a3ce76e 100644
--- a/kded/kbuildimageiofactory.cpp
+++ b/kded/kbuildimageiofactory.cpp
@@ -38,9 +38,9 @@ KBuildImageIOFactory::KBuildImageIOFactory() :
// return all service types for this factory
// i.e. first arguments to m_resourceList->add() above
-QStringList KBuildImageIOFactory::resourceTypes()
+TQStringList KBuildImageIOFactory::resourceTypes()
{
- return QStringList() << "services";
+ return TQStringList() << "services";
}
KBuildImageIOFactory::~KBuildImageIOFactory()
@@ -49,9 +49,9 @@ KBuildImageIOFactory::~KBuildImageIOFactory()
}
KSycocaEntry *
-KBuildImageIOFactory::createEntry( const QString& file, const char *resource )
+KBuildImageIOFactory::createEntry( const TQString& file, const char *resource )
{
- QString fullPath = locate( resource, file);
+ TQString fullPath = locate( resource, file);
KImageIOFormat *format = new KImageIOFormat(fullPath);
return format;
@@ -87,7 +87,7 @@ KBuildImageIOFactory::addEntry(KSycocaEntry *newEntry, const char *resource)
void
-KBuildImageIOFactory::saveHeader(QDataStream &str)
+KBuildImageIOFactory::saveHeader(TQDataStream &str)
{
KSycocaFactory::saveHeader(str);
@@ -95,15 +95,15 @@ KBuildImageIOFactory::saveHeader(QDataStream &str)
}
void
-KBuildImageIOFactory::save(QDataStream &str)
+KBuildImageIOFactory::save(TQDataStream &str)
{
rPath.sort();
// Remove duplicates from rPath:
- QString last;
- for(QStringList::Iterator it = rPath.begin();
+ TQString last;
+ for(TQStringList::Iterator it = rPath.begin();
it != rPath.end(); )
{
- QStringList::Iterator it2 = it++;
+ TQStringList::Iterator it2 = it++;
if (*it2 == last)
{
// remove duplicate
diff --git a/kded/kbuildimageiofactory.h b/kded/kbuildimageiofactory.h
index 2ca70ef58..65197e17f 100644
--- a/kded/kbuildimageiofactory.h
+++ b/kded/kbuildimageiofactory.h
@@ -20,7 +20,7 @@
#define __k_build_imageio_factory_h__
#include <kimageiofactory.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
/**
* Service group factory for building ksycoca
@@ -39,17 +39,17 @@ public:
/**
* Save header info to database
*/
- virtual void saveHeader(QDataStream &);
+ virtual void saveHeader(TQDataStream &);
/**
* Write out service type specific index files.
*/
- virtual void save(QDataStream &str);
+ virtual void save(TQDataStream &str);
/**
* Create new entry.
*/
- virtual KSycocaEntry* createEntry(const QString &, const char *);
+ virtual KSycocaEntry* createEntry(const TQString &, const char *);
virtual KSycocaEntry * createEntry( int ) { assert(0); return 0L; }
@@ -58,7 +58,7 @@ public:
/**
* Returns all resource types for this service factory
*/
- static QStringList resourceTypes();
+ static TQStringList resourceTypes();
};
#endif
diff --git a/kded/kbuildprotocolinfofactory.cpp b/kded/kbuildprotocolinfofactory.cpp
index 3b1a24bc0..c17b1e772 100644
--- a/kded/kbuildprotocolinfofactory.cpp
+++ b/kded/kbuildprotocolinfofactory.cpp
@@ -37,9 +37,9 @@ KBuildProtocolInfoFactory::KBuildProtocolInfoFactory() :
// return all service types for this factory
// i.e. first arguments to m_resourceList->add() above
-QStringList KBuildProtocolInfoFactory::resourceTypes()
+TQStringList KBuildProtocolInfoFactory::resourceTypes()
{
- return QStringList() << "services";
+ return TQStringList() << "services";
}
KBuildProtocolInfoFactory::~KBuildProtocolInfoFactory()
@@ -48,7 +48,7 @@ KBuildProtocolInfoFactory::~KBuildProtocolInfoFactory()
}
KProtocolInfo *
-KBuildProtocolInfoFactory::createEntry( const QString& file, const char * )
+KBuildProtocolInfoFactory::createEntry( const TQString& file, const char * )
{
return new KProtocolInfo(file);
}
diff --git a/kded/kbuildprotocolinfofactory.h b/kded/kbuildprotocolinfofactory.h
index a83ba7156..e4ddcf6b8 100644
--- a/kded/kbuildprotocolinfofactory.h
+++ b/kded/kbuildprotocolinfofactory.h
@@ -21,7 +21,7 @@
#include <kprotocolinfofactory.h>
#include <assert.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
/**
* Protocol Info factory for building ksycoca
@@ -40,7 +40,7 @@ public:
/**
* Create new entry.
*/
- virtual KProtocolInfo* createEntry(const QString &, const char *);
+ virtual KProtocolInfo* createEntry(const TQString &, const char *);
virtual KProtocolInfo* createEntry(int) { assert(0); return 0L; }
@@ -52,7 +52,7 @@ public:
/**
* Returns all resource types for this service factory
*/
- static QStringList resourceTypes();
+ static TQStringList resourceTypes();
};
#endif
diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp
index 18aef1d29..f8f8c34f1 100644
--- a/kded/kbuildservicefactory.cpp
+++ b/kded/kbuildservicefactory.cpp
@@ -47,9 +47,9 @@ KBuildServiceFactory::KBuildServiceFactory( KSycocaFactory *serviceTypeFactory,
// return all service types for this factory
// i.e. first arguments to m_resourceList->add() above
-QStringList KBuildServiceFactory::resourceTypes()
+TQStringList KBuildServiceFactory::resourceTypes()
{
- return QStringList() << "apps" << "services";
+ return TQStringList() << "apps" << "services";
}
KBuildServiceFactory::~KBuildServiceFactory()
@@ -57,16 +57,16 @@ KBuildServiceFactory::~KBuildServiceFactory()
delete m_resourceList;
}
-KService * KBuildServiceFactory::findServiceByName(const QString &_name)
+KService * KBuildServiceFactory::findServiceByName(const TQString &_name)
{
return m_serviceDict[_name];
}
KSycocaEntry *
-KBuildServiceFactory::createEntry( const QString& file, const char *resource )
+KBuildServiceFactory::createEntry( const TQString& file, const char *resource )
{
- QString name = file;
+ TQString name = file;
int pos = name.findRev('/');
if (pos != -1)
{
@@ -97,7 +97,7 @@ KBuildServiceFactory::createEntry( const QString& file, const char *resource )
void
-KBuildServiceFactory::saveHeader(QDataStream &str)
+KBuildServiceFactory::saveHeader(TQDataStream &str)
{
KSycocaFactory::saveHeader(str);
@@ -109,7 +109,7 @@ KBuildServiceFactory::saveHeader(QDataStream &str)
}
void
-KBuildServiceFactory::save(QDataStream &str)
+KBuildServiceFactory::save(TQDataStream &str)
{
KSycocaFactory::save(str);
@@ -136,19 +136,19 @@ KBuildServiceFactory::save(QDataStream &str)
}
void
-KBuildServiceFactory::saveOfferList(QDataStream &str)
+KBuildServiceFactory::saveOfferList(TQDataStream &str)
{
m_offerListOffset = str.device()->at();
bool isNumber;
- for(QDictIterator<KSycocaEntry::Ptr> itserv ( *m_entryDict );
+ for(TQDictIterator<KSycocaEntry::Ptr> itserv ( *m_entryDict );
itserv.current();
++itserv)
{
KService *service = (KService *) ((KSycocaEntry *)(*itserv.current()));
- QStringList serviceTypeList = service->serviceTypes();
+ TQStringList serviceTypeList = service->serviceTypes();
KServiceType::List serviceTypes;
- QStringList::ConstIterator it = serviceTypeList.begin();
+ TQStringList::ConstIterator it = serviceTypeList.begin();
for( ; it != serviceTypeList.end(); ++it )
{
(*it).toInt(&isNumber);
@@ -178,7 +178,7 @@ KBuildServiceFactory::saveOfferList(QDataStream &str)
}
// For each entry in servicetypeFactory
- for(QDictIterator<KSycocaEntry::Ptr> it ( *(m_serviceTypeFactory->entryDict()) );
+ for(TQDictIterator<KSycocaEntry::Ptr> it ( *(m_serviceTypeFactory->entryDict()) );
it.current();
++it)
{
@@ -199,13 +199,13 @@ KBuildServiceFactory::saveOfferList(QDataStream &str)
}
void
-KBuildServiceFactory::saveInitList(QDataStream &str)
+KBuildServiceFactory::saveInitList(TQDataStream &str)
{
m_initListOffset = str.device()->at();
KService::List initList;
- for(QDictIterator<KSycocaEntry::Ptr> itserv ( *m_entryDict );
+ for(TQDictIterator<KSycocaEntry::Ptr> itserv ( *m_entryDict );
itserv.current();
++itserv)
{
@@ -237,18 +237,18 @@ KBuildServiceFactory::addEntry(KSycocaEntry *newEntry, const char *resource)
if (!service->isDeleted())
{
- QString parent = service->parentApp();
+ TQString parent = service->parentApp();
if (!parent.isEmpty())
m_serviceGroupFactory->addNewChild(parent, resource, service);
}
- QString name = service->desktopEntryName();
+ TQString name = service->desktopEntryName();
m_nameDict->add( name, newEntry );
m_serviceDict.replace(name, service);
- QString relName = service->desktopEntryPath();
+ TQString relName = service->desktopEntryPath();
m_relNameDict->add( relName, newEntry );
- QString menuId = service->menuId();
+ TQString menuId = service->menuId();
if (!menuId.isEmpty())
m_menuIdDict->add( menuId, newEntry );
}
diff --git a/kded/kbuildservicefactory.h b/kded/kbuildservicefactory.h
index f777aaa6e..eca439c5d 100644
--- a/kded/kbuildservicefactory.h
+++ b/kded/kbuildservicefactory.h
@@ -21,8 +21,8 @@
#ifndef __k_build_service_factory_h__
#define __k_build_service_factory_h__
-#include <qptrdict.h>
-#include <qstringlist.h>
+#include <tqptrdict.h>
+#include <tqstringlist.h>
#include <kservicefactory.h>
// We export the services to the service group factory!
@@ -43,12 +43,12 @@ public:
virtual ~KBuildServiceFactory();
- KService *findServiceByName(const QString &_name);
+ KService *findServiceByName(const TQString &_name);
/**
* Construct a KService from a config file.
*/
- virtual KSycocaEntry * createEntry(const QString &file, const char *resource);
+ virtual KSycocaEntry * createEntry(const TQString &file, const char *resource);
virtual KService * createEntry( int ) { assert(0); return 0L; }
@@ -60,7 +60,7 @@ public:
/**
* Write out service specific index files.
*/
- virtual void save(QDataStream &str);
+ virtual void save(TQDataStream &str);
/**
* Write out header information
@@ -68,18 +68,18 @@ public:
* Don't forget to call the parent first when you override
* this function.
*/
- virtual void saveHeader(QDataStream &str);
+ virtual void saveHeader(TQDataStream &str);
/**
* Returns all resource types for this service factory
*/
- static QStringList resourceTypes();
+ static TQStringList resourceTypes();
private:
- void saveOfferList(QDataStream &str);
- void saveInitList(QDataStream &str);
+ void saveOfferList(TQDataStream &str);
+ void saveInitList(TQDataStream &str);
- QDict<KService> m_serviceDict;
- QPtrDict<KService> m_dupeDict;
+ TQDict<KService> m_serviceDict;
+ TQPtrDict<KService> m_dupeDict;
KSycocaFactory *m_serviceTypeFactory;
KBuildServiceGroupFactory *m_serviceGroupFactory;
};
diff --git a/kded/kbuildservicegroupfactory.cpp b/kded/kbuildservicegroupfactory.cpp
index f55fdcf2f..e75931182 100644
--- a/kded/kbuildservicegroupfactory.cpp
+++ b/kded/kbuildservicegroupfactory.cpp
@@ -37,9 +37,9 @@ KBuildServiceGroupFactory::KBuildServiceGroupFactory() :
// return all service types for this factory
// i.e. first arguments to m_resourceList->add() above
-QStringList KBuildServiceGroupFactory::resourceTypes()
+TQStringList KBuildServiceGroupFactory::resourceTypes()
{
- return QStringList(); // << "apps";
+ return TQStringList(); // << "apps";
}
KBuildServiceGroupFactory::~KBuildServiceGroupFactory()
@@ -48,7 +48,7 @@ KBuildServiceGroupFactory::~KBuildServiceGroupFactory()
}
KServiceGroup *
-KBuildServiceGroupFactory::createEntry( const QString&, const char * )
+KBuildServiceGroupFactory::createEntry( const TQString&, const char * )
{
// Unused
kdWarning("!!!! KBuildServiceGroupFactory::createEntry called!");
@@ -56,7 +56,7 @@ KBuildServiceGroupFactory::createEntry( const QString&, const char * )
}
-void KBuildServiceGroupFactory::addNewEntryTo( const QString &menuName, KService *newEntry)
+void KBuildServiceGroupFactory::addNewEntryTo( const TQString &menuName, KService *newEntry)
{
KServiceGroup *entry = 0;
KSycocaEntry::Ptr *ptr = m_entryDict->find(menuName);
@@ -72,7 +72,7 @@ void KBuildServiceGroupFactory::addNewEntryTo( const QString &menuName, KService
}
KServiceGroup *
-KBuildServiceGroupFactory::addNew( const QString &menuName, const QString& file, KServiceGroup *entry, bool isDeleted)
+KBuildServiceGroupFactory::addNew( const TQString &menuName, const TQString& file, KServiceGroup *entry, bool isDeleted)
{
KSycocaEntry::Ptr *ptr = m_entryDict->find(menuName);
if (ptr)
@@ -93,7 +93,7 @@ KBuildServiceGroupFactory::addNew( const QString &menuName, const QString& file,
{
// Make sure parent dir exists.
KServiceGroup *parentEntry = 0;
- QString parent = menuName.left(menuName.length()-1);
+ TQString parent = menuName.left(menuName.length()-1);
int i = parent.findRev('/');
if (i > 0) {
parent = parent.left(i+1);
@@ -118,9 +118,9 @@ KBuildServiceGroupFactory::addNew( const QString &menuName, const QString& file,
}
KServiceGroup *
-KBuildServiceGroupFactory::addNewChild( const QString &parent, const char *resource, KSycocaEntry *newEntry)
+KBuildServiceGroupFactory::addNewChild( const TQString &parent, const char *resource, KSycocaEntry *newEntry)
{
- QString name = "#parent#"+parent;
+ TQString name = "#parent#"+parent;
KServiceGroup *entry = 0;
KSycocaEntry::Ptr *ptr = m_entryDict->find(name);
@@ -153,7 +153,7 @@ KBuildServiceGroupFactory::addEntry( KSycocaEntry *newEntry, const char *resourc
}
void
-KBuildServiceGroupFactory::saveHeader(QDataStream &str)
+KBuildServiceGroupFactory::saveHeader(TQDataStream &str)
{
KSycocaFactory::saveHeader(str);
@@ -161,7 +161,7 @@ KBuildServiceGroupFactory::saveHeader(QDataStream &str)
}
void
-KBuildServiceGroupFactory::save(QDataStream &str)
+KBuildServiceGroupFactory::save(TQDataStream &str)
{
KSycocaFactory::save(str);
diff --git a/kded/kbuildservicegroupfactory.h b/kded/kbuildservicegroupfactory.h
index 08d825be5..b4d303502 100644
--- a/kded/kbuildservicegroupfactory.h
+++ b/kded/kbuildservicegroupfactory.h
@@ -20,8 +20,8 @@
#define __k_build_service_group_factory_h__
#include <kservicegroupfactory.h>
-#include <qdict.h>
-#include <qstringlist.h>
+#include <tqdict.h>
+#include <tqstringlist.h>
/**
* Service group factory for building ksycoca
@@ -40,14 +40,14 @@ public:
/**
* Create new entry.
*/
- virtual KServiceGroup * createEntry(const QString &, const char *);
+ virtual KServiceGroup * createEntry(const TQString &, const char *);
virtual KServiceGroup * createEntry(int) { assert(0); return 0L; }
/**
* Adds the entry @p newEntry to the menu @p menuName
*/
- void addNewEntryTo( const QString &menuName, KService *newEntry);
+ void addNewEntryTo( const TQString &menuName, KService *newEntry);
/**
* Adds the entry @p newEntry to the "parent group" @p parent, creating
@@ -55,14 +55,14 @@ public:
* A "parent group" is a group of services that all have the same
* "X-KDE-ParentApp".
*/
- KServiceGroup *addNewChild( const QString &parent, const char *resource, KSycocaEntry *newEntry);
+ KServiceGroup *addNewChild( const TQString &parent, const char *resource, KSycocaEntry *newEntry);
/**
* Add new menu @p menuName defined by @p file
* When @p entry is non-null it is re-used, otherwise a new group is created.
* A pointer to the group is returned.
*/
- KServiceGroup *addNew( const QString &menuName, const QString& file, KServiceGroup *entry, bool isDeleted);
+ KServiceGroup *addNew( const TQString &menuName, const TQString& file, KServiceGroup *entry, bool isDeleted);
/**
* Add a new menu entry
@@ -72,17 +72,17 @@ public:
/**
* Write out servicegroup specific index files.
*/
- virtual void save(QDataStream &str);
+ virtual void save(TQDataStream &str);
/**
* Write out header information
*/
- virtual void saveHeader(QDataStream &str);
+ virtual void saveHeader(TQDataStream &str);
/**
* Returns all resource types for this service factory
*/
- static QStringList resourceTypes();
+ static TQStringList resourceTypes();
};
#endif
diff --git a/kded/kbuildservicetypefactory.cpp b/kded/kbuildservicetypefactory.cpp
index d4a5d12d9..4861c3fba 100644
--- a/kded/kbuildservicetypefactory.cpp
+++ b/kded/kbuildservicetypefactory.cpp
@@ -29,7 +29,7 @@
#include <assert.h>
#include <kdesktopfile.h>
-template class QDict<KMimeType>;
+template class TQDict<KMimeType>;
KBuildServiceTypeFactory::KBuildServiceTypeFactory() :
KServiceTypeFactory()
@@ -44,9 +44,9 @@ KBuildServiceTypeFactory::KBuildServiceTypeFactory() :
// return all service types for this factory
// i.e. first arguments to m_resourceList->add() above
-QStringList KBuildServiceTypeFactory::resourceTypes()
+TQStringList KBuildServiceTypeFactory::resourceTypes()
{
- return QStringList() << "servicetypes" << "mime";
+ return TQStringList() << "servicetypes" << "mime";
}
KBuildServiceTypeFactory::~KBuildServiceTypeFactory()
@@ -54,7 +54,7 @@ KBuildServiceTypeFactory::~KBuildServiceTypeFactory()
delete m_resourceList;
}
-KServiceType * KBuildServiceTypeFactory::findServiceTypeByName(const QString &_name)
+KServiceType * KBuildServiceTypeFactory::findServiceTypeByName(const TQString &_name)
{
assert (KSycoca::self()->isBuilding());
// We're building a database - the service type must be in memory
@@ -66,9 +66,9 @@ KServiceType * KBuildServiceTypeFactory::findServiceTypeByName(const QString &_n
KSycocaEntry *
-KBuildServiceTypeFactory::createEntry(const QString &file, const char *resource)
+KBuildServiceTypeFactory::createEntry(const TQString &file, const char *resource)
{
- QString name = file;
+ TQString name = file;
int pos = name.findRev('/');
if (pos != -1)
{
@@ -84,12 +84,12 @@ KBuildServiceTypeFactory::createEntry(const QString &file, const char *resource)
return 0;
// TODO check Type field first
- QString mime = desktopFile.readEntry( "MimeType" );
- QString service = desktopFile.readEntry( "X-KDE-ServiceType" );
+ TQString mime = desktopFile.readEntry( "MimeType" );
+ TQString service = desktopFile.readEntry( "X-KDE-ServiceType" );
if ( mime.isEmpty() && service.isEmpty() )
{
- QString tmp = QString("The service/mime type config file\n%1\n"
+ TQString tmp = TQString("The service/mime type config file\n%1\n"
"does not contain a ServiceType=...\nor MimeType=... entry").arg( file );
kdWarning(7012) << tmp << endl;
return 0;
@@ -124,14 +124,14 @@ KBuildServiceTypeFactory::createEntry(const QString &file, const char *resource)
}
void
-KBuildServiceTypeFactory::saveHeader(QDataStream &str)
+KBuildServiceTypeFactory::saveHeader(TQDataStream &str)
{
KSycocaFactory::saveHeader(str);
str << (Q_INT32) m_fastPatternOffset;
str << (Q_INT32) m_otherPatternOffset;
str << (Q_INT32) m_propertyTypeDict.count();
- QMapIterator<QString, int> it;
+ TQMapIterator<TQString, int> it;
for (it = m_propertyTypeDict.begin(); it != m_propertyTypeDict.end(); ++it)
{
str << it.key() << (Q_INT32)it.data();
@@ -140,7 +140,7 @@ KBuildServiceTypeFactory::saveHeader(QDataStream &str)
}
void
-KBuildServiceTypeFactory::save(QDataStream &str)
+KBuildServiceTypeFactory::save(TQDataStream &str)
{
KSycocaFactory::save(str);
@@ -156,15 +156,15 @@ KBuildServiceTypeFactory::save(QDataStream &str)
}
void
-KBuildServiceTypeFactory::savePatternLists(QDataStream &str)
+KBuildServiceTypeFactory::savePatternLists(TQDataStream &str)
{
// Store each patterns in one of the 2 string lists (for sorting)
- QStringList fastPatterns; // for *.a to *.abcd
- QStringList otherPatterns; // for the rest (core.*, *.tar.bz2, *~) ...
- QDict<KMimeType> dict;
+ TQStringList fastPatterns; // for *.a to *.abcd
+ TQStringList otherPatterns; // for the rest (core.*, *.tar.bz2, *~) ...
+ TQDict<KMimeType> dict;
// For each mimetype in servicetypeFactory
- for(QDictIterator<KSycocaEntry::Ptr> it ( *m_entryDict );
+ for(TQDictIterator<KSycocaEntry::Ptr> it ( *m_entryDict );
it.current();
++it)
{
@@ -172,11 +172,11 @@ KBuildServiceTypeFactory::savePatternLists(QDataStream &str)
if ( entry->isType( KST_KMimeType ) )
{
KMimeType *mimeType = (KMimeType *) entry;
- QStringList pat = mimeType->patterns();
- QStringList::ConstIterator patit = pat.begin();
+ TQStringList pat = mimeType->patterns();
+ TQStringList::ConstIterator patit = pat.begin();
for ( ; patit != pat.end() ; ++patit )
{
- const QString &pattern = *patit;
+ const TQString &pattern = *patit;
if ( pattern.findRev('*') == 0
&& pattern.findRev('.') == 1
&& pattern.length() <= 6 )
@@ -205,14 +205,14 @@ KBuildServiceTypeFactory::savePatternLists(QDataStream &str)
str << entrySize;
// For each fast pattern
- QStringList::ConstIterator it = fastPatterns.begin();
+ TQStringList::ConstIterator it = fastPatterns.begin();
for ( ; it != fastPatterns.end() ; ++it )
{
int start = str.device()->at();
// Justify to 6 chars with spaces, so that the size remains constant
// in the database file.
- QString paddedPattern = (*it).leftJustify(6).right(4); // remove leading "*."
- //kdDebug(7021) << QString("FAST : '%1' '%2'").arg(paddedPattern).arg(dict[(*it)]->name()) << endl;
+ TQString paddedPattern = (*it).leftJustify(6).right(4); // remove leading "*."
+ //kdDebug(7021) << TQString("FAST : '%1' '%2'").arg(paddedPattern).arg(dict[(*it)]->name()) << endl;
str << paddedPattern;
str << dict[(*it)]->offset();
entrySize = str.device()->at() - start;
@@ -233,12 +233,12 @@ KBuildServiceTypeFactory::savePatternLists(QDataStream &str)
it = otherPatterns.begin();
for ( ; it != otherPatterns.end() ; ++it )
{
- //kdDebug(7021) << QString("OTHER : '%1' '%2'").arg(*it).arg(dict[(*it)]->name()) << endl;
+ //kdDebug(7021) << TQString("OTHER : '%1' '%2'").arg(*it).arg(dict[(*it)]->name()) << endl;
str << (*it);
str << dict[(*it)]->offset();
}
- str << QString(""); // end of list marker (has to be a string !)
+ str << TQString(""); // end of list marker (has to be a string !)
}
void
@@ -257,8 +257,8 @@ KBuildServiceTypeFactory::addEntry(KSycocaEntry *newEntry, const char *resource)
KSycocaFactory::addEntry(newEntry, resource);
- const QMap<QString,QVariant::Type>& pd = serviceType->propertyDefs();
- QMap<QString,QVariant::Type>::ConstIterator pit = pd.begin();
+ const TQMap<TQString,TQVariant::Type>& pd = serviceType->propertyDefs();
+ TQMap<TQString,TQVariant::Type>::ConstIterator pit = pd.begin();
for( ; pit != pd.end(); ++pit )
{
if (!m_propertyTypeDict.contains(pit.key()))
diff --git a/kded/kbuildservicetypefactory.h b/kded/kbuildservicetypefactory.h
index ea99785ad..a68b8851b 100644
--- a/kded/kbuildservicetypefactory.h
+++ b/kded/kbuildservicetypefactory.h
@@ -21,7 +21,7 @@
#define __k_build_service_type_factory_h__
#include <kservicetypefactory.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
/**
* Service-type factory for building ksycoca
@@ -41,12 +41,12 @@ public:
* Find a service type in the database file
* @return a pointer to the servicetype in the memory dict (don't free!)
*/
- virtual KServiceType * findServiceTypeByName(const QString &_name);
+ virtual KServiceType * findServiceTypeByName(const TQString &_name);
/**
* Construct a KServiceType from a config file.
*/
- virtual KSycocaEntry * createEntry(const QString &file, const char *resource);
+ virtual KSycocaEntry * createEntry(const TQString &file, const char *resource);
virtual KServiceType * createEntry( int ) { assert(0); return 0L; }
@@ -58,7 +58,7 @@ public:
/**
* Write out service type specific index files.
*/
- virtual void save(QDataStream &str);
+ virtual void save(TQDataStream &str);
/**
* Write out header information
@@ -66,15 +66,15 @@ public:
* Don't forget to call the parent first when you override
* this function.
*/
- virtual void saveHeader(QDataStream &str);
+ virtual void saveHeader(TQDataStream &str);
/**
* Returns all resource types for this service factory
*/
- static QStringList resourceTypes();
+ static TQStringList resourceTypes();
private:
- void savePatternLists(QDataStream &str);
+ void savePatternLists(TQDataStream &str);
};
#endif
diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp
index cc89515fc..20669faa4 100644
--- a/kded/kbuildsycoca.cpp
+++ b/kded/kbuildsycoca.cpp
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
**/
-#include <qdir.h>
-#include <qeventloop.h>
+#include <tqdir.h>
+#include <tqeventloop.h>
#include <config.h>
#include "kbuildsycoca.h"
@@ -35,9 +35,9 @@
#include <kctimefactory.h>
#include <kdatastream.h>
-#include <qdatastream.h>
-#include <qfile.h>
-#include <qtimer.h>
+#include <tqdatastream.h>
+#include <tqfile.h>
+#include <tqtimer.h>
#include <assert.h>
#include <kapplication.h>
@@ -54,7 +54,7 @@
#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build
// GUI version of kbuildsycoca, so-called "kbuildsycocaw".
-# include <qlabel.h>
+# include <tqlabel.h>
# include <kmessagebox.h>
bool silent;
bool showprogress;
@@ -65,8 +65,8 @@
#include <time.h>
#include <memory> // auto_ptr
-typedef QDict<KSycocaEntry> KBSEntryDict;
-typedef QValueList<KSycocaEntry::List> KSycocaEntryListList;
+typedef TQDict<KSycocaEntry> KBSEntryDict;
+typedef TQValueList<KSycocaEntry::List> KSycocaEntryListList;
static Q_UINT32 newTimestamp = 0;
@@ -74,13 +74,13 @@ static KBuildServiceFactory *g_bsf = 0;
static KBuildServiceGroupFactory *g_bsgf = 0;
static KSycocaFactory *g_factory = 0;
static KCTimeInfo *g_ctimeInfo = 0;
-static QDict<Q_UINT32> *g_ctimeDict = 0;
+static TQDict<Q_UINT32> *g_ctimeDict = 0;
static const char *g_resource = 0;
static KBSEntryDict *g_entryDict = 0;
static KBSEntryDict *g_serviceGroupEntryDict = 0;
static KSycocaEntryListList *g_allEntries = 0;
-static QStringList *g_changeList = 0;
-static QStringList *g_allResourceDirs = 0;
+static TQStringList *g_changeList = 0;
+static TQStringList *g_allResourceDirs = 0;
static bool g_changed = false;
static KSycocaEntry::List g_tempStorage;
static VFolderMenu *g_vfolder = 0;
@@ -98,9 +98,9 @@ void crashHandler(int)
unlink(cSycocaPath);
}
-static QString sycocaPath()
+static TQString sycocaPath()
{
- QString path;
+ TQString path;
if (bGlobalDatabase)
{
@@ -108,23 +108,23 @@ static QString sycocaPath()
}
else
{
- QCString ksycoca_env = getenv("KDESYCOCA");
+ TQCString ksycoca_env = getenv("KDESYCOCA");
if (ksycoca_env.isEmpty())
path = KGlobal::dirs()->saveLocation("cache")+"ksycoca";
else
- path = QFile::decodeName(ksycoca_env);
+ path = TQFile::decodeName(ksycoca_env);
}
return path;
}
-static QString oldSycocaPath()
+static TQString oldSycocaPath()
{
- QCString ksycoca_env = getenv("KDESYCOCA");
+ TQCString ksycoca_env = getenv("KDESYCOCA");
if (ksycoca_env.isEmpty())
return KGlobal::dirs()->saveLocation("tmp")+"ksycoca";
- return QString::null;
+ return TQString::null;
}
KBuildSycoca::KBuildSycoca()
@@ -139,18 +139,18 @@ KBuildSycoca::~KBuildSycoca()
void KBuildSycoca::processGnomeVfs()
{
- QString file = locate("app-reg", "gnome-vfs.applications");
+ TQString file = locate("app-reg", "gnome-vfs.applications");
if (file.isEmpty())
{
// kdDebug(7021) << "gnome-vfs.applications not found." << endl;
return;
}
- QString app;
+ TQString app;
char line[1024*64];
- FILE *f = fopen(QFile::encodeName(file), "r");
+ FILE *f = fopen(TQFile::encodeName(file), "r");
while (!feof(f))
{
if (!fgets(line, sizeof(line)-1, f))
@@ -160,22 +160,22 @@ void KBuildSycoca::processGnomeVfs()
if (line[0] != '\t')
{
- app = QString::fromLatin1(line);
+ app = TQString::fromLatin1(line);
app.truncate(app.length()-1);
}
else if (strncmp(line+1, "mime_types=", 11) == 0)
{
- QString mimetypes = QString::fromLatin1(line+12);
+ TQString mimetypes = TQString::fromLatin1(line+12);
mimetypes.truncate(mimetypes.length()-1);
- mimetypes.replace(QRegExp("\\*"), "all");
+ mimetypes.replace(TQRegExp("\\*"), "all");
KService *s = g_bsf->findServiceByName(app);
if (!s)
continue;
- QStringList &serviceTypes = s->accessServiceTypes();
+ TQStringList &serviceTypes = s->accessServiceTypes();
if (serviceTypes.count() <= 1)
{
- serviceTypes += QStringList::split(',', mimetypes);
+ serviceTypes += TQStringList::split(',', mimetypes);
// kdDebug(7021) << "Adding gnome mimetypes for '" << app << "'.\n";
// kdDebug(7021) << "ServiceTypes=" << s->serviceTypes().join(":") << endl;
}
@@ -184,7 +184,7 @@ void KBuildSycoca::processGnomeVfs()
fclose( f );
}
-KSycocaEntry *KBuildSycoca::createEntry(const QString &file, bool addToFactory)
+KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory)
{
Q_UINT32 timeStamp = g_ctimeInfo->ctime(file);
if (!timeStamp)
@@ -246,7 +246,7 @@ KSycocaEntry *KBuildSycoca::createEntry(const QString &file, bool addToFactory)
return 0;
}
-void KBuildSycoca::slotCreateEntry(const QString &file, KService **service)
+void KBuildSycoca::slotCreateEntry(const TQString &file, KService **service)
{
KSycocaEntry *entry = createEntry(file, false);
*service = dynamic_cast<KService *>(entry);
@@ -255,7 +255,7 @@ void KBuildSycoca::slotCreateEntry(const QString &file, KService **service)
// returns false if the database is up to date
bool KBuildSycoca::build()
{
- typedef QPtrList<KBSEntryDict> KBSEntryDictList;
+ typedef TQPtrList<KBSEntryDict> KBSEntryDictList;
KBSEntryDictList *entryDictList = 0;
KBSEntryDict *serviceEntryDict = 0;
@@ -285,7 +285,7 @@ bool KBuildSycoca::build()
entryDictList->append(entryDict);
}
- QStringList allResources;
+ TQStringList allResources;
// For each factory
for (KSycocaFactory *factory = m_lstFactories->first();
factory;
@@ -308,17 +308,17 @@ bool KBuildSycoca::build()
g_ctimeInfo = new KCTimeInfo(); // This is a build factory too, don't delete!!
bool uptodate = true;
// For all resources
- for( QStringList::ConstIterator it1 = allResources.begin();
+ for( TQStringList::ConstIterator it1 = allResources.begin();
it1 != allResources.end();
++it1 )
{
g_changed = false;
g_resource = (*it1).ascii();
- QStringList relFiles;
+ TQStringList relFiles;
(void) KGlobal::dirs()->findAllResources( g_resource,
- QString::null,
+ TQString::null,
true, // Recursive!
true, // uniq
relFiles);
@@ -344,7 +344,7 @@ bool KBuildSycoca::build()
if (res.resource != (*it1)) continue;
// For each file in the resource
- for( QStringList::ConstIterator it3 = relFiles.begin();
+ for( TQStringList::ConstIterator it3 = relFiles.begin();
it3 != relFiles.end();
++it3 )
{
@@ -376,22 +376,22 @@ bool KBuildSycoca::build()
if (!m_trackId.isEmpty())
g_vfolder->setTrackId(m_trackId);
- connect(g_vfolder, SIGNAL(newService(const QString &, KService **)),
- this, SLOT(slotCreateEntry(const QString &, KService **)));
+ connect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)),
+ this, TQT_SLOT(slotCreateEntry(const TQString &, KService **)));
VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("applications.menu", true);
KServiceGroup *entry = g_bsgf->addNew("/", kdeMenu->directoryFile, 0, false);
entry->setLayoutInfo(kdeMenu->layoutList);
- createMenu(QString::null, QString::null, kdeMenu);
+ createMenu(TQString::null, TQString::null, kdeMenu);
KServiceGroup::Ptr g(entry);
(void) existingResourceDirs();
*g_allResourceDirs += g_vfolder->allDirectories();
- disconnect(g_vfolder, SIGNAL(newService(const QString &, KService **)),
- this, SLOT(slotCreateEntry(const QString &, KService **)));
+ disconnect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)),
+ this, TQT_SLOT(slotCreateEntry(const TQString &, KService **)));
if (g_changed || !g_allEntries)
{
@@ -405,13 +405,13 @@ bool KBuildSycoca::build()
return result;
}
-void KBuildSycoca::createMenu(QString caption, QString name, VFolderMenu::SubMenu *menu)
+void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu)
{
for(VFolderMenu::SubMenu *subMenu = menu->subMenus.first(); subMenu; subMenu = menu->subMenus.next())
{
- QString subName = name+subMenu->name+"/";
+ TQString subName = name+subMenu->name+"/";
- QString directoryFile = subMenu->directoryFile;
+ TQString directoryFile = subMenu->directoryFile;
if (directoryFile.isEmpty())
directoryFile = subName+".directory";
Q_UINT32 timeStamp = g_ctimeInfo->ctime(directoryFile);
@@ -444,7 +444,7 @@ void KBuildSycoca::createMenu(QString caption, QString name, VFolderMenu::SubMen
caption += "/";
if (name.isEmpty())
name += "/";
- for(QDictIterator<KService> it(menu->items); it.current(); ++it)
+ for(TQDictIterator<KService> it(menu->items); it.current(); ++it)
{
if (bMenuTest)
{
@@ -461,7 +461,7 @@ void KBuildSycoca::createMenu(QString caption, QString name, VFolderMenu::SubMen
bool KBuildSycoca::recreate()
{
- QString path(sycocaPath());
+ TQString path(sycocaPath());
#ifdef Q_WS_WIN
printf("kbuildsycoca: path='%s'\n", (const char*)path);
#endif
@@ -469,9 +469,9 @@ bool KBuildSycoca::recreate()
// KSaveFile first writes to a temp file.
// Upon close() it moves the stuff to the right place.
std::auto_ptr<KSaveFile> database( new KSaveFile(path) );
- if (database->status() == EACCES && QFile::exists(path))
+ if (database->status() == EACCES && TQFile::exists(path))
{
- QFile::remove( path );
+ TQFile::remove( path );
database.reset( new KSaveFile(path) ); // try again
}
if (database->status() != 0)
@@ -526,10 +526,10 @@ bool KBuildSycoca::recreate()
if (!bGlobalDatabase)
{
// update the timestamp file
- QString stamppath = path + "stamp";
- QFile ksycocastamp(stamppath);
+ TQString stamppath = path + "stamp";
+ TQFile ksycocastamp(stamppath);
ksycocastamp.open( IO_WriteOnly );
- QDataStream str( &ksycocastamp );
+ TQDataStream str( &ksycocastamp );
str << newTimestamp;
str << existingResourceDirs();
if (g_vfolder)
@@ -602,19 +602,19 @@ void KBuildSycoca::save()
m_str->device()->at(endOfData);
}
-bool KBuildSycoca::checkDirTimestamps( const QString& dirname, const QDateTime& stamp, bool top )
+bool KBuildSycoca::checkDirTimestamps( const TQString& dirname, const TQDateTime& stamp, bool top )
{
if( top )
{
- QFileInfo inf( dirname );
+ TQFileInfo inf( dirname );
if( inf.lastModified() > stamp )
{
kdDebug( 7021 ) << "timestamp changed:" << dirname << endl;
return false;
}
}
- QDir dir( dirname );
- const QFileInfoList *list = dir.entryInfoList( QDir::DefaultFilter, QDir::Unsorted );
+ TQDir dir( dirname );
+ const QFileInfoList *list = dir.entryInfoList( TQDir::DefaultFilter, TQDir::Unsorted );
if (!list)
return true;
@@ -622,7 +622,7 @@ bool KBuildSycoca::checkDirTimestamps( const QString& dirname, const QDateTime&
it.current() != NULL;
++it )
{
- QFileInfo* fi = it.current();
+ TQFileInfo* fi = it.current();
if( fi->fileName() == "." || fi->fileName() == ".." )
continue;
if( fi->lastModified() > stamp )
@@ -640,12 +640,12 @@ bool KBuildSycoca::checkDirTimestamps( const QString& dirname, const QDateTime&
// and also their directories
// if all of them all older than the timestamp in file ksycocastamp, this
// means that there's no need to rebuild ksycoca
-bool KBuildSycoca::checkTimestamps( Q_UINT32 timestamp, const QStringList &dirs )
+bool KBuildSycoca::checkTimestamps( Q_UINT32 timestamp, const TQStringList &dirs )
{
kdDebug( 7021 ) << "checking file timestamps" << endl;
- QDateTime stamp;
+ TQDateTime stamp;
stamp.setTime_t( timestamp );
- for( QStringList::ConstIterator it = dirs.begin();
+ for( TQStringList::ConstIterator it = dirs.begin();
it != dirs.end();
++it )
{
@@ -656,15 +656,15 @@ bool KBuildSycoca::checkTimestamps( Q_UINT32 timestamp, const QStringList &dirs
return true;
}
-QStringList KBuildSycoca::existingResourceDirs()
+TQStringList KBuildSycoca::existingResourceDirs()
{
- static QStringList* dirs = NULL;
+ static TQStringList* dirs = NULL;
if( dirs != NULL )
return *dirs;
dirs = new QStringList;
g_allResourceDirs = new QStringList;
// these are all resources cached by ksycoca
- QStringList resources;
+ TQStringList resources;
resources += KBuildServiceTypeFactory::resourceTypes();
resources += KBuildServiceGroupFactory::resourceTypes();
resources += KBuildServiceFactory::resourceTypes();
@@ -672,17 +672,17 @@ QStringList KBuildSycoca::existingResourceDirs()
resources += KBuildProtocolInfoFactory::resourceTypes();
while( !resources.empty())
{
- QString res = resources.front();
+ TQString res = resources.front();
*dirs += KGlobal::dirs()->resourceDirs( res.latin1());
resources.remove( res ); // remove this 'res' and all its duplicates
}
*g_allResourceDirs = *dirs;
- for( QStringList::Iterator it = dirs->begin();
+ for( TQStringList::Iterator it = dirs->begin();
it != dirs->end(); )
{
- QFileInfo inf( *it );
+ TQFileInfo inf( *it );
if( !inf.exists() || !inf.isReadable() )
it = dirs->remove( it );
else
@@ -747,8 +747,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
#ifdef KBUILDSYCOCA_GUI
silent = args->isSet("silent");
showprogress = args->isSet("showprogress");
- QLabel progress( QString("<p><br><nobr> %1 </nobr><br>").arg( i18n("Reloading KDE configuration, please wait...") ), 0, "", Qt::WType_Dialog | Qt::WStyle_DialogBorder | Qt::WStyle_Customize| Qt::WStyle_Title );
- QString capt = i18n("KDE Configuration Manager");
+ TQLabel progress( TQString("<p><br><nobr> %1 </nobr><br>").arg( i18n("Reloading KDE configuration, please wait...") ), 0, "", Qt::WType_Dialog | Qt::WStyle_DialogBorder | Qt::WStyle_Customize| Qt::WStyle_Title );
+ TQString capt = i18n("KDE Configuration Manager");
if (!silent) {
if (KMessageBox::No == KMessageBox::questionYesNo(0, i18n("Do you want to reload KDE configuration?"), capt, i18n("Reload"), i18n("Do Not Reload")))
return 0;
@@ -761,7 +761,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
KCrash::setCrashHandler(KCrash::defaultCrashHandler);
KCrash::setEmergencySaveFunction(crashHandler);
- KCrash::setApplicationName(QString(appName));
+ KCrash::setApplicationName(TQString(appName));
// this program is in kdelibs so it uses kdelibs as catalog
KLocale::setMainCatalogue("kdelibs");
@@ -774,7 +774,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
while(true)
{
- QCString registeredName = dcopClient->registerAs(appName, false);
+ TQCString registeredName = dcopClient->registerAs(appName, false);
if (registeredName.isEmpty())
{
fprintf(stderr, "Warning: %s is unable to register with DCOP.\n", appName);
@@ -790,8 +790,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
while (dcopClient->isApplicationRegistered(appName))
{
WaitForSignal *obj = new WaitForSignal;
- obj->connect(dcopClient, SIGNAL(applicationRemoved(const QCString &)),
- SLOT(deleteLater()));
+ obj->connect(dcopClient, TQT_SIGNAL(applicationRemoved(const TQCString &)),
+ TQT_SLOT(deleteLater()));
kapp->eventLoop()->enterLoop();
}
dcopClient->setNotifications( false );
@@ -804,8 +804,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
if (incremental || !checkfiles)
{
KSycoca::self()->disableAutoRebuild(); // Prevent deadlock
- QString current_language = KGlobal::locale()->language();
- QString ksycoca_language = KSycoca::self()->language();
+ TQString current_language = KGlobal::locale()->language();
+ TQString ksycoca_language = KSycoca::self()->language();
Q_UINT32 current_update_sig = KGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true);
Q_UINT32 ksycoca_update_sig = KSycoca::self()->updateSignature();
@@ -823,16 +823,16 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
bool checkstamps = incremental && args->isSet("checkstamps") && checkfiles;
Q_UINT32 filestamp = 0;
- QStringList oldresourcedirs;
+ TQStringList oldresourcedirs;
if( checkstamps && incremental )
{
- QString path = sycocaPath()+"stamp";
- QCString qPath = QFile::encodeName(path);
+ TQString path = sycocaPath()+"stamp";
+ TQCString qPath = TQFile::encodeName(path);
cSycocaPath = qPath.data(); // Delete timestamps on crash
- QFile ksycocastamp(path);
+ TQFile ksycocastamp(path);
if( ksycocastamp.open( IO_ReadOnly ))
{
- QDataStream str( &ksycocastamp );
+ TQDataStream str( &ksycocastamp );
if (!str.atEnd())
str >> filestamp;
if (!str.atEnd())
@@ -847,7 +847,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
}
if (!str.atEnd())
{
- QStringList extraResourceDirs;
+ TQStringList extraResourceDirs;
str >> extraResourceDirs;
oldresourcedirs += extraResourceDirs;
}
@@ -863,7 +863,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
if( checkfiles && ( !checkstamps || !KBuildSycoca::checkTimestamps( filestamp, oldresourcedirs )))
{
- QCString qSycocaPath = QFile::encodeName(sycocaPath());
+ TQCString qSycocaPath = TQFile::encodeName(sycocaPath());
cSycocaPath = qSycocaPath.data();
g_allEntries = 0;
@@ -874,7 +874,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
KSycoca *oldSycoca = KSycoca::self();
KSycocaFactoryList *factories = new KSycocaFactoryList;
g_allEntries = new KSycocaEntryListList;
- g_ctimeDict = new QDict<Q_UINT32>(523);
+ g_ctimeDict = new TQDict<Q_UINT32>(523);
// Must be in same order as in KBuildSycoca::recreate()!
factories->append( new KServiceTypeFactory );
@@ -901,7 +901,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
KBuildSycoca *sycoca= new KBuildSycoca; // Build data base
if (args->isSet("track"))
- sycoca->setTrackId(QString::fromLocal8Bit(args->getOption("track")));
+ sycoca->setTrackId(TQString::fromLocal8Bit(args->getOption("track")));
if (!sycoca->recreate()) {
#ifdef KBUILDSYCOCA_GUI
if (!silent || showprogress)
@@ -914,26 +914,26 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{
// These directories may have been created with 0700 permission
// better delete them if they are empty
- QString applnkDir = KGlobal::dirs()->saveLocation("apps", QString::null, false);
- ::rmdir(QFile::encodeName(applnkDir));
- QString servicetypesDir = KGlobal::dirs()->saveLocation("servicetypes", QString::null, false);
- ::rmdir(QFile::encodeName(servicetypesDir));
+ TQString applnkDir = KGlobal::dirs()->saveLocation("apps", TQString::null, false);
+ ::rmdir(TQFile::encodeName(applnkDir));
+ TQString servicetypesDir = KGlobal::dirs()->saveLocation("servicetypes", TQString::null, false);
+ ::rmdir(TQFile::encodeName(servicetypesDir));
}
}
if (!bGlobalDatabase)
{
// Recreate compatibility symlink
- QString oldPath = oldSycocaPath();
+ TQString oldPath = oldSycocaPath();
if (!oldPath.isEmpty())
{
KTempFile tmp;
if (tmp.status() == 0)
{
- QString tmpFile = tmp.name();
+ TQString tmpFile = tmp.name();
tmp.unlink();
- symlink(QFile::encodeName(sycocaPath()), QFile::encodeName(tmpFile));
- rename(QFile::encodeName(tmpFile), QFile::encodeName(oldPath));
+ symlink(TQFile::encodeName(sycocaPath()), TQFile::encodeName(tmpFile));
+ rename(TQFile::encodeName(tmpFile), TQFile::encodeName(oldPath));
}
}
}
@@ -941,10 +941,10 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
if (args->isSet("signal"))
{
// Notify ALL applications that have a ksycoca object, using a broadcast
- QByteArray data;
- QDataStream stream(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream stream(data, IO_WriteOnly);
stream << *g_changeList;
- dcopClient->send( "*", "ksycoca", "notifyDatabaseChanged(QStringList)", data );
+ dcopClient->send( "*", "ksycoca", "notifyDatabaseChanged(TQStringList)", data );
}
#ifdef KBUILDSYCOCA_GUI
diff --git a/kded/kbuildsycoca.h b/kded/kbuildsycoca.h
index ec7210437..809b55309 100644
--- a/kded/kbuildsycoca.h
+++ b/kded/kbuildsycoca.h
@@ -20,9 +20,9 @@
#include <sys/stat.h>
-#include <qobject.h>
-#include <qstring.h>
-#include <qdict.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqdict.h>
#include <kservice.h>
#include <ksycoca.h>
@@ -47,14 +47,14 @@ public:
*/
bool recreate();
- static bool checkTimestamps( Q_UINT32 timestamp, const QStringList &dirs );
+ static bool checkTimestamps( Q_UINT32 timestamp, const TQStringList &dirs );
- static QStringList existingResourceDirs();
+ static TQStringList existingResourceDirs();
- void setTrackId(const QString &id) { m_trackId = id; }
+ void setTrackId(const TQString &id) { m_trackId = id; }
protected slots:
- void slotCreateEntry(const QString &file, KService **entry);
+ void slotCreateEntry(const TQString &file, KService **entry);
protected:
@@ -67,12 +67,12 @@ protected:
* Add single entry to the sycoca database.
* Either from a previous database or regenerated from file.
*/
- KSycocaEntry *createEntry(const QString &file, bool addToFactory);
+ KSycocaEntry *createEntry(const TQString &file, bool addToFactory);
/**
* Convert a VFolderMenu::SubMenu to KServiceGroups.
*/
- void createMenu(QString caption, QString name, VFolderMenu::SubMenu *menu);
+ void createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu);
/**
* Build the whole system cache, from .desktop files
@@ -89,7 +89,7 @@ protected:
*/
void clear();
- static bool checkDirTimestamps( const QString& dir, const QDateTime& stamp, bool top );
+ static bool checkDirTimestamps( const TQString& dir, const TQDateTime& stamp, bool top );
/**
* @internal
@@ -97,8 +97,8 @@ protected:
*/
virtual bool isBuilding() { return true; }
- QStringList m_allResourceDirs;
- QString m_trackId;
+ TQStringList m_allResourceDirs;
+ TQString m_trackId;
};
#endif
diff --git a/kded/kctimefactory.cpp b/kded/kctimefactory.cpp
index bfc69af2c..25d78bab0 100644
--- a/kded/kctimefactory.cpp
+++ b/kded/kctimefactory.cpp
@@ -41,7 +41,7 @@ KCTimeInfo::~KCTimeInfo()
}
void
-KCTimeInfo::saveHeader(QDataStream &str)
+KCTimeInfo::saveHeader(TQDataStream &str)
{
KSycocaFactory::saveHeader(str);
@@ -49,18 +49,18 @@ KCTimeInfo::saveHeader(QDataStream &str)
}
void
-KCTimeInfo::save(QDataStream &str)
+KCTimeInfo::save(TQDataStream &str)
{
KSycocaFactory::save(str);
m_dictOffset = str.device()->at();
- QDictIterator<Q_UINT32> it(ctimeDict);
+ TQDictIterator<Q_UINT32> it(ctimeDict);
while( it.current())
{
str << it.currentKey() << *(it.current());
++it;
}
- str << QString::null << (Q_UINT32) 0;
+ str << TQString::null << (Q_UINT32) 0;
int endOfFactoryData = str.device()->at();
@@ -69,25 +69,25 @@ KCTimeInfo::save(QDataStream &str)
}
void
-KCTimeInfo::addCTime(const QString &path, Q_UINT32 ctime)
+KCTimeInfo::addCTime(const TQString &path, Q_UINT32 ctime)
{
assert(!path.isEmpty());
ctimeDict.replace(path, new Q_UINT32(ctime));
}
Q_UINT32
-KCTimeInfo::ctime(const QString &path)
+KCTimeInfo::ctime(const TQString &path)
{
Q_UINT32 *ctimeP = ctimeDict[path];
return ctimeP ? *ctimeP : 0;
}
void
-KCTimeInfo::fillCTimeDict(QDict<Q_UINT32> &dict)
+KCTimeInfo::fillCTimeDict(TQDict<Q_UINT32> &dict)
{
assert(m_str);
m_str->device()->at(m_dictOffset);
- QString path;
+ TQString path;
Q_UINT32 ctime;
while(true)
{
diff --git a/kded/kctimefactory.h b/kded/kctimefactory.h
index 616d5f6ff..b878b3033 100644
--- a/kded/kctimefactory.h
+++ b/kded/kctimefactory.h
@@ -20,7 +20,7 @@
#define __k_ctime_factory_h__
#include <ksycocafactory.h>
-#include <qdict.h>
+#include <tqdict.h>
/**
* Service group factory for building ksycoca
@@ -40,24 +40,24 @@ public:
/**
* Write out header information
*/
- virtual void saveHeader(QDataStream &str);
+ virtual void saveHeader(TQDataStream &str);
/**
* Write out data
*/
- virtual void save(QDataStream &str);
+ virtual void save(TQDataStream &str);
- KSycocaEntry * createEntry(const QString &, const char *) { return 0; }
+ KSycocaEntry * createEntry(const TQString &, const char *) { return 0; }
KSycocaEntry * createEntry(int) { return 0; }
- void addCTime(const QString &path, Q_UINT32 ctime);
+ void addCTime(const TQString &path, Q_UINT32 ctime);
- Q_UINT32 ctime(const QString &path);
+ Q_UINT32 ctime(const TQString &path);
- void fillCTimeDict(QDict<Q_UINT32> &dict);
+ void fillCTimeDict(TQDict<Q_UINT32> &dict);
protected:
- QDict<Q_UINT32> ctimeDict;
+ TQDict<Q_UINT32> ctimeDict;
int m_dictOffset;
};
diff --git a/kded/kde-menu.cpp b/kded/kde-menu.cpp
index 242fcce4c..89ee5a857 100644
--- a/kded/kde-menu.cpp
+++ b/kded/kde-menu.cpp
@@ -18,7 +18,7 @@
#include <stdlib.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <dcopclient.h>
#include <dcopref.h>
@@ -50,7 +50,7 @@ static bool bPrintMenuId;
static bool bPrintMenuName;
static bool bHighlight;
-static void result(const QString &txt)
+static void result(const TQString &txt)
{
if (utf8)
puts( txt.utf8() );
@@ -58,13 +58,13 @@ static void result(const QString &txt)
puts( txt.local8Bit() );
}
-static void error(int exitCode, const QString &txt)
+static void error(int exitCode, const TQString &txt)
{
qWarning("kde-menu: %s", txt.local8Bit().data());
exit(exitCode);
}
-static void findMenuEntry(KServiceGroup::Ptr parent, const QString &name, const QString &menuId)
+static void findMenuEntry(KServiceGroup::Ptr parent, const TQString &name, const TQString &menuId)
{
KServiceGroup::List list = parent->entries(true, true, false);
KServiceGroup::List::ConstIterator it = list.begin();
@@ -143,11 +143,11 @@ int main(int argc, char **argv)
if (args->isSet("cache-update"))
{
- QStringList args;
+ TQStringList args;
args.append("--incremental");
args.append("--checkstamps");
- QString command = "kbuildsycoca";
- QCString _launcher = KApplication::launcher();
+ TQString command = "kbuildsycoca";
+ TQCString _launcher = KApplication::launcher();
if (!DCOPRef(_launcher, _launcher).call("kdeinit_exec_wait", command, args).isValid())
{
qWarning("Can't talk to klauncher!");
@@ -157,7 +157,7 @@ int main(int argc, char **argv)
}
}
- QString menuId = QFile::decodeName(args->arg(0));
+ TQString menuId = TQFile::decodeName(args->arg(0));
KService::Ptr s = KService::serviceByMenuId(menuId);
if (!s)
diff --git a/kded/kded.cpp b/kded/kded.cpp
index df16faddb..fa655df42 100644
--- a/kded/kded.cpp
+++ b/kded/kded.cpp
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
**/
-#include <qdir.h>
+#include <tqdir.h>
#include "kded.h"
#include "kdedmodule.h"
@@ -30,8 +30,8 @@
#include <signal.h>
#include <time.h>
-#include <qfile.h>
-#include <qtimer.h>
+#include <tqfile.h>
+#include <tqtimer.h>
#include <dcopclient.h>
@@ -58,9 +58,9 @@ Kded *Kded::_self = 0;
static bool checkStamps = true;
static bool delayedCheck = false;
-static void runBuildSycoca(QObject *callBackObj=0, const char *callBackSlot=0)
+static void runBuildSycoca(TQObject *callBackObj=0, const char *callBackSlot=0)
{
- QStringList args;
+ TQStringList args;
args.append("--incremental");
if(checkStamps)
args.append("--checkstamps");
@@ -70,12 +70,12 @@ static void runBuildSycoca(QObject *callBackObj=0, const char *callBackSlot=0)
checkStamps = false; // useful only during kded startup
if (callBackObj)
{
- QByteArray data;
- QDataStream dataStream( data, IO_WriteOnly );
- dataStream << QString("kbuildsycoca") << args;
- QCString _launcher = KApplication::launcher();
+ TQByteArray data;
+ TQDataStream dataStream( data, IO_WriteOnly );
+ dataStream << TQString("kbuildsycoca") << args;
+ TQCString _launcher = KApplication::launcher();
- kapp->dcopClient()->callAsync(_launcher, _launcher, "kdeinit_exec_wait(QString,QStringList)", data, callBackObj, callBackSlot);
+ kapp->dcopClient()->callAsync(_launcher, _launcher, "kdeinit_exec_wait(TQString,TQStringList)", data, callBackObj, callBackSlot);
}
else
{
@@ -85,14 +85,14 @@ static void runBuildSycoca(QObject *callBackObj=0, const char *callBackSlot=0)
static void runKonfUpdate()
{
- KApplication::kdeinitExecWait( "kconf_update", QStringList(), 0, 0, "0" /*no startup notification*/ );
+ KApplication::kdeinitExecWait( "kconf_update", TQStringList(), 0, 0, "0" /*no startup notification*/ );
}
-static void runDontChangeHostname(const QCString &oldName, const QCString &newName)
+static void runDontChangeHostname(const TQCString &oldName, const TQCString &newName)
{
- QStringList args;
- args.append(QFile::decodeName(oldName));
- args.append(QFile::decodeName(newName));
+ TQStringList args;
+ args.append(TQFile::decodeName(oldName));
+ args.append(TQFile::decodeName(newName));
KApplication::kdeinitExecWait( "kdontchangethehostname", args );
}
@@ -103,16 +103,16 @@ Kded::Kded(bool checkUpdates, bool new_startup)
m_newStartup( new_startup )
{
_self = this;
- QCString cPath;
- QCString ksycoca_env = getenv("KDESYCOCA");
+ TQCString cPath;
+ TQCString ksycoca_env = getenv("KDESYCOCA");
if (ksycoca_env.isEmpty())
- cPath = QFile::encodeName(KGlobal::dirs()->saveLocation("tmp")+"ksycoca");
+ cPath = TQFile::encodeName(KGlobal::dirs()->saveLocation("tmp")+"ksycoca");
else
cPath = ksycoca_env;
- m_pTimer = new QTimer(this);
- connect(m_pTimer, SIGNAL(timeout()), this, SLOT(recreate()));
+ m_pTimer = new TQTimer(this);
+ connect(m_pTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(recreate()));
- QTimer::singleShot(100, this, SLOT(installCrashHandler()));
+ TQTimer::singleShot(100, this, TQT_SLOT(installCrashHandler()));
m_pDirWatch = 0;
@@ -130,14 +130,14 @@ Kded::~Kded()
delete m_pDirWatch;
// We have to delete the modules while we're still able to process incoming
// DCOP messages, since modules might make DCOP calls in their destructors.
- QAsciiDictIterator<KDEDModule> it(m_modules);
+ TQAsciiDictIterator<KDEDModule> it(m_modules);
while (!it.isEmpty())
delete it.toFirst();
}
-bool Kded::process(const QCString &obj, const QCString &fun,
- const QByteArray &data,
- QCString &replyType, QByteArray &replyData)
+bool Kded::process(const TQCString &obj, const TQCString &fun,
+ const TQByteArray &data,
+ TQCString &replyType, TQByteArray &replyData)
{
if (obj == "ksycoca") return false; // Ignore this one.
@@ -162,8 +162,8 @@ void Kded::initModules()
kde_running = false;
// Preload kded modules.
KService::List kdedModules = KServiceType::offers("KDEDModule");
- QString version = getenv( "KDE_SESSION_VERSION" );
- QStringList blacklist;
+ TQString version = getenv( "KDE_SESSION_VERSION" );
+ TQStringList blacklist;
if ( version >= "4" )
{
kdDebug(7020) << "KDE4 is running." << endl;
@@ -172,10 +172,10 @@ void Kded::initModules()
for(KService::List::ConstIterator it = kdedModules.begin(); it != kdedModules.end(); ++it)
{
KService::Ptr service = *it;
- bool autoload = service->property("X-KDE-Kded-autoload", QVariant::Bool).toBool();
- config->setGroup(QString("Module-%1").arg(service->desktopEntryName()));
+ bool autoload = service->property("X-KDE-Kded-autoload", TQVariant::Bool).toBool();
+ config->setGroup(TQString("Module-%1").arg(service->desktopEntryName()));
autoload = config->readBoolEntry("autoload", autoload);
- for (QStringList::Iterator module = blacklist.begin(); module != blacklist.end(); ++module)
+ for (TQStringList::Iterator module = blacklist.begin(); module != blacklist.end(); ++module)
{
if (service->desktopEntryName() == *module)
{
@@ -186,7 +186,7 @@ void Kded::initModules()
if( m_newStartup )
{
// see ksmserver's README for description of the phases
- QVariant phasev = service->property("X-KDE-Kded-phase", QVariant::Int );
+ TQVariant phasev = service->property("X-KDE-Kded-phase", TQVariant::Int );
int phase = phasev.isValid() ? phasev.toInt() : 2;
bool prevent_autoload = false;
switch( phase )
@@ -211,7 +211,7 @@ void Kded::initModules()
loadModule(service, false);
}
bool dontLoad = false;
- QVariant p = service->property("X-KDE-Kded-load-on-demand", QVariant::Bool);
+ TQVariant p = service->property("X-KDE-Kded-load-on-demand", TQVariant::Bool);
if (p.isValid() && (p.toBool() == false))
dontLoad = true;
if (dontLoad)
@@ -230,22 +230,22 @@ void Kded::loadSecondPhase()
for(KService::List::ConstIterator it = kdedModules.begin(); it != kdedModules.end(); ++it)
{
KService::Ptr service = *it;
- bool autoload = service->property("X-KDE-Kded-autoload", QVariant::Bool).toBool();
- config->setGroup(QString("Module-%1").arg(service->desktopEntryName()));
+ bool autoload = service->property("X-KDE-Kded-autoload", TQVariant::Bool).toBool();
+ config->setGroup(TQString("Module-%1").arg(service->desktopEntryName()));
autoload = config->readBoolEntry("autoload", autoload);
- QVariant phasev = service->property("X-KDE-Kded-phase", QVariant::Int );
+ TQVariant phasev = service->property("X-KDE-Kded-phase", TQVariant::Int );
int phase = phasev.isValid() ? phasev.toInt() : 2;
if( phase == 2 && autoload )
loadModule(service, false);
}
}
-void Kded::noDemandLoad(const QString &obj)
+void Kded::noDemandLoad(const TQString &obj)
{
m_dontLoad.insert(obj.latin1(), this);
}
-KDEDModule *Kded::loadModule(const QCString &obj, bool onDemand)
+KDEDModule *Kded::loadModule(const TQCString &obj, bool onDemand)
{
KDEDModule *module = m_modules.find(obj);
if (module)
@@ -259,14 +259,14 @@ KDEDModule *Kded::loadModule(const KService *s, bool onDemand)
KDEDModule *module = 0;
if (s && !s->library().isEmpty())
{
- QCString obj = s->desktopEntryName().latin1();
+ TQCString obj = s->desktopEntryName().latin1();
KDEDModule *oldModule = m_modules.find(obj);
if (oldModule)
return oldModule;
if (onDemand)
{
- QVariant p = s->property("X-KDE-Kded-load-on-demand", QVariant::Bool);
+ TQVariant p = s->property("X-KDE-Kded-load-on-demand", TQVariant::Bool);
if (p.isValid() && (p.toBool() == false))
{
noDemandLoad(s->desktopEntryName());
@@ -277,49 +277,49 @@ KDEDModule *Kded::loadModule(const KService *s, bool onDemand)
KLibLoader *loader = KLibLoader::self();
- QVariant v = s->property("X-KDE-FactoryName", QVariant::String);
- QString factory = v.isValid() ? v.toString() : QString::null;
+ TQVariant v = s->property("X-KDE-FactoryName", TQVariant::String);
+ TQString factory = v.isValid() ? v.toString() : TQString::null;
if (factory.isEmpty())
{
// Stay bugward compatible
- v = s->property("X-KDE-Factory", QVariant::String);
- factory = v.isValid() ? v.toString() : QString::null;
+ v = s->property("X-KDE-Factory", TQVariant::String);
+ factory = v.isValid() ? v.toString() : TQString::null;
}
if (factory.isEmpty())
factory = s->library();
factory = "create_" + factory;
- QString libname = "kded_"+s->library();
+ TQString libname = "kded_"+s->library();
- KLibrary *lib = loader->library(QFile::encodeName(libname));
+ KLibrary *lib = loader->library(TQFile::encodeName(libname));
if (!lib)
{
kdWarning() << k_funcinfo << "Could not load library. [ "
<< loader->lastErrorMessage() << " ]" << endl;
libname.prepend("lib");
- lib = loader->library(QFile::encodeName(libname));
+ lib = loader->library(TQFile::encodeName(libname));
}
if (lib)
{
// get the create_ function
- void *create = lib->symbol(QFile::encodeName(factory));
+ void *create = lib->symbol(TQFile::encodeName(factory));
if (create)
{
// create the module
- KDEDModule* (*func)(const QCString &);
- func = (KDEDModule* (*)(const QCString &)) create;
+ KDEDModule* (*func)(const TQCString &);
+ func = (KDEDModule* (*)(const TQCString &)) create;
module = func(obj);
if (module)
{
m_modules.insert(obj, module);
m_libs.insert(obj, lib);
- connect(module, SIGNAL(moduleDeleted(KDEDModule *)), SLOT(slotKDEDModuleRemoved(KDEDModule *)));
+ connect(module, TQT_SIGNAL(moduleDeleted(KDEDModule *)), TQT_SLOT(slotKDEDModuleRemoved(KDEDModule *)));
kdDebug(7020) << "Successfully loaded module '" << obj << "'\n";
return module;
}
}
- loader->unloadLibrary(QFile::encodeName(libname));
+ loader->unloadLibrary(TQFile::encodeName(libname));
}
else
{
@@ -331,7 +331,7 @@ KDEDModule *Kded::loadModule(const KService *s, bool onDemand)
return 0;
}
-bool Kded::unloadModule(const QCString &obj)
+bool Kded::unloadModule(const TQCString &obj)
{
KDEDModule *module = m_modules.take(obj);
if (!module)
@@ -345,7 +345,7 @@ bool Kded::unloadModule(const QCString &obj)
QCStringList Kded::loadedModules()
{
QCStringList modules;
- QAsciiDictIterator<KDEDModule> it( m_modules );
+ TQAsciiDictIterator<KDEDModule> it( m_modules );
for ( ; it.current(); ++it)
modules.append( it.currentKey() );
@@ -367,22 +367,22 @@ void Kded::slotKDEDModuleRemoved(KDEDModule *module)
lib->unload();
}
-void Kded::slotApplicationRemoved(const QCString &appId)
+void Kded::slotApplicationRemoved(const TQCString &appId)
{
- for(QAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
+ for(TQAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
{
it.current()->removeAll(appId);
}
- QValueList<long> *windowIds = m_windowIdList.find(appId);
+ TQValueList<long> *windowIds = m_windowIdList.find(appId);
if (windowIds)
{
- for( QValueList<long>::ConstIterator it = windowIds->begin();
+ for( TQValueList<long>::ConstIterator it = windowIds->begin();
it != windowIds->end(); ++it)
{
long windowId = *it;
m_globalWindowIdList.remove(windowId);
- for(QAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
+ for(TQAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
{
emit it.current()->windowUnregistered(windowId);
}
@@ -398,15 +398,15 @@ void Kded::updateDirWatch()
delete m_pDirWatch;
m_pDirWatch = new KDirWatch;
- QObject::connect( m_pDirWatch, SIGNAL(dirty(const QString&)),
- this, SLOT(update(const QString&)));
- QObject::connect( m_pDirWatch, SIGNAL(created(const QString&)),
- this, SLOT(update(const QString&)));
- QObject::connect( m_pDirWatch, SIGNAL(deleted(const QString&)),
- this, SLOT(dirDeleted(const QString&)));
+ TQObject::connect( m_pDirWatch, TQT_SIGNAL(dirty(const TQString&)),
+ this, TQT_SLOT(update(const TQString&)));
+ TQObject::connect( m_pDirWatch, TQT_SIGNAL(created(const TQString&)),
+ this, TQT_SLOT(update(const TQString&)));
+ TQObject::connect( m_pDirWatch, TQT_SIGNAL(deleted(const TQString&)),
+ this, TQT_SLOT(dirDeleted(const TQString&)));
// For each resource
- for( QStringList::ConstIterator it = m_allResourceDirs.begin();
+ for( TQStringList::ConstIterator it = m_allResourceDirs.begin();
it != m_allResourceDirs.end();
++it )
{
@@ -422,9 +422,9 @@ void Kded::updateResourceList()
if (delayedCheck) return;
- QStringList dirs = KSycoca::self()->allResourceDirs();
+ TQStringList dirs = KSycoca::self()->allResourceDirs();
// For each resource
- for( QStringList::ConstIterator it = dirs.begin();
+ for( TQStringList::ConstIterator it = dirs.begin();
it != dirs.end();
++it )
{
@@ -474,7 +474,7 @@ void Kded::recreate(bool initial)
if (!initial)
{
updateDirWatch(); // Update tree first, to be sure to miss nothing.
- runBuildSycoca(this, SLOT(recreateDone()));
+ runBuildSycoca(this, TQT_SLOT(recreateDone()));
}
else
{
@@ -485,7 +485,7 @@ void Kded::recreate(bool initial)
if(delayedCheck)
{
// do a proper ksycoca check after a delay
- QTimer::singleShot( 60000, this, SLOT( runDelayedCheck()));
+ TQTimer::singleShot( 60000, this, TQT_SLOT( runDelayedCheck()));
m_needDelayedCheck = true;
delayedCheck = false;
}
@@ -500,8 +500,8 @@ void Kded::recreateDone()
for(; m_recreateCount; m_recreateCount--)
{
- QCString replyType = "void";
- QByteArray replyData;
+ TQCString replyType = "void";
+ TQByteArray replyData;
DCOPClientTransaction *transaction = m_recreateRequests.first();
if (transaction)
kapp->dcopClient()->endTransaction(transaction, replyType, replyData);
@@ -517,12 +517,12 @@ void Kded::recreateDone()
}
}
-void Kded::dirDeleted(const QString& path)
+void Kded::dirDeleted(const TQString& path)
{
update(path);
}
-void Kded::update(const QString& )
+void Kded::update(const TQString& )
{
if (!m_recreateBusy)
{
@@ -534,8 +534,8 @@ void Kded::update(const QString& )
}
}
-bool Kded::process(const QCString &fun, const QByteArray &data,
- QCString &replyType, QByteArray &replyData)
+bool Kded::process(const TQCString &fun, const TQByteArray &data,
+ TQCString &replyType, TQByteArray &replyData)
{
if (fun == "recreate()") {
if (!m_recreateBusy)
@@ -556,17 +556,17 @@ bool Kded::process(const QCString &fun, const QByteArray &data,
}
-void Kded::readDirectory( const QString& _path )
+void Kded::readDirectory( const TQString& _path )
{
- QString path( _path );
+ TQString path( _path );
if ( path.right(1) != "/" )
path += "/";
if ( m_pDirWatch->contains( path ) ) // Already seen this one?
return;
- QDir d( _path, QString::null, QDir::Unsorted, QDir::Readable | QDir::Executable | QDir::Dirs | QDir::Hidden );
- // set QDir ...
+ TQDir d( _path, TQString::null, TQDir::Unsorted, TQDir::Readable | TQDir::Executable | TQDir::Dirs | TQDir::Hidden );
+ // set TQDir ...
//************************************************************************
@@ -577,7 +577,7 @@ void Kded::readDirectory( const QString& _path )
if ( !d.exists() ) // exists&isdir?
{
- kdDebug(7020) << QString("Does not exist! (%1)").arg(_path) << endl;
+ kdDebug(7020) << TQString("Does not exist! (%1)").arg(_path) << endl;
return; // return false
}
@@ -586,7 +586,7 @@ void Kded::readDirectory( const QString& _path )
//************************************************************************
// Reading
//************************************************************************
- QString file;
+ TQString file;
unsigned int i; // counter and string length.
unsigned int count = d.count();
for( i = 0; i < count; i++ ) // check all entries
@@ -611,19 +611,19 @@ bool Kded::isWindowRegistered(long windowId)
void Kded::registerWindowId(long windowId)
{
m_globalWindowIdList.replace(windowId, &windowId);
- QCString sender = callingDcopClient()->senderId();
+ TQCString sender = callingDcopClient()->senderId();
if( sender.isEmpty()) // local call
sender = callingDcopClient()->appId();
- QValueList<long> *windowIds = m_windowIdList.find(sender);
+ TQValueList<long> *windowIds = m_windowIdList.find(sender);
if (!windowIds)
{
- windowIds = new QValueList<long>;
+ windowIds = new TQValueList<long>;
m_windowIdList.insert(sender, windowIds);
}
windowIds->append(windowId);
- for(QAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
+ for(TQAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
{
emit it.current()->windowRegistered(windowId);
}
@@ -633,10 +633,10 @@ void Kded::registerWindowId(long windowId)
void Kded::unregisterWindowId(long windowId)
{
m_globalWindowIdList.remove(windowId);
- QCString sender = callingDcopClient()->senderId();
+ TQCString sender = callingDcopClient()->senderId();
if( sender.isEmpty()) // local call
sender = callingDcopClient()->appId();
- QValueList<long> *windowIds = m_windowIdList.find(sender);
+ TQValueList<long> *windowIds = m_windowIdList.find(sender);
if (windowIds)
{
windowIds->remove(windowId);
@@ -644,7 +644,7 @@ void Kded::unregisterWindowId(long windowId)
m_windowIdList.remove(sender);
}
- for(QAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
+ for(TQAsciiDictIterator<KDEDModule> it(m_modules); it.current(); ++it)
{
emit it.current()->windowUnregistered(windowId);
}
@@ -661,16 +661,16 @@ KUpdateD::KUpdateD()
{
m_pDirWatch = new KDirWatch;
m_pTimer = new QTimer;
- connect(m_pTimer, SIGNAL(timeout()), this, SLOT(runKonfUpdate()));
- QObject::connect( m_pDirWatch, SIGNAL(dirty(const QString&)),
- this, SLOT(slotNewUpdateFile()));
+ connect(m_pTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(runKonfUpdate()));
+ TQObject::connect( m_pDirWatch, TQT_SIGNAL(dirty(const TQString&)),
+ this, TQT_SLOT(slotNewUpdateFile()));
- QStringList dirs = KGlobal::dirs()->findDirs("data", "kconf_update");
- for( QStringList::ConstIterator it = dirs.begin();
+ TQStringList dirs = KGlobal::dirs()->findDirs("data", "kconf_update");
+ for( TQStringList::ConstIterator it = dirs.begin();
it != dirs.end();
++it )
{
- QString path = *it;
+ TQString path = *it;
if (path[path.length()-1] != '/')
path += "/";
@@ -698,7 +698,7 @@ void KUpdateD::slotNewUpdateFile()
KHostnameD::KHostnameD(int pollInterval)
{
m_Timer.start(pollInterval, false /* repetitive */ );
- connect(&m_Timer, SIGNAL(timeout()), this, SLOT(checkHostname()));
+ connect(&m_Timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(checkHostname()));
checkHostname();
}
@@ -723,7 +723,7 @@ void KHostnameD::checkHostname()
if (m_hostname == buf)
return;
- QCString newHostname = buf;
+ TQCString newHostname = buf;
runDontChangeHostname(m_hostname, newHostname);
m_hostname = newHostname;
@@ -742,8 +742,8 @@ class KDEDQtDCOPObject : public DCOPObject
public:
KDEDQtDCOPObject() : DCOPObject("qt/kded") { }
- virtual bool process(const QCString &fun, const QByteArray &data,
- QCString& replyType, QByteArray &replyData)
+ virtual bool process(const TQCString &fun, const TQByteArray &data,
+ TQCString& replyType, TQByteArray &replyData)
{
if ( kapp && (fun == "quit()") )
{
@@ -779,7 +779,7 @@ public:
if( Kded::self()->newStartup())
Kded::self()->initModules();
else
- QTimer::singleShot(500, Kded::self(), SLOT(initModules()));
+ TQTimer::singleShot(500, Kded::self(), TQT_SLOT(initModules()));
} else
runBuildSycoca();
@@ -789,8 +789,8 @@ public:
QCStringList functions()
{
QCStringList res = KUniqueApplication::functions();
- res += "bool loadModule(QCString)";
- res += "bool unloadModule(QCString)";
+ res += "bool loadModule(TQCString)";
+ res += "bool unloadModule(TQCString)";
res += "void registerWindowId(long int)";
res += "void unregisterWindowId(long int)";
res += "QCStringList loadedModules()";
@@ -800,32 +800,32 @@ public:
return res;
}
- bool process(const QCString &fun, const QByteArray &data,
- QCString &replyType, QByteArray &replyData)
+ bool process(const TQCString &fun, const TQByteArray &data,
+ TQCString &replyType, TQByteArray &replyData)
{
- if (fun == "loadModule(QCString)") {
- QCString module;
- QDataStream arg( data, IO_ReadOnly );
+ if (fun == "loadModule(TQCString)") {
+ TQCString module;
+ TQDataStream arg( data, IO_ReadOnly );
arg >> module;
bool result = (Kded::self()->loadModule(module, false) != 0);
replyType = "bool";
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << result;
return true;
}
- else if (fun == "unloadModule(QCString)") {
- QCString module;
- QDataStream arg( data, IO_ReadOnly );
+ else if (fun == "unloadModule(TQCString)") {
+ TQCString module;
+ TQDataStream arg( data, IO_ReadOnly );
arg >> module;
bool result = Kded::self()->unloadModule(module);
replyType = "bool";
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << result;
return true;
}
else if (fun == "registerWindowId(long int)") {
long windowId;
- QDataStream arg( data, IO_ReadOnly );
+ TQDataStream arg( data, IO_ReadOnly );
arg >> windowId;
Kded::self()->setCallingDcopClient(callingDcopClient());
Kded::self()->registerWindowId(windowId);
@@ -834,7 +834,7 @@ public:
}
else if (fun == "unregisterWindowId(long int)") {
long windowId;
- QDataStream arg( data, IO_ReadOnly );
+ TQDataStream arg( data, IO_ReadOnly );
arg >> windowId;
Kded::self()->setCallingDcopClient(callingDcopClient());
Kded::self()->unregisterWindowId(windowId);
@@ -843,7 +843,7 @@ public:
}
else if (fun == "loadedModules()") {
replyType = "QCStringList";
- QDataStream _replyStream(replyData, IO_WriteOnly);
+ TQDataStream _replyStream(replyData, IO_WriteOnly);
_replyStream << Kded::self()->loadedModules();
return true;
}
@@ -896,7 +896,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
// Check DCOP communication.
{
DCOPClient testDCOP;
- QCString dcopName = testDCOP.registerAs("kded", false);
+ TQCString dcopName = testDCOP.registerAs("kded", false);
if (dcopName.isEmpty())
{
kdFatal() << "DCOP communication problem!" << endl;
@@ -949,8 +949,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
(void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes
DCOPClient *client = kapp->dcopClient();
- QObject::connect(client, SIGNAL(applicationRemoved(const QCString&)),
- kded, SLOT(slotApplicationRemoved(const QCString&)));
+ TQObject::connect(client, TQT_SIGNAL(applicationRemoved(const TQCString&)),
+ kded, TQT_SLOT(slotApplicationRemoved(const TQCString&)));
client->setNotifications(true);
client->setDaemonMode( true );
@@ -960,9 +960,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
// If the database changed, kbuildsycoca's signal didn't go anywhere
// anyway, because it was too early, so let's send this signal
// unconditionnally (David)
- QByteArray data;
+ TQByteArray data;
client->send( "*", "ksycoca", "notifyDatabaseChanged()", data );
- client->send( "ksplash", "", "upAndRunning(QString)", QString("kded"));
+ client->send( "ksplash", "", "upAndRunning(TQString)", TQString("kded"));
#ifdef Q_WS_X11
XEvent e;
e.xclient.type = ClientMessage;
diff --git a/kded/kded.h b/kded/kded.h
index 71694b5f7..1b6ebe481 100644
--- a/kded/kded.h
+++ b/kded/kded.h
@@ -20,11 +20,11 @@
#ifndef __kded_h__
#define __kded_h__
-#include <qobject.h>
-#include <qstring.h>
-#include <qtimer.h>
-#include <qasciidict.h>
-#include <qintdict.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqtimer.h>
+#include <tqasciidict.h>
+#include <tqintdict.h>
#include <dcopclient.h>
#include <dcopobject.h>
@@ -38,7 +38,7 @@ class KDirWatch;
class KService;
// No need for this in libkio - apps only get readonly access
-class Kded : public QObject, public DCOPObject, public DCOPObjectProxy
+class Kded : public TQObject, public DCOPObject, public DCOPObjectProxy
{
Q_OBJECT
public:
@@ -49,25 +49,25 @@ public:
/**
* Catch calls to unknown objects.
*/
- bool process(const QCString &obj, const QCString &fun,
- const QByteArray &data,
- QCString &replyType, QByteArray &replyData);
+ bool process(const TQCString &obj, const TQCString &fun,
+ const TQByteArray &data,
+ TQCString &replyType, TQByteArray &replyData);
/**
* process DCOP message. Only calls to "recreate" are supported at
* this time.
*/
- bool process(const QCString &fun, const QByteArray &data,
- QCString &replyType, QByteArray &replyData);
+ bool process(const TQCString &fun, const TQByteArray &data,
+ TQCString &replyType, TQByteArray &replyData);
virtual QCStringList functions();
- void noDemandLoad(const QString &obj); // Don't load obj on demand
+ void noDemandLoad(const TQString &obj); // Don't load obj on demand
- KDEDModule *loadModule(const QCString &obj, bool onDemand);
+ KDEDModule *loadModule(const TQCString &obj, bool onDemand);
KDEDModule *loadModule(const KService *service, bool onDemand);
QCStringList loadedModules();
- bool unloadModule(const QCString &obj);
+ bool unloadModule(const TQCString &obj);
bool isWindowRegistered(long windowId);
void registerWindowId(long windowId);
void unregisterWindowId(long windowId);
@@ -103,7 +103,7 @@ public slots:
/**
* An application unregistered itself with DCOP
*/
- void slotApplicationRemoved(const QCString &appId);
+ void slotApplicationRemoved(const TQCString &appId);
/**
* A KDEDModule is about to get destroyed.
@@ -115,12 +115,12 @@ protected slots:
/**
* @internal Triggers rebuilding
*/
- void dirDeleted(const QString& path);
+ void dirDeleted(const TQString& path);
/**
* @internal Triggers rebuilding
*/
- void update (const QString& dir );
+ void update (const TQString& dir );
/**
* @internal Installs crash handler
@@ -133,7 +133,7 @@ protected:
/**
* Scans dir for new files and new subdirectories.
*/
- void readDirectory(const QString& dir );
+ void readDirectory(const TQString& dir );
static void crashHandler(int);
@@ -152,18 +152,18 @@ protected:
* before rebuilding the binary - so that multiple updates result
* in only one rebuilding.
*/
- QTimer* m_pTimer;
+ TQTimer* m_pTimer;
- QValueList<DCOPClientTransaction *> m_recreateRequests;
+ TQValueList<DCOPClientTransaction *> m_recreateRequests;
int m_recreateCount;
bool m_recreateBusy;
- QAsciiDict<KDEDModule> m_modules;
- QAsciiDict<KLibrary> m_libs;
- QAsciiDict<QObject> m_dontLoad;
- QAsciiDict<QValueList<long> > m_windowIdList;
- QIntDict<long> m_globalWindowIdList;
- QStringList m_allResourceDirs;
+ TQAsciiDict<KDEDModule> m_modules;
+ TQAsciiDict<KLibrary> m_libs;
+ TQAsciiDict<TQObject> m_dontLoad;
+ TQAsciiDict<TQValueList<long> > m_windowIdList;
+ TQIntDict<long> m_globalWindowIdList;
+ TQStringList m_allResourceDirs;
bool m_needDelayedCheck;
bool m_newStartup;
public:
@@ -197,7 +197,7 @@ private:
* before rebuilding the binary - so that multiple updates result
* in only one rebuilding.
*/
- QTimer* m_pTimer;
+ TQTimer* m_pTimer;
};
class KHostnameD : public QObject
@@ -214,8 +214,8 @@ private:
/**
* Timer for interval hostname checking.
*/
- QTimer m_Timer;
- QCString m_hostname;
+ TQTimer m_Timer;
+ TQCString m_hostname;
};
#endif
diff --git a/kded/kdedmodule.cpp b/kded/kdedmodule.cpp
index 8755c19da..ca28a5c62 100644
--- a/kded/kdedmodule.cpp
+++ b/kded/kdedmodule.cpp
@@ -20,28 +20,28 @@
*/
-#include <qtimer.h>
+#include <tqtimer.h>
#include "kded.h"
#include "kdedmodule.h"
#include "kconfigdata.h"
-typedef QMap<KEntryKey, KSharedPtr<KShared> > KDEDObjectMap;
+typedef TQMap<KEntryKey, KSharedPtr<KShared> > KDEDObjectMap;
class KDEDModulePrivate
{
public:
KDEDObjectMap *objMap;
int timeout;
- QTimer timer;
+ TQTimer timer;
};
-KDEDModule::KDEDModule(const QCString &name) : QObject(), DCOPObject(name)
+KDEDModule::KDEDModule(const TQCString &name) : TQObject(), DCOPObject(name)
{
d = new KDEDModulePrivate;
d->objMap = 0;
d->timeout = 0;
- connect(&(d->timer), SIGNAL(timeout()), this, SLOT(idle()));
+ connect(&(d->timer), TQT_SIGNAL(timeout()), this, TQT_SLOT(idle()));
}
KDEDModule::~KDEDModule()
@@ -62,7 +62,7 @@ void KDEDModule::resetIdle()
d->timer.start(d->timeout, true);
}
-void KDEDModule::insert(const QCString &app, const QCString &key, KShared *obj)
+void KDEDModule::insert(const TQCString &app, const TQCString &key, KShared *obj)
{
if (!d->objMap)
d->objMap = new KDEDObjectMap;
@@ -80,7 +80,7 @@ void KDEDModule::insert(const QCString &app, const QCString &key, KShared *obj)
resetIdle();
}
-KShared * KDEDModule::find(const QCString &app, const QCString &key)
+KShared * KDEDModule::find(const TQCString &app, const TQCString &key)
{
if (!d->objMap)
return 0;
@@ -93,7 +93,7 @@ KShared * KDEDModule::find(const QCString &app, const QCString &key)
return it.data().data();
}
-void KDEDModule::remove(const QCString &app, const QCString &key)
+void KDEDModule::remove(const TQCString &app, const TQCString &key)
{
if (!d->objMap)
return;
@@ -103,7 +103,7 @@ void KDEDModule::remove(const QCString &app, const QCString &key)
resetIdle();
}
-void KDEDModule::removeAll(const QCString &app)
+void KDEDModule::removeAll(const TQCString &app)
{
if (!d->objMap)
return;
diff --git a/kded/kdedmodule.h b/kded/kdedmodule.h
index 3e8c7b12c..041f50303 100644
--- a/kded/kdedmodule.h
+++ b/kded/kdedmodule.h
@@ -22,7 +22,7 @@
#ifndef __KDEDMODULE_H__
#define __KDEDMODULE_H__
-#include <qobject.h>
+#include <tqobject.h>
#include <dcopobject.h>
#include <ksharedptr.h>
@@ -40,7 +40,7 @@ class Kded;
*
* \code
* extern "C" {
- * KDE_EXPORT KDEDModule *create_xyz(QCString *name)
+ * KDE_EXPORT KDEDModule *create_xyz(TQCString *name)
* {
* return new XYZ(name);
* }
@@ -52,7 +52,7 @@ class Kded;
* @author Waldo Bastian <bastian@kde.org>
*/
-class KDE_EXPORT KDEDModule : public QObject, public DCOPObject
+class KDE_EXPORT KDEDModule : public TQObject, public DCOPObject
{
Q_OBJECT
// For inclusion in KDE4 (since it's BIC) long-needed fix for allowing
@@ -64,7 +64,7 @@ public:
/**
* Create a DCOPObject named @p name
*/
- KDEDModule(const QCString &name);
+ KDEDModule(const TQCString &name);
virtual ~KDEDModule();
@@ -91,24 +91,24 @@ public:
* Any previous object inserted with the same values for @p app
* and @p key will be removed.
*/
- void insert(const QCString &app, const QCString &key, KShared *obj);
+ void insert(const TQCString &app, const TQCString &key, KShared *obj);
/**
* Lookup object indexed with @p app and @p key
*/
- KShared *find(const QCString &app, const QCString &key);
+ KShared *find(const TQCString &app, const TQCString &key);
/**
* remove object indexed with @p app and @p key.
* The object will be deleted when it is no more referenced.
*/
- void remove(const QCString &app, const QCString &key);
+ void remove(const TQCString &app, const TQCString &key);
/**
* remove all objects indexed with @p app.
* The objects will be deleted when they are no more referenced.
*/
- void removeAll(const QCString &app);
+ void removeAll(const TQCString &app);
/**
* Returns whether a certain mainwindow has registered itself with KDED
diff --git a/kded/khostname.cpp b/kded/khostname.cpp
index fe534119b..e38c88f53 100644
--- a/kded/khostname.cpp
+++ b/kded/khostname.cpp
@@ -22,9 +22,9 @@
#include <stdlib.h>
#include <stdio.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
#include <dcopclient.h>
@@ -53,14 +53,14 @@ public:
void changeX();
void changeDcop();
- void changeStdDirs(const QCString &type);
+ void changeStdDirs(const TQCString &type);
void changeSessionManager();
protected:
- QCString oldName;
- QCString newName;
- QCString display;
- QCString home;
+ TQCString oldName;
+ TQCString newName;
+ TQCString display;
+ TQCString home;
};
KHostName::KHostName()
@@ -82,7 +82,7 @@ KHostName::KHostName()
display = ::getenv("DISPLAY");
// strip the screen number from the display
- display.replace(QRegExp("\\.[0-9]+$"), "");
+ display.replace(TQRegExp("\\.[0-9]+$"), "");
if (display.isEmpty())
{
fprintf(stderr, "%s", i18n("Error: DISPLAY environment variable not set.\n").local8Bit().data());
@@ -90,7 +90,7 @@ KHostName::KHostName()
}
}
-static QCStringList split(const QCString &str)
+static QCStringList split(const TQCString &str)
{
const char *s = str.data();
QCStringList result;
@@ -99,10 +99,10 @@ static QCStringList split(const QCString &str)
const char *i = strchr(s, ' ');
if (!i)
{
- result.append(QCString(s));
+ result.append(TQCString(s));
return result;
}
- result.append(QCString(s, i-s+1));
+ result.append(TQCString(s, i-s+1));
s = i;
while (*s == ' ') s++;
}
@@ -111,8 +111,8 @@ static QCStringList split(const QCString &str)
void KHostName::changeX()
{
- QString cmd = "xauth list";
- FILE *xFile = popen(QFile::encodeName(cmd), "r");
+ TQString cmd = "xauth list";
+ FILE *xFile = popen(TQFile::encodeName(cmd), "r");
if (!xFile)
{
fprintf(stderr, "Warning: Can't run xauth.\n");
@@ -123,7 +123,7 @@ void KHostName::changeX()
char buf[1024+1];
while (!feof(xFile))
{
- QCString line = fgets(buf, 1024, xFile);
+ TQCString line = fgets(buf, 1024, xFile);
if (line.length())
line.truncate(line.length()-1); // Strip LF.
if (!line.isEmpty())
@@ -139,14 +139,14 @@ void KHostName::changeX()
if (entries.count() != 3)
continue;
- QCString netId = entries[0];
- QCString authName = entries[1];
- QCString authKey = entries[2];
+ TQCString netId = entries[0];
+ TQCString authName = entries[1];
+ TQCString authKey = entries[2];
int i = netId.findRev(':');
if (i == -1)
continue;
- QCString netDisplay = netId.mid(i);
+ TQCString netDisplay = netId.mid(i);
if (netDisplay != display)
continue;
@@ -154,29 +154,29 @@ void KHostName::changeX()
if (i == -1)
continue;
- QCString newNetId = newName+netId.mid(i);
- QCString oldNetId = netId.left(i);
+ TQCString newNetId = newName+netId.mid(i);
+ TQCString oldNetId = netId.left(i);
if(oldNetId != oldName)
continue;
cmd = "xauth remove "+KProcess::quote(netId);
- system(QFile::encodeName(cmd));
+ system(TQFile::encodeName(cmd));
cmd = "xauth add ";
cmd += KProcess::quote(newNetId);
cmd += " ";
cmd += KProcess::quote(authName);
cmd += " ";
cmd += KProcess::quote(authKey);
- system(QFile::encodeName(cmd));
+ system(TQFile::encodeName(cmd));
}
}
void KHostName::changeDcop()
{
- QCString origFNameOld = DCOPClient::dcopServerFileOld(oldName);
- QCString fname = DCOPClient::dcopServerFile(oldName);
- QCString origFName = fname;
+ TQCString origFNameOld = DCOPClient::dcopServerFileOld(oldName);
+ TQCString fname = DCOPClient::dcopServerFile(oldName);
+ TQCString origFName = fname;
FILE *dcopFile = fopen(fname.data(), "r");
if (!dcopFile)
{
@@ -184,7 +184,7 @@ void KHostName::changeDcop()
return;
}
- QCString line1, line2;
+ TQCString line1, line2;
{
char buf[1024+1];
line1 = fgets(buf, 1024, dcopFile);
@@ -197,7 +197,7 @@ void KHostName::changeDcop()
}
fclose(dcopFile);
- QCString oldNetId = line1;
+ TQCString oldNetId = line1;
if (!newName.isEmpty())
{
@@ -208,7 +208,7 @@ void KHostName::changeDcop()
return;
}
line1 = "local/"+newName+line1.mid(i);
- QCString newNetId = line1;
+ TQCString newNetId = line1;
fname = DCOPClient::dcopServerFile(newName);
unlink(fname.data());
dcopFile = fopen(fname.data(), "w");
@@ -225,12 +225,12 @@ void KHostName::changeDcop()
fclose(dcopFile);
- QCString compatLink = DCOPClient::dcopServerFileOld(newName);
+ TQCString compatLink = DCOPClient::dcopServerFileOld(newName);
::symlink(fname.data(), compatLink.data()); // Compatibility link
// Update .ICEauthority
- QString cmd = "iceauth list "+KProcess::quote("netid="+oldNetId);
- FILE *iceFile = popen(QFile::encodeName(cmd), "r");
+ TQString cmd = "iceauth list "+KProcess::quote("netid="+oldNetId);
+ FILE *iceFile = popen(TQFile::encodeName(cmd), "r");
if (!iceFile)
{
fprintf(stderr, "Warning: Can't run iceauth.\n");
@@ -241,7 +241,7 @@ void KHostName::changeDcop()
char buf[1024+1];
while (!feof(iceFile))
{
- QCString line = fgets(buf, 1024, iceFile);
+ TQCString line = fgets(buf, 1024, iceFile);
if (line.length())
line.truncate(line.length()-1); // Strip LF.
if (!line.isEmpty())
@@ -257,10 +257,10 @@ void KHostName::changeDcop()
if (entries.count() != 5)
continue;
- QCString protName = entries[0];
- QCString netId = entries[2];
- QCString authName = entries[3];
- QCString authKey = entries[4];
+ TQCString protName = entries[0];
+ TQCString netId = entries[2];
+ TQCString authName = entries[3];
+ TQCString authKey = entries[4];
if (netId != oldNetId)
continue;
@@ -272,25 +272,25 @@ void KHostName::changeDcop()
cmd += KProcess::quote(authName);
cmd += " ";
cmd += KProcess::quote(authKey);
- system(QFile::encodeName(cmd));
+ system(TQFile::encodeName(cmd));
}
}
// Remove old entries
{
- QString cmd = "iceauth remove "+KProcess::quote("netid="+oldNetId);
- system(QFile::encodeName(cmd));
+ TQString cmd = "iceauth remove "+KProcess::quote("netid="+oldNetId);
+ system(TQFile::encodeName(cmd));
unlink(origFName.data());
origFName = DCOPClient::dcopServerFileOld(oldName); // Compatibility link
unlink(origFName.data());
}
}
-void KHostName::changeStdDirs(const QCString &type)
+void KHostName::changeStdDirs(const TQCString &type)
{
// We make links to the old dirs cause we can't delete the old dirs.
- QCString oldDir = QFile::encodeName(QString("%1%2-%3").arg(KGlobal::dirs()->localkdedir()).arg(type).arg(oldName));
- QCString newDir = QFile::encodeName(QString("%1%2-%3").arg(KGlobal::dirs()->localkdedir()).arg(type).arg(newName));
+ TQCString oldDir = TQFile::encodeName(TQString("%1%2-%3").arg(KGlobal::dirs()->localkdedir()).arg(type).arg(oldName));
+ TQCString newDir = TQFile::encodeName(TQString("%1%2-%3").arg(KGlobal::dirs()->localkdedir()).arg(type).arg(newName));
KDE_struct_stat st_buf;
@@ -324,7 +324,7 @@ void KHostName::changeStdDirs(const QCString &type)
void KHostName::changeSessionManager()
{
- QCString sm = ::getenv("SESSION_MANAGER");
+ TQCString sm = ::getenv("SESSION_MANAGER");
if (sm.isEmpty())
{
fprintf(stderr, "Warning: No session management specified.\n");
@@ -337,9 +337,9 @@ void KHostName::changeSessionManager()
return;
}
sm = "local/"+newName+sm.mid(i);
- QCString name = "SESSION_MANAGER";
- QByteArray params;
- QDataStream stream(params, IO_WriteOnly);
+ TQCString name = "SESSION_MANAGER";
+ TQByteArray params;
+ TQDataStream stream(params, IO_WriteOnly);
stream << name << sm;
DCOPClient *client = new DCOPClient();
if (!client->attach())
@@ -348,8 +348,8 @@ void KHostName::changeSessionManager()
delete client;
return;
}
- QCString launcher = KApplication::launcher();
- client->send(launcher, launcher, "setLaunchEnv(QCString,QCString)", params);
+ TQCString launcher = KApplication::launcher();
+ client->send(launcher, launcher, "setLaunchEnv(TQCString,TQCString)", params);
delete client;
}
diff --git a/kded/kresourcelist.h b/kded/kresourcelist.h
index 3b08af067..425481d2d 100644
--- a/kded/kresourcelist.h
+++ b/kded/kresourcelist.h
@@ -18,24 +18,24 @@
#ifndef __kresourcelist_h__
#define __kresourcelist_h__
-#include <qvaluelist.h>
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqvaluelist.h>
+#include <tqstring.h>
+#include <tqregexp.h>
class QDataStream;
class KSycocaEntry;
struct KSycocaResource
{
- QString resource;
- QString extension;
+ TQString resource;
+ TQString extension;
};
-class KSycocaResourceList : public QValueList<KSycocaResource>
+class KSycocaResourceList : public TQValueList<KSycocaResource>
{
public:
KSycocaResourceList() { };
- void add(const QString &resource, const QString &filter)
+ void add(const TQString &resource, const TQString &filter)
{
KSycocaResource res;
res.resource = resource;
diff --git a/kded/test/test.cpp b/kded/test/test.cpp
index 3e130abf6..13b7c2944 100644
--- a/kded/test/test.cpp
+++ b/kded/test/test.cpp
@@ -3,21 +3,21 @@
class TestObject : public KShared
{
public:
- TestObject(const QCString &_app) : app(_app)
+ TestObject(const TQCString &_app) : app(_app)
{ qWarning("Creating TestObject belonging to '%s'", app.data()); }
~TestObject()
{ qWarning("Destructing TestObject belonging to '%s'", app.data()); }
protected:
- QCString app;
+ TQCString app;
};
-TestModule::TestModule(const QCString &obj) : KDEDModule(obj)
+TestModule::TestModule(const TQCString &obj) : KDEDModule(obj)
{
// Do stuff here
setIdleTimeout(15); // 15 seconds idle timeout.
}
-QString TestModule::world()
+TQString TestModule::world()
{
return "Hello World!";
}
@@ -27,14 +27,14 @@ void TestModule::idle()
qWarning("TestModule is idle.");
}
-void TestModule::registerMe(const QCString &app)
+void TestModule::registerMe(const TQCString &app)
{
insert(app, "test", new TestObject(app));
// When 'app' unregisters with DCOP, the TestObject will get deleted.
}
extern "C" {
- KDE_EXPORT KDEDModule *create_test(const QCString &obj)
+ KDE_EXPORT KDEDModule *create_test(const TQCString &obj)
{
return new TestModule(obj);
}
diff --git a/kded/test/test.h b/kded/test/test.h
index c805b7921..9382a6fba 100644
--- a/kded/test/test.h
+++ b/kded/test/test.h
@@ -11,13 +11,13 @@ class TestModule : public KDEDModule
Q_OBJECT
K_DCOP
public:
- TestModule(const QCString &obj);
+ TestModule(const TQCString &obj);
void idle();
k_dcop:
- QString world();
- void registerMe(const QCString &app);
+ TQString world();
+ void registerMe(const TQCString &app);
};
#endif
diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp
index baa3c88b0..b48662cb2 100644
--- a/kded/vfolder_menu.cpp
+++ b/kded/vfolder_menu.cpp
@@ -28,18 +28,18 @@
#include <kservice.h>
#include <kde_file.h>
-#include <qmap.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qregexp.h>
+#include <tqmap.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqregexp.h>
#include "vfolder_menu.h"
-static void foldNode(QDomElement &docElem, QDomElement &e, QMap<QString,QDomElement> &dupeList, QString s=QString::null)
+static void foldNode(TQDomElement &docElem, TQDomElement &e, TQMap<TQString,TQDomElement> &dupeList, TQString s=TQString::null)
{
if (s.isEmpty())
s = e.text();
- QMap<QString,QDomElement>::iterator it = dupeList.find(s);
+ TQMap<TQString,TQDomElement>::iterator it = dupeList.find(s);
if (it != dupeList.end())
{
kdDebug(7021) << e.tagName() << " and " << s << " requires combining!" << endl;
@@ -50,46 +50,46 @@ static void foldNode(QDomElement &docElem, QDomElement &e, QMap<QString,QDomElem
dupeList.insert(s, e);
}
-static void replaceNode(QDomElement &docElem, QDomNode &n, const QStringList &list, const QString &tag)
+static void replaceNode(TQDomElement &docElem, TQDomNode &n, const TQStringList &list, const TQString &tag)
{
- for(QStringList::ConstIterator it = list.begin();
+ for(TQStringList::ConstIterator it = list.begin();
it != list.end(); ++it)
{
- QDomElement e = docElem.ownerDocument().createElement(tag);
- QDomText txt = docElem.ownerDocument().createTextNode(*it);
+ TQDomElement e = docElem.ownerDocument().createElement(tag);
+ TQDomText txt = docElem.ownerDocument().createTextNode(*it);
e.appendChild(txt);
docElem.insertAfter(e, n);
}
- QDomNode next = n.nextSibling();
+ TQDomNode next = n.nextSibling();
docElem.removeChild(n);
n = next;
// kdDebug(7021) << "Next tag = " << n.toElement().tagName() << endl;
}
-void VFolderMenu::registerFile(const QString &file)
+void VFolderMenu::registerFile(const TQString &file)
{
int i = file.findRev('/');
if (i < 0)
return;
- QString dir = file.left(i+1); // Include trailing '/'
+ TQString dir = file.left(i+1); // Include trailing '/'
registerDirectory(dir);
}
-void VFolderMenu::registerDirectory(const QString &directory)
+void VFolderMenu::registerDirectory(const TQString &directory)
{
m_allDirectories.append(directory);
}
-QStringList VFolderMenu::allDirectories()
+TQStringList VFolderMenu::allDirectories()
{
if (m_allDirectories.isEmpty())
return m_allDirectories;
m_allDirectories.sort();
- QStringList::Iterator it = m_allDirectories.begin();
- QString previous = *it++;
+ TQStringList::Iterator it = m_allDirectories.begin();
+ TQString previous = *it++;
for(;it != m_allDirectories.end();)
{
if ((*it).startsWith(previous))
@@ -106,27 +106,27 @@ QStringList VFolderMenu::allDirectories()
}
static void
-track(const QString &menuId, const QString &menuName, QDict<KService> *includeList, QDict<KService> *excludeList, QDict<KService> *itemList, const QString &comment)
+track(const TQString &menuId, const TQString &menuName, TQDict<KService> *includeList, TQDict<KService> *excludeList, TQDict<KService> *itemList, const TQString &comment)
{
if (itemList->find(menuId))
printf("%s: %s INCL %d EXCL %d\n", menuName.latin1(), comment.latin1(), includeList->find(menuId) ? 1 : 0, excludeList->find(menuId) ? 1 : 0);
}
void
-VFolderMenu::includeItems(QDict<KService> *items1, QDict<KService> *items2)
+VFolderMenu::includeItems(TQDict<KService> *items1, TQDict<KService> *items2)
{
- for(QDictIterator<KService> it(*items2); it.current(); ++it)
+ for(TQDictIterator<KService> it(*items2); it.current(); ++it)
{
items1->replace(it.current()->menuId(), it.current());
}
}
void
-VFolderMenu::matchItems(QDict<KService> *items1, QDict<KService> *items2)
+VFolderMenu::matchItems(TQDict<KService> *items1, TQDict<KService> *items2)
{
- for(QDictIterator<KService> it(*items1); it.current(); )
+ for(TQDictIterator<KService> it(*items1); it.current(); )
{
- QString id = it.current()->menuId();
+ TQString id = it.current()->menuId();
++it;
if (!items2->find(id))
items1->remove(id);
@@ -134,20 +134,20 @@ VFolderMenu::matchItems(QDict<KService> *items1, QDict<KService> *items2)
}
void
-VFolderMenu::excludeItems(QDict<KService> *items1, QDict<KService> *items2)
+VFolderMenu::excludeItems(TQDict<KService> *items1, TQDict<KService> *items2)
{
- for(QDictIterator<KService> it(*items2); it.current(); ++it)
+ for(TQDictIterator<KService> it(*items2); it.current(); ++it)
{
items1->remove(it.current()->menuId());
}
}
VFolderMenu::SubMenu*
-VFolderMenu::takeSubMenu(SubMenu *parentMenu, const QString &menuName)
+VFolderMenu::takeSubMenu(SubMenu *parentMenu, const TQString &menuName)
{
int i = menuName.find('/');
- QString s1 = i > 0 ? menuName.left(i) : menuName;
- QString s2 = menuName.mid(i+1);
+ TQString s1 = i > 0 ? menuName.left(i) : menuName;
+ TQString s2 = menuName.mid(i+1);
// Look up menu
for(SubMenu *menu = parentMenu->subMenus.first(); menu; menu = parentMenu->subMenus.next())
@@ -173,8 +173,8 @@ VFolderMenu::mergeMenu(SubMenu *menu1, SubMenu *menu2, bool reversePriority)
{
if (m_track)
{
- track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->items), QString("Before MenuMerge w. %1 (incl)").arg(menu2->name));
- track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->excludeItems), QString("Before MenuMerge w. %1 (excl)").arg(menu2->name));
+ track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->items), TQString("Before MenuMerge w. %1 (incl)").arg(menu2->name));
+ track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->excludeItems), TQString("Before MenuMerge w. %1 (excl)").arg(menu2->name));
}
if (reversePriority)
{
@@ -221,20 +221,20 @@ VFolderMenu::mergeMenu(SubMenu *menu1, SubMenu *menu2, bool reversePriority)
if (m_track)
{
- track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->items), QString("After MenuMerge w. %1 (incl)").arg(menu2->name));
- track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->excludeItems), QString("After MenuMerge w. %1 (excl)").arg(menu2->name));
+ track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->items), TQString("After MenuMerge w. %1 (incl)").arg(menu2->name));
+ track(m_trackId, menu1->name, &(menu1->items), &(menu1->excludeItems), &(menu2->excludeItems), TQString("After MenuMerge w. %1 (excl)").arg(menu2->name));
}
delete menu2;
}
void
-VFolderMenu::insertSubMenu(SubMenu *parentMenu, const QString &menuName, SubMenu *newMenu, bool reversePriority)
+VFolderMenu::insertSubMenu(SubMenu *parentMenu, const TQString &menuName, SubMenu *newMenu, bool reversePriority)
{
int i = menuName.find('/');
- QString s1 = menuName.left(i);
- QString s2 = menuName.mid(i+1);
+ TQString s1 = menuName.left(i);
+ TQString s2 = menuName.mid(i+1);
// Look up menu
for(SubMenu *menu = parentMenu->subMenus.first(); menu; menu = parentMenu->subMenus.next())
@@ -269,7 +269,7 @@ VFolderMenu::insertSubMenu(SubMenu *parentMenu, const QString &menuName, SubMenu
}
void
-VFolderMenu::insertService(SubMenu *parentMenu, const QString &name, KService *newService)
+VFolderMenu::insertService(SubMenu *parentMenu, const TQString &name, KService *newService)
{
int i = name.find('/');
@@ -280,8 +280,8 @@ VFolderMenu::insertService(SubMenu *parentMenu, const QString &name, KService *n
return;
}
- QString s1 = name.left(i);
- QString s2 = name.mid(i+1);
+ TQString s1 = name.left(i);
+ TQString s2 = name.mid(i+1);
// Look up menu
for(SubMenu *menu = parentMenu->subMenus.first(); menu; menu = parentMenu->subMenus.next())
@@ -315,7 +315,7 @@ VFolderMenu::~VFolderMenu()
for(appsInfo *info = m_appsInfoStack.first(); \
info; info = m_appsInfoStack.next()) \
{ \
- for(QDictIterator<KService> it( info->applications ); \
+ for(TQDictIterator<KService> it( info->applications ); \
it.current(); ++it ) \
{
#define FOR_ALL_APPLICATIONS_END } }
@@ -331,7 +331,7 @@ VFolderMenu::~VFolderMenu()
#define FOR_CATEGORY_END } }
KService *
-VFolderMenu::findApplication(const QString &relPath)
+VFolderMenu::findApplication(const TQString &relPath)
{
for(appsInfo *info = m_appsInfoStack.first();
info; info = m_appsInfoStack.next())
@@ -344,7 +344,7 @@ VFolderMenu::findApplication(const QString &relPath)
}
void
-VFolderMenu::addApplication(const QString &id, KService *service)
+VFolderMenu::addApplication(const TQString &id, KService *service)
{
service->setMenuId(id);
m_appsInfo->applications.replace(id, service);
@@ -353,16 +353,16 @@ VFolderMenu::addApplication(const QString &id, KService *service)
void
VFolderMenu::buildApplicationIndex(bool unusedOnly)
{
- QPtrList<appsInfo>::ConstIterator appsInfo_it = m_appsInfoList.begin();
+ TQPtrList<appsInfo>::ConstIterator appsInfo_it = m_appsInfoList.begin();
for( ; appsInfo_it != m_appsInfoList.end(); ++appsInfo_it )
{
appsInfo *info = *appsInfo_it;
info->dictCategories.clear();
- for(QDictIterator<KService> it( info->applications );
+ for(TQDictIterator<KService> it( info->applications );
it.current(); )
{
KService *s = it.current();
- QDictIterator<KService> tmpIt = it;
+ TQDictIterator<KService> tmpIt = it;
++it;
if (unusedOnly && m_usedAppsDict.find(s->menuId()))
{
@@ -371,11 +371,11 @@ VFolderMenu::buildApplicationIndex(bool unusedOnly)
continue;
}
- QStringList cats = s->categories();
- for(QStringList::ConstIterator it2 = cats.begin();
+ TQStringList cats = s->categories();
+ for(TQStringList::ConstIterator it2 = cats.begin();
it2 != cats.end(); ++it2)
{
- const QString &cat = *it2;
+ const TQString &cat = *it2;
KService::List *list = info->dictCategories.find(cat);
if (!list)
{
@@ -429,17 +429,17 @@ VFolderMenu::unloadAppsInfo()
}
QString
-VFolderMenu::absoluteDir(const QString &_dir, const QString &baseDir, bool keepRelativeToCfg)
+VFolderMenu::absoluteDir(const TQString &_dir, const TQString &baseDir, bool keepRelativeToCfg)
{
- QString dir = _dir;
- if (QDir::isRelativePath(dir))
+ TQString dir = _dir;
+ if (TQDir::isRelativePath(dir))
{
dir = baseDir + dir;
}
if (!dir.endsWith("/"))
dir += '/';
- if (QDir::isRelativePath(dir) && !keepRelativeToCfg)
+ if (TQDir::isRelativePath(dir) && !keepRelativeToCfg)
{
dir = KGlobal::dirs()->findResource("xdgconf-menu", dir);
}
@@ -449,23 +449,23 @@ VFolderMenu::absoluteDir(const QString &_dir, const QString &baseDir, bool keepR
return dir;
}
-static void tagBaseDir(QDomDocument &doc, const QString &tag, const QString &dir)
+static void tagBaseDir(TQDomDocument &doc, const TQString &tag, const TQString &dir)
{
- QDomNodeList mergeFileList = doc.elementsByTagName(tag);
+ TQDomNodeList mergeFileList = doc.elementsByTagName(tag);
for(int i = 0; i < (int)mergeFileList.count(); i++)
{
- QDomAttr attr = doc.createAttribute("__BaseDir");
+ TQDomAttr attr = doc.createAttribute("__BaseDir");
attr.setValue(dir);
mergeFileList.item(i).toElement().setAttributeNode(attr);
}
}
-static void tagBasePath(QDomDocument &doc, const QString &tag, const QString &path)
+static void tagBasePath(TQDomDocument &doc, const TQString &tag, const TQString &path)
{
- QDomNodeList mergeFileList = doc.elementsByTagName(tag);
+ TQDomNodeList mergeFileList = doc.elementsByTagName(tag);
for(int i = 0; i < (int)mergeFileList.count(); i++)
{
- QDomAttr attr = doc.createAttribute("__BasePath");
+ TQDomAttr attr = doc.createAttribute("__BasePath");
attr.setValue(path);
mergeFileList.item(i).toElement().setAttributeNode(attr);
}
@@ -474,18 +474,18 @@ static void tagBasePath(QDomDocument &doc, const QString &tag, const QString &pa
QDomDocument
VFolderMenu::loadDoc()
{
- QDomDocument doc;
+ TQDomDocument doc;
if ( m_docInfo.path.isEmpty() )
{
return doc;
}
- QFile file( m_docInfo.path );
+ TQFile file( m_docInfo.path );
if ( !file.open( IO_ReadOnly ) )
{
kdWarning(7021) << "Could not open " << m_docInfo.path << endl;
return doc;
}
- QString errorMsg;
+ TQString errorMsg;
int errorRow;
int errorCol;
if ( !doc.setContent( &file, &errorMsg, &errorRow, &errorCol ) ) {
@@ -507,18 +507,18 @@ VFolderMenu::loadDoc()
void
-VFolderMenu::mergeFile(QDomElement &parent, const QDomNode &mergeHere)
+VFolderMenu::mergeFile(TQDomElement &parent, const TQDomNode &mergeHere)
{
kdDebug(7021) << "VFolderMenu::mergeFile: " << m_docInfo.path << endl;
- QDomDocument doc = loadDoc();
+ TQDomDocument doc = loadDoc();
- QDomElement docElem = doc.documentElement();
- QDomNode n = docElem.firstChild();
- QDomNode last = mergeHere;
+ TQDomElement docElem = doc.documentElement();
+ TQDomNode n = docElem.firstChild();
+ TQDomNode last = mergeHere;
while( !n.isNull() )
{
- QDomElement e = n.toElement(); // try to convert the node to an element.
- QDomNode next = n.nextSibling();
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomNode next = n.nextSibling();
if (e.isNull())
{
@@ -538,19 +538,19 @@ kdDebug(7021) << "VFolderMenu::mergeFile: " << m_docInfo.path << endl;
void
-VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
+VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name)
{
- QMap<QString,QDomElement> menuNodes;
- QMap<QString,QDomElement> directoryNodes;
- QMap<QString,QDomElement> appDirNodes;
- QMap<QString,QDomElement> directoryDirNodes;
- QMap<QString,QDomElement> legacyDirNodes;
- QDomElement defaultLayoutNode;
- QDomElement layoutNode;
-
- QDomNode n = docElem.firstChild();
+ TQMap<TQString,TQDomElement> menuNodes;
+ TQMap<TQString,TQDomElement> directoryNodes;
+ TQMap<TQString,TQDomElement> appDirNodes;
+ TQMap<TQString,TQDomElement> directoryDirNodes;
+ TQMap<TQString,TQDomElement> legacyDirNodes;
+ TQDomElement defaultLayoutNode;
+ TQDomElement layoutNode;
+
+ TQDomNode n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( e.isNull() ) {
// kdDebug(7021) << "Empty node" << endl;
}
@@ -587,10 +587,10 @@ VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
}
else if( e.tagName() == "Move") {
// Filter out dupes
- QString orig;
- QDomNode n2 = e.firstChild();
+ TQString orig;
+ TQDomNode n2 = e.firstChild();
while( !n2.isNull() ) {
- QDomElement e2 = n2.toElement(); // try to convert the node to an element.
+ TQDomElement e2 = n2.toElement(); // try to convert the node to an element.
if( e2.tagName() == "Old")
{
orig = e2.text();
@@ -601,17 +601,17 @@ VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
foldNode(docElem, e, appDirNodes, orig);
}
else if( e.tagName() == "Menu") {
- QString name;
+ TQString name;
mergeMenus(e, name);
- QMap<QString,QDomElement>::iterator it = menuNodes.find(name);
+ TQMap<TQString,TQDomElement>::iterator it = menuNodes.find(name);
if (it != menuNodes.end())
{
- QDomElement docElem2 = *it;
- QDomNode n2 = docElem2.firstChild();
- QDomNode first = e.firstChild();
+ TQDomElement docElem2 = *it;
+ TQDomNode n2 = docElem2.firstChild();
+ TQDomNode first = e.firstChild();
while( !n2.isNull() ) {
- QDomElement e2 = n2.toElement(); // try to convert the node to an element.
- QDomNode n3 = n2.nextSibling();
+ TQDomElement e2 = n2.toElement(); // try to convert the node to an element.
+ TQDomNode n3 = n2.nextSibling();
e.insertBefore(n2, first);
docElem2.removeChild(n2);
n2 = n3;
@@ -634,23 +634,23 @@ VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
mergeFile(docElem, n);
popDocInfo();
- QDomNode last = n;
+ TQDomNode last = n;
n = n.nextSibling();
docElem.removeChild(last); // Remove the MergeFile node
continue;
}
else if( e.tagName() == "MergeDir") {
- QString dir = absoluteDir(e.text(), e.attribute("__BaseDir"), true);
+ TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir"), true);
- QStringList dirs = KGlobal::dirs()->findDirs("xdgconf-menu", dir);
- for(QStringList::ConstIterator it=dirs.begin();
+ TQStringList dirs = KGlobal::dirs()->findDirs("xdgconf-menu", dir);
+ for(TQStringList::ConstIterator it=dirs.begin();
it != dirs.end(); ++it)
{
registerDirectory(*it);
}
- QStringList fileList;
- if (!QDir::isRelativePath(dir))
+ TQStringList fileList;
+ if (!TQDir::isRelativePath(dir))
{
// Absolute
fileList = KGlobal::dirs()->findAllResources("xdgconf-menu", dir+"*.menu", false, false);
@@ -661,7 +661,7 @@ VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
(void) KGlobal::dirs()->findAllResources("xdgconf-menu", dir+"*.menu", false, true, fileList);
}
- for(QStringList::ConstIterator it=fileList.begin();
+ for(TQStringList::ConstIterator it=fileList.begin();
it != fileList.end(); ++it)
{
pushDocInfo(*it);
@@ -669,7 +669,7 @@ VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
popDocInfo();
}
- QDomNode last = n;
+ TQDomNode last = n;
n = n.nextSibling();
docElem.removeChild(last); // Remove the MergeDir node
@@ -693,19 +693,19 @@ VFolderMenu::mergeMenus(QDomElement &docElem, QString &name)
}
void
-VFolderMenu::pushDocInfo(const QString &fileName, const QString &baseDir)
+VFolderMenu::pushDocInfo(const TQString &fileName, const TQString &baseDir)
{
m_docInfoStack.push(m_docInfo);
if (!baseDir.isEmpty())
{
- if (!QDir::isRelativePath(baseDir))
+ if (!TQDir::isRelativePath(baseDir))
m_docInfo.baseDir = KGlobal::dirs()->relativeLocation("xdgconf-menu", baseDir);
else
m_docInfo.baseDir = baseDir;
}
- QString baseName = fileName;
- if (!QDir::isRelativePath(baseName))
+ TQString baseName = fileName;
+ if (!TQDir::isRelativePath(baseName))
registerFile(baseName);
else
baseName = m_docInfo.baseDir + baseName;
@@ -713,8 +713,8 @@ VFolderMenu::pushDocInfo(const QString &fileName, const QString &baseDir)
m_docInfo.path = locateMenuFile(fileName);
if (m_docInfo.path.isEmpty())
{
- m_docInfo.baseDir = QString::null;
- m_docInfo.baseName = QString::null;
+ m_docInfo.baseDir = TQString::null;
+ m_docInfo.baseName = TQString::null;
kdDebug(7021) << "Menu " << fileName << " not found." << endl;
return;
}
@@ -727,30 +727,30 @@ VFolderMenu::pushDocInfo(const QString &fileName, const QString &baseDir)
}
else
{
- m_docInfo.baseDir = QString::null;
+ m_docInfo.baseDir = TQString::null;
m_docInfo.baseName = baseName.left( baseName.length() - 5 );
}
}
void
-VFolderMenu::pushDocInfoParent(const QString &basePath, const QString &baseDir)
+VFolderMenu::pushDocInfoParent(const TQString &basePath, const TQString &baseDir)
{
m_docInfoStack.push(m_docInfo);
m_docInfo.baseDir = baseDir;
- QString fileName = basePath.mid(basePath.findRev('/')+1);
+ TQString fileName = basePath.mid(basePath.findRev('/')+1);
m_docInfo.baseName = fileName.left( fileName.length() - 5 );
- QString baseName = QDir::cleanDirPath(m_docInfo.baseDir + fileName);
+ TQString baseName = TQDir::cleanDirPath(m_docInfo.baseDir + fileName);
- QStringList result = KGlobal::dirs()->findAllResources("xdgconf-menu", baseName);
+ TQStringList result = KGlobal::dirs()->findAllResources("xdgconf-menu", baseName);
while( !result.isEmpty() && (result[0] != basePath))
result.remove(result.begin());
if (result.count() <= 1)
{
- m_docInfo.path = QString::null; // No parent found
+ m_docInfo.path = TQString::null; // No parent found
return;
}
m_docInfo.path = result[1];
@@ -763,29 +763,29 @@ VFolderMenu::popDocInfo()
}
QString
-VFolderMenu::locateMenuFile(const QString &fileName)
+VFolderMenu::locateMenuFile(const TQString &fileName)
{
- if (!QDir::isRelativePath(fileName))
+ if (!TQDir::isRelativePath(fileName))
{
if (KStandardDirs::exists(fileName))
return fileName;
- return QString::null;
+ return TQString::null;
}
- QString result;
+ TQString result;
- //QString xdgMenuPrefix = QString::fromLocal8Bit(getenv("XDG_MENU_PREFIX"));
+ //TQString xdgMenuPrefix = TQString::fromLocal8Bit(getenv("XDG_MENU_PREFIX"));
// hardcode xdgMenuPrefix to "kde-" string until proper upstream fix
- QString xdgMenuPrefix = "kde-";
+ TQString xdgMenuPrefix = "kde-";
if (!xdgMenuPrefix.isEmpty())
{
- QFileInfo fileInfo(fileName);
+ TQFileInfo fileInfo(fileName);
- QString fileNameOnly = fileInfo.fileName();
+ TQString fileNameOnly = fileInfo.fileName();
if (!fileNameOnly.startsWith(xdgMenuPrefix))
fileNameOnly = xdgMenuPrefix + fileNameOnly;
- QString baseName = QDir::cleanDirPath(m_docInfo.baseDir +
+ TQString baseName = TQDir::cleanDirPath(m_docInfo.baseDir +
fileInfo.dirPath() + "/" +
fileNameOnly);
result = locate("xdgconf-menu", baseName);
@@ -793,7 +793,7 @@ VFolderMenu::locateMenuFile(const QString &fileName)
if (result.isEmpty())
{
- QString baseName = QDir::cleanDirPath(m_docInfo.baseDir + fileName);
+ TQString baseName = TQDir::cleanDirPath(m_docInfo.baseDir + fileName);
result = locate("xdgconf-menu", baseName);
}
@@ -801,21 +801,21 @@ VFolderMenu::locateMenuFile(const QString &fileName)
}
QString
-VFolderMenu::locateDirectoryFile(const QString &fileName)
+VFolderMenu::locateDirectoryFile(const TQString &fileName)
{
if (fileName.isEmpty())
- return QString::null;
+ return TQString::null;
- if (!QDir::isRelativePath(fileName))
+ if (!TQDir::isRelativePath(fileName))
{
if (KStandardDirs::exists(fileName))
return fileName;
- return QString::null;
+ return TQString::null;
}
// First location in the list wins
- QString tmp;
- for(QStringList::ConstIterator it = m_directoryDirs.begin();
+ TQString tmp;
+ for(TQStringList::ConstIterator it = m_directoryDirs.begin();
it != m_directoryDirs.end();
++it)
{
@@ -824,23 +824,23 @@ VFolderMenu::locateDirectoryFile(const QString &fileName)
return tmp;
}
- return QString::null;
+ return TQString::null;
}
void
VFolderMenu::initDirs()
{
- m_defaultDataDirs = QStringList::split(':', KGlobal::dirs()->kfsstnd_prefixes());
- QString localDir = m_defaultDataDirs.first();
+ m_defaultDataDirs = TQStringList::split(':', KGlobal::dirs()->kfsstnd_prefixes());
+ TQString localDir = m_defaultDataDirs.first();
m_defaultDataDirs.remove(localDir); // Remove local dir
- m_defaultAppDirs = KGlobal::dirs()->findDirs("xdgdata-apps", QString::null);
- m_defaultDirectoryDirs = KGlobal::dirs()->findDirs("xdgdata-dirs", QString::null);
+ m_defaultAppDirs = KGlobal::dirs()->findDirs("xdgdata-apps", TQString::null);
+ m_defaultDirectoryDirs = KGlobal::dirs()->findDirs("xdgdata-dirs", TQString::null);
m_defaultLegacyDirs = KGlobal::dirs()->resourceDirs("apps");
}
void
-VFolderMenu::loadMenu(const QString &fileName)
+VFolderMenu::loadMenu(const TQString &fileName)
{
m_defaultMergeDirs.clear();
@@ -861,21 +861,21 @@ VFolderMenu::loadMenu(const QString &fileName)
return;
}
- QDomElement e = m_doc.documentElement();
- QString name;
+ TQDomElement e = m_doc.documentElement();
+ TQString name;
mergeMenus(e, name);
}
void
-VFolderMenu::processCondition(QDomElement &domElem, QDict<KService> *items)
+VFolderMenu::processCondition(TQDomElement &domElem, TQDict<KService> *items)
{
if (domElem.tagName() == "And")
{
- QDomNode n = domElem.firstChild();
+ TQDomNode n = domElem.firstChild();
// Look for the first child element
while (!n.isNull()) // loop in case of comments
{
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
n = n.nextSibling();
if ( !e.isNull() ) {
processCondition(e, items);
@@ -883,15 +883,15 @@ VFolderMenu::processCondition(QDomElement &domElem, QDict<KService> *items)
}
}
- QDict<KService> andItems;
+ TQDict<KService> andItems;
while( !n.isNull() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if (e.tagName() == "Not")
{
// Special handling for "and not"
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
while( !n2.isNull() ) {
- QDomElement e2 = n2.toElement();
+ TQDomElement e2 = n2.toElement();
andItems.clear();
processCondition(e2, &andItems);
excludeItems(items, &andItems);
@@ -909,11 +909,11 @@ VFolderMenu::processCondition(QDomElement &domElem, QDict<KService> *items)
}
else if (domElem.tagName() == "Or")
{
- QDomNode n = domElem.firstChild();
+ TQDomNode n = domElem.firstChild();
// Look for the first child element
while (!n.isNull()) // loop in case of comments
{
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
n = n.nextSibling();
if ( !e.isNull() ) {
processCondition(e, items);
@@ -921,9 +921,9 @@ VFolderMenu::processCondition(QDomElement &domElem, QDict<KService> *items)
}
}
- QDict<KService> orItems;
+ TQDict<KService> orItems;
while( !n.isNull() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( !e.isNull() ) {
orItems.clear();
processCondition(e, &orItems);
@@ -941,10 +941,10 @@ VFolderMenu::processCondition(QDomElement &domElem, QDict<KService> *items)
}
FOR_ALL_APPLICATIONS_END
- QDict<KService> notItems;
- QDomNode n = domElem.firstChild();
+ TQDict<KService> notItems;
+ TQDomNode n = domElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( !e.isNull() ) {
notItems.clear();
processCondition(e, &notItems);
@@ -973,7 +973,7 @@ VFolderMenu::processCondition(QDomElement &domElem, QDict<KService> *items)
}
else if (domElem.tagName() == "Filename")
{
- QString filename = domElem.text();
+ TQString filename = domElem.text();
kdDebug(7021) << "Adding file " << filename << endl;
KService *s = findApplication(filename);
if (s)
@@ -982,29 +982,29 @@ kdDebug(7021) << "Adding file " << filename << endl;
}
void
-VFolderMenu::loadApplications(const QString &dir, const QString &prefix)
+VFolderMenu::loadApplications(const TQString &dir, const TQString &prefix)
{
kdDebug(7021) << "Looking up applications under " << dir << endl;
// We look for a set of files.
- DIR *dp = opendir( QFile::encodeName(dir));
+ DIR *dp = opendir( TQFile::encodeName(dir));
if (!dp)
return;
struct dirent *ep;
KDE_struct_stat buff;
- QString _dot(".");
- QString _dotdot("..");
+ TQString _dot(".");
+ TQString _dotdot("..");
while( ( ep = readdir( dp ) ) != 0L )
{
- QString fn( QFile::decodeName(ep->d_name));
+ TQString fn( TQFile::decodeName(ep->d_name));
if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~')
continue;
- QString pathfn = dir + fn;
- if ( KDE_stat( QFile::encodeName(pathfn), &buff ) != 0 ) {
+ TQString pathfn = dir + fn;
+ if ( KDE_stat( TQFile::encodeName(pathfn), &buff ) != 0 ) {
continue; // Couldn't stat (e.g. no read permissions)
}
if ( S_ISDIR( buff.st_mode )) {
@@ -1031,24 +1031,24 @@ VFolderMenu::processKDELegacyDirs()
{
kdDebug(7021) << "processKDELegacyDirs()" << endl;
- QDict<KService> items;
- QString prefix = "kde-";
+ TQDict<KService> items;
+ TQString prefix = "kde-";
- QStringList relFiles;
- QRegExp files("\\.(desktop|kdelnk)$");
- QRegExp dirs("\\.directory$");
+ TQStringList relFiles;
+ TQRegExp files("\\.(desktop|kdelnk)$");
+ TQRegExp dirs("\\.directory$");
(void) KGlobal::dirs()->findAllResources( "apps",
- QString::null,
+ TQString::null,
true, // Recursive!
true, // uniq
relFiles);
- for(QStringList::ConstIterator it = relFiles.begin();
+ for(TQStringList::ConstIterator it = relFiles.begin();
it != relFiles.end(); ++it)
{
if (!m_forcedLegacyLoad && (dirs.search(*it) != -1))
{
- QString name = *it;
+ TQString name = *it;
if (!name.endsWith("/.directory"))
continue; // Probably ".directory", skip it.
@@ -1063,13 +1063,13 @@ kdDebug(7021) << "processKDELegacyDirs()" << endl;
if (files.search(*it) != -1)
{
- QString name = *it;
+ TQString name = *it;
KService *service = 0;
emit newService(name, &service);
if (service && !m_forcedLegacyLoad)
{
- QString id = name;
+ TQString id = name;
// Strip path from id
int i = id.findRev('/');
if (i >= 0)
@@ -1091,30 +1091,30 @@ kdDebug(7021) << "processKDELegacyDirs()" << endl;
}
void
-VFolderMenu::processLegacyDir(const QString &dir, const QString &relDir, const QString &prefix)
+VFolderMenu::processLegacyDir(const TQString &dir, const TQString &relDir, const TQString &prefix)
{
kdDebug(7021) << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix << ")" << endl;
- QDict<KService> items;
+ TQDict<KService> items;
// We look for a set of files.
- DIR *dp = opendir( QFile::encodeName(dir));
+ DIR *dp = opendir( TQFile::encodeName(dir));
if (!dp)
return;
struct dirent *ep;
KDE_struct_stat buff;
- QString _dot(".");
- QString _dotdot("..");
+ TQString _dot(".");
+ TQString _dotdot("..");
while( ( ep = readdir( dp ) ) != 0L )
{
- QString fn( QFile::decodeName(ep->d_name));
+ TQString fn( TQFile::decodeName(ep->d_name));
if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~')
continue;
- QString pathfn = dir + fn;
- if ( KDE_stat( QFile::encodeName(pathfn), &buff ) != 0 ) {
+ TQString pathfn = dir + fn;
+ if ( KDE_stat( TQFile::encodeName(pathfn), &buff ) != 0 ) {
continue; // Couldn't stat (e.g. no read permissions)
}
if ( S_ISDIR( buff.st_mode )) {
@@ -1140,7 +1140,7 @@ kdDebug(7021) << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix
emit newService(pathfn, &service);
if (service)
{
- QString id = prefix+fn;
+ TQString id = prefix+fn;
// TODO: Add legacy category
addApplication(id, service);
@@ -1158,23 +1158,23 @@ kdDebug(7021) << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix
void
-VFolderMenu::processMenu(QDomElement &docElem, int pass)
+VFolderMenu::processMenu(TQDomElement &docElem, int pass)
{
SubMenu *parentMenu = m_currentMenu;
unsigned int oldDirectoryDirsCount = m_directoryDirs.count();
- QString name;
- QString directoryFile;
+ TQString name;
+ TQString directoryFile;
bool onlyUnallocated = false;
bool isDeleted = false;
bool kdeLegacyDirsDone = false;
- QDomElement defaultLayoutNode;
- QDomElement layoutNode;
+ TQDomElement defaultLayoutNode;
+ TQDomElement layoutNode;
- QDomElement query;
- QDomNode n = docElem.firstChild();
+ TQDomElement query;
+ TQDomNode n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == "Name")
{
name = e.text();
@@ -1185,7 +1185,7 @@ VFolderMenu::processMenu(QDomElement &docElem, int pass)
}
else if (e.tagName() == "DirectoryDir")
{
- QString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
+ TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
m_directoryDirs.prepend(dir);
}
@@ -1250,7 +1250,7 @@ VFolderMenu::processMenu(QDomElement &docElem, int pass)
}
// Override previous directoryFile iff available
- QString tmp = locateDirectoryFile(directoryFile);
+ TQString tmp = locateDirectoryFile(directoryFile);
if (! tmp.isEmpty())
m_currentMenu->directoryFile = tmp;
m_currentMenu->isDeleted = isDeleted;
@@ -1281,18 +1281,18 @@ VFolderMenu::processMenu(QDomElement &docElem, int pass)
// Process AppDir and LegacyDir
if (pass == 0)
{
- QDomElement query;
- QDomNode n = docElem.firstChild();
+ TQDomElement query;
+ TQDomNode n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == "AppDir")
{
createAppsInfo();
- QString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
+ TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
registerDirectory(dir);
- loadApplications(dir, QString::null);
+ loadApplications(dir, TQString::null);
}
else if (e.tagName() == "KDELegacyDirs")
{
@@ -1314,9 +1314,9 @@ kdDebug(7021) << "Processing KDE Legacy dirs for <KDE>" << endl;
else if (e.tagName() == "LegacyDir")
{
createAppsInfo();
- QString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
+ TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
- QString prefix = e.attributes().namedItem("prefix").toAttr().value();
+ TQString prefix = e.attributes().namedItem("prefix").toAttr().value();
if (m_defaultLegacyDirs.contains(dir))
{
@@ -1341,7 +1341,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
registerDirectory(dir);
- processLegacyDir(dir, QString::null, prefix);
+ processLegacyDir(dir, TQString::null, prefix);
m_legacyNodes.replace(dir, m_currentMenu);
m_currentMenu = oldMenu;
@@ -1358,14 +1358,14 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == "Include")
{
- QDict<KService> items;
+ TQDict<KService> items;
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
while( !n2.isNull() ) {
- QDomElement e2 = n2.toElement();
+ TQDomElement e2 = n2.toElement();
items.clear();
processCondition(e2, &items);
if (m_track)
@@ -1383,11 +1383,11 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
else if (e.tagName() == "Exclude")
{
- QDict<KService> items;
+ TQDict<KService> items;
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
while( !n2.isNull() ) {
- QDomElement e2 = n2.toElement();
+ TQDomElement e2 = n2.toElement();
items.clear();
processCondition(e2, &items);
if (m_track)
@@ -1406,7 +1406,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == "Menu")
{
processMenu(e, pass);
@@ -1420,7 +1420,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
if (e.tagName() == "LegacyDir")
{
// Add legacy nodes to Menu structure
- QString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
+ TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir"));
SubMenu *legacyMenu = m_legacyNodes.find(dir);
if (legacyMenu)
{
@@ -1431,7 +1431,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
else if (e.tagName() == "KDELegacyDirs")
{
// Add legacy nodes to Menu structure
- QString dir = "<KDE>";
+ TQString dir = "<KDE>";
SubMenu *legacyMenu = m_legacyNodes.find(dir);
if (legacyMenu)
{
@@ -1446,14 +1446,14 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
{
n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == "Move")
{
- QString orig;
- QString dest;
- QDomNode n2 = e.firstChild();
+ TQString orig;
+ TQString dest;
+ TQDomNode n2 = e.firstChild();
while( !n2.isNull() ) {
- QDomElement e2 = n2.toElement(); // try to convert the node to an element.
+ TQDomElement e2 = n2.toElement(); // try to convert the node to an element.
if( e2.tagName() == "Old")
orig = e2.text();
if( e2.tagName() == "New")
@@ -1485,12 +1485,12 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl;
-static QString parseAttribute( const QDomElement &e)
+static TQString parseAttribute( const TQDomElement &e)
{
- QString option;
+ TQString option;
if ( e.hasAttribute( "show_empty" ) )
{
- QString str = e.attribute( "show_empty" );
+ TQString str = e.attribute( "show_empty" );
if ( str=="true" )
option= "ME ";
else if ( str=="false" )
@@ -1500,7 +1500,7 @@ static QString parseAttribute( const QDomElement &e)
}
if ( e.hasAttribute( "inline" ) )
{
- QString str = e.attribute( "inline" );
+ TQString str = e.attribute( "inline" );
if ( str=="true" )
option+="I ";
else if ( str=="false" )
@@ -1513,11 +1513,11 @@ static QString parseAttribute( const QDomElement &e)
bool ok;
int value = e.attribute( "inline_limit" ).toInt(&ok);
if ( ok )
- option+=QString( "IL[%1] " ).arg( value );
+ option+=TQString( "IL[%1] " ).arg( value );
}
if ( e.hasAttribute( "inline_header" ) )
{
- QString str = e.attribute( "inline_header" );
+ TQString str = e.attribute( "inline_header" );
if ( str=="true")
option+="IH ";
else if ( str == "false" )
@@ -1528,7 +1528,7 @@ static QString parseAttribute( const QDomElement &e)
}
if ( e.hasAttribute( "inline_alias" ) && e.attribute( "inline_alias" )=="true")
{
- QString str = e.attribute( "inline_alias" );
+ TQString str = e.attribute( "inline_alias" );
if ( str=="true" )
option+="IA";
else if ( str=="false" )
@@ -1544,19 +1544,19 @@ static QString parseAttribute( const QDomElement &e)
}
-static QStringList parseLayoutNode(const QDomElement &docElem)
+static TQStringList parseLayoutNode(const TQDomElement &docElem)
{
- QStringList layout;
+ TQStringList layout;
- QString optionDefaultLayout;
+ TQString optionDefaultLayout;
if( docElem.tagName()=="DefaultLayout")
optionDefaultLayout = parseAttribute( docElem);
if ( !optionDefaultLayout.isEmpty() )
layout.append( optionDefaultLayout );
- QDomNode n = docElem.firstChild();
+ TQDomNode n = docElem.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == "Separator")
{
layout.append(":S");
@@ -1568,13 +1568,13 @@ static QStringList parseLayoutNode(const QDomElement &docElem)
else if (e.tagName() == "Menuname")
{
layout.append("/"+e.text());
- QString option = parseAttribute( e );
+ TQString option = parseAttribute( e );
if( !option.isEmpty())
layout.append( option );
}
else if (e.tagName() == "Merge")
{
- QString type = e.attributeNode("type").value();
+ TQString type = e.attributeNode("type").value();
if (type == "files")
layout.append(":F");
else if (type == "menus")
@@ -1589,7 +1589,7 @@ static QStringList parseLayoutNode(const QDomElement &docElem)
}
void
-VFolderMenu::layoutMenu(VFolderMenu::SubMenu *menu, QStringList defaultLayout)
+VFolderMenu::layoutMenu(VFolderMenu::SubMenu *menu, TQStringList defaultLayout)
{
if (!menu->defaultLayoutNode.isNull())
{
@@ -1614,23 +1614,23 @@ VFolderMenu::layoutMenu(VFolderMenu::SubMenu *menu, QStringList defaultLayout)
}
void
-VFolderMenu::markUsedApplications(QDict<KService> *items)
+VFolderMenu::markUsedApplications(TQDict<KService> *items)
{
- for(QDictIterator<KService> it(*items); it.current(); ++it)
+ for(TQDictIterator<KService> it(*items); it.current(); ++it)
{
m_usedAppsDict.replace(it.current()->menuId(), it.current());
}
}
VFolderMenu::SubMenu *
-VFolderMenu::parseMenu(const QString &file, bool forceLegacyLoad)
+VFolderMenu::parseMenu(const TQString &file, bool forceLegacyLoad)
{
m_forcedLegacyLoad = false;
m_legacyLoaded = false;
m_appsInfo = 0;
- QStringList dirs = KGlobal::dirs()->resourceDirs("xdgconf-menu");
- for(QStringList::ConstIterator it=dirs.begin();
+ TQStringList dirs = KGlobal::dirs()->resourceDirs("xdgconf-menu");
+ for(TQStringList::ConstIterator it=dirs.begin();
it != dirs.end(); ++it)
{
registerDirectory(*it);
@@ -1641,7 +1641,7 @@ VFolderMenu::parseMenu(const QString &file, bool forceLegacyLoad)
delete m_rootMenu;
m_rootMenu = m_currentMenu = 0;
- QDomElement docElem = m_doc.documentElement();
+ TQDomElement docElem = m_doc.documentElement();
for (int pass = 0; pass <= 2; pass++)
{
@@ -1657,7 +1657,7 @@ VFolderMenu::parseMenu(const QString &file, bool forceLegacyLoad)
}
if (pass == 2)
{
- QStringList defaultLayout;
+ TQStringList defaultLayout;
defaultLayout << ":M"; // Sub-Menus
defaultLayout << ":F"; // Individual entries
layoutMenu(m_rootMenu, defaultLayout);
@@ -1674,7 +1674,7 @@ VFolderMenu::parseMenu(const QString &file, bool forceLegacyLoad)
}
void
-VFolderMenu::setTrackId(const QString &id)
+VFolderMenu::setTrackId(const TQString &id)
{
m_track = !id.isEmpty();
m_trackId = id;
diff --git a/kded/vfolder_menu.h b/kded/vfolder_menu.h
index 96b7e4ea6..ce7183056 100644
--- a/kded/vfolder_menu.h
+++ b/kded/vfolder_menu.h
@@ -20,12 +20,12 @@
#ifndef _VFOLDER_MENU_H_
#define _VFOLDER_MENU_H_
-#include <qobject.h>
-#include <qdom.h>
-#include <qstringlist.h>
-#include <qptrdict.h>
-#include <qptrlist.h>
-#include <qvaluestack.h>
+#include <tqobject.h>
+#include <tqdom.h>
+#include <tqstringlist.h>
+#include <tqptrdict.h>
+#include <tqptrlist.h>
+#include <tqvaluestack.h>
#include <kservice.h>
@@ -40,15 +40,15 @@ public:
~SubMenu() { subMenus.setAutoDelete(true); }
public:
- QString name;
- QString directoryFile;
- QPtrList<SubMenu> subMenus;
- QDict<KService> items;
- QDict<KService> excludeItems; // Needed when merging due to Move.
- QDomElement defaultLayoutNode;
- QDomElement layoutNode;
+ TQString name;
+ TQString directoryFile;
+ TQPtrList<SubMenu> subMenus;
+ TQDict<KService> items;
+ TQDict<KService> excludeItems; // Needed when merging due to Move.
+ TQDomElement defaultLayoutNode;
+ TQDomElement layoutNode;
bool isDeleted;
- QStringList layoutList;
+ TQStringList layoutList;
appsInfo *apps_info;
};
@@ -64,7 +64,7 @@ public:
* @param forceLegacyLoad flag indicating whether the KDE "applnk"
* directory should be processed at least once.
*/
- SubMenu *parseMenu(const QString &file, bool forceLegacyLoad=false);
+ SubMenu *parseMenu(const TQString &file, bool forceLegacyLoad=false);
/**
* Returns a list of all directories involved in the last call to
@@ -73,16 +73,16 @@ public:
* A change in any of these directories or in any of their child-
* directories can result in changes to the menu.
*/
- QStringList allDirectories();
+ TQStringList allDirectories();
/**
* Debug function to enable tracking of what happens with a specific
* menu item id
*/
- void setTrackId(const QString &id);
+ void setTrackId(const TQString &id);
signals:
- void newService(const QString &path, KService **entry);
+ void newService(const TQString &path, KService **entry);
public:
struct MenuItem
@@ -96,28 +96,28 @@ public:
};
public:
- QStringList m_allDirectories; // A list of all the directories that we touch
+ TQStringList m_allDirectories; // A list of all the directories that we touch
- QStringList m_defaultDataDirs;
- QStringList m_defaultAppDirs;
- QStringList m_defaultDirectoryDirs;
- QStringList m_defaultMergeDirs;
- QStringList m_defaultLegacyDirs;
+ TQStringList m_defaultDataDirs;
+ TQStringList m_defaultAppDirs;
+ TQStringList m_defaultDirectoryDirs;
+ TQStringList m_defaultMergeDirs;
+ TQStringList m_defaultLegacyDirs;
- QStringList m_directoryDirs; // Current set of applicable <DirectoryDir> dirs
- QDict<SubMenu> m_legacyNodes; // Dictionary that stores Menu nodes
+ TQStringList m_directoryDirs; // Current set of applicable <DirectoryDir> dirs
+ TQDict<SubMenu> m_legacyNodes; // Dictionary that stores Menu nodes
// associated with legacy tree.
class docInfo {
public:
- QString baseDir; // Relative base dir of current menu file
- QString baseName; // Filename of current menu file without ".menu"
- QString path; // Full path of current menu file including ".menu"
+ TQString baseDir; // Relative base dir of current menu file
+ TQString baseName; // Filename of current menu file without ".menu"
+ TQString path; // Full path of current menu file including ".menu"
};
docInfo m_docInfo; // docInfo for current doc
- QValueStack<VFolderMenu::docInfo> m_docInfoStack;
+ TQValueStack<VFolderMenu::docInfo> m_docInfoStack;
class appsInfo {
public:
@@ -126,39 +126,39 @@ public:
dictCategories.setAutoDelete(true);
}
- QDict<KService::List> dictCategories; // category -> apps
- QDict<KService> applications; // rel path -> service
- QPtrDict<QString> appRelPaths; // service -> rel path
+ TQDict<KService::List> dictCategories; // category -> apps
+ TQDict<KService> applications; // rel path -> service
+ TQPtrDict<TQString> appRelPaths; // service -> rel path
};
appsInfo *m_appsInfo; // appsInfo for current menu
- QPtrList<appsInfo> m_appsInfoStack; // All applicable appsInfo for current menu
- QPtrList<appsInfo> m_appsInfoList; // List of all appsInfo objects.
- QDict<KService> m_usedAppsDict; // all applications that have been allocated
+ TQPtrList<appsInfo> m_appsInfoStack; // All applicable appsInfo for current menu
+ TQPtrList<appsInfo> m_appsInfoList; // List of all appsInfo objects.
+ TQDict<KService> m_usedAppsDict; // all applications that have been allocated
- QDomDocument m_doc;
+ TQDomDocument m_doc;
SubMenu *m_rootMenu;
SubMenu *m_currentMenu;
bool m_forcedLegacyLoad;
bool m_legacyLoaded;
bool m_track;
- QString m_trackId;
+ TQString m_trackId;
private:
/**
* Lookup application by relative path
*/
- KService *findApplication(const QString &relPath);
+ KService *findApplication(const TQString &relPath);
/**
* Lookup applications by category
*/
- QPtrList<KService::List> findCategory(const QString &category);
+ TQPtrList<KService::List> findCategory(const TQString &category);
/**
* Add new application
*/
- void addApplication(const QString &id, KService *service);
+ void addApplication(const TQString &id, KService *service);
/**
* Build application indices
@@ -180,25 +180,25 @@ private:
*/
void unloadAppsInfo();
- QDomDocument loadDoc();
- void mergeMenus(QDomElement &docElem, QString &name);
- void mergeFile(QDomElement &docElem, const QDomNode &mergeHere);
- void loadMenu(const QString &filename);
+ TQDomDocument loadDoc();
+ void mergeMenus(TQDomElement &docElem, TQString &name);
+ void mergeFile(TQDomElement &docElem, const TQDomNode &mergeHere);
+ void loadMenu(const TQString &filename);
/**
* Merge the items2 set into the items1 set
*/
- void includeItems(QDict<KService> *items1, QDict<KService> *items2);
+ void includeItems(TQDict<KService> *items1, TQDict<KService> *items2);
/**
* Remove all items from the items1 set that aren't also in the items2 set
*/
- void matchItems(QDict<KService> *items1, QDict<KService> *items2);
+ void matchItems(TQDict<KService> *items1, TQDict<KService> *items2);
/**
* Remove all items in the items2 set from the items1 set
*/
- void excludeItems(QDict<KService> *items1, QDict<KService> *items2);
+ void excludeItems(TQDict<KService> *items1, TQDict<KService> *items2);
/**
* Search the parentMenu tree for the menu menuName and takes it
@@ -207,7 +207,7 @@ private:
* This function returns a pointer to the menu if it was found
* or 0 if it was not found.
*/
- SubMenu* takeSubMenu(SubMenu *parentMenu, const QString &menuName);
+ SubMenu* takeSubMenu(SubMenu *parentMenu, const TQString &menuName);
/**
* Insert the menu newMenu with name menuName into the parentMenu.
@@ -218,7 +218,7 @@ private:
* If reversePriority is true, the existing menu has priority over newMenu
* during merging.
*/
- void insertSubMenu(VFolderMenu::SubMenu *parentMenu, const QString &menuName, VFolderMenu::SubMenu *newMenu, bool reversePriority=false);
+ void insertSubMenu(VFolderMenu::SubMenu *parentMenu, const TQString &menuName, VFolderMenu::SubMenu *newMenu, bool reversePriority=false);
/**
* Merge menu2 and it's submenus into menu1 and it's submenus
@@ -231,41 +231,41 @@ private:
* Inserts service into the menu using name relative to parentMenu
* Any missing sub-menus are created.
*/
- void insertService(SubMenu *parentMenu, const QString &name, KService *newService);
+ void insertService(SubMenu *parentMenu, const TQString &name, KService *newService);
/**
* Register the directory that @p file is in.
* @see allDirectories()
*/
- void registerFile(const QString &file);
+ void registerFile(const TQString &file);
/**
* Fill m_usedAppsDict with all applications from @p items
*/
- void markUsedApplications(QDict<KService> *items);
+ void markUsedApplications(TQDict<KService> *items);
/**
* Register @p directory
* @see allDirectories()
*/
- void registerDirectory(const QString &directory);
+ void registerDirectory(const TQString &directory);
void processKDELegacyDirs();
- void processLegacyDir(const QString &dir, const QString &relDir, const QString &prefix);
- void processMenu(QDomElement &docElem, int pass);
- void layoutMenu(VFolderMenu::SubMenu *menu, QStringList defaultLayout);
- void processCondition(QDomElement &docElem, QDict<KService> *items);
+ void processLegacyDir(const TQString &dir, const TQString &relDir, const TQString &prefix);
+ void processMenu(TQDomElement &docElem, int pass);
+ void layoutMenu(VFolderMenu::SubMenu *menu, TQStringList defaultLayout);
+ void processCondition(TQDomElement &docElem, TQDict<KService> *items);
void initDirs();
- void pushDocInfo(const QString &fileName, const QString &baseDir = QString::null);
- void pushDocInfoParent(const QString &basePath, const QString &baseDir);
+ void pushDocInfo(const TQString &fileName, const TQString &baseDir = TQString::null);
+ void pushDocInfoParent(const TQString &basePath, const TQString &baseDir);
void popDocInfo();
- QString absoluteDir(const QString &_dir, const QString &baseDir, bool keepRelativeToCfg=false);
- QString locateMenuFile(const QString &fileName);
- QString locateDirectoryFile(const QString &fileName);
- void loadApplications(const QString&, const QString&);
+ TQString absoluteDir(const TQString &_dir, const TQString &baseDir, bool keepRelativeToCfg=false);
+ TQString locateMenuFile(const TQString &fileName);
+ TQString locateDirectoryFile(const TQString &fileName);
+ void loadApplications(const TQString&, const TQString&);
};
#endif