diff options
Diffstat (limited to 'ksquirrel/ksquirrelpart/sq_libraryhandler.cpp')
-rw-r--r-- | ksquirrel/ksquirrelpart/sq_libraryhandler.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp b/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp index 0e10424..a86a7e5 100644 --- a/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp +++ b/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp @@ -19,11 +19,11 @@ #include "config.h" #endif -#include <qlibrary.h> -#include <qfileinfo.h> -#include <qstringlist.h> -#include <qfile.h> -#include <qdir.h> +#include <tqlibrary.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> +#include <tqfile.h> +#include <tqdir.h> #include <kstringhandler.h> #include <ktempfile.h> @@ -46,8 +46,8 @@ static const int buffer_size = 10; SQ_LibraryHandler * SQ_LibraryHandler::m_instance = 0; // SQ_LibraryHandler -SQ_LibraryHandler::SQ_LibraryHandler(QObject *parent) - : QObject(parent), QValueVector<SQ_LIBRARY>() +SQ_LibraryHandler::SQ_LibraryHandler(TQObject *tqparent) + : TQObject(tqparent), TQValueVector<SQ_LIBRARY>() { m_instance = this; @@ -84,7 +84,7 @@ SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const KURL &url) { if((*it).mime_multi) { - if((*it).mimetype.find(mime->name()) != -1) + if((*it).mimetype.tqfind(mime->name()) != -1) { l = &(*it); break; @@ -108,7 +108,7 @@ SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const KURL &url) return l; } -SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const QString &path) +SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const TQString &path) { KURL u; u.setPath(path); @@ -119,9 +119,9 @@ SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const QString &path) /* * Get all filters as one string. */ -QString SQ_LibraryHandler::allFiltersString() const +TQString SQ_LibraryHandler::allFiltersString() const { - QString ret; + TQString ret; const_iterator itEnd = end(); @@ -135,9 +135,9 @@ QString SQ_LibraryHandler::allFiltersString() const return ret; } -QString SQ_LibraryHandler::allFiltersFileDialogString(bool r, bool allfiles) const +TQString SQ_LibraryHandler::allFiltersFileDialogString(bool r, bool allfiles) const { - QString ret; + TQString ret; const_iterator itEnd = end(); @@ -159,7 +159,7 @@ QString SQ_LibraryHandler::allFiltersFileDialogString(bool r, bool allfiles) con * Fill 'filters' with all found filters, and * 'quick' with appropriate information. */ -void SQ_LibraryHandler::allFilters(QStringList &filters, QStringList &quick) const +void SQ_LibraryHandler::allFilters(TQStringList &filters, TQStringList &quick) const { // clear rubbish filters.clear(); @@ -171,7 +171,7 @@ void SQ_LibraryHandler::allFilters(QStringList &filters, QStringList &quick) con const_iterator itEnd = end(); - // go through array and fill QStringLists + // go through array and fill TQStringLists for(const_iterator it = begin();it != itEnd;++it) if(!(*it).filter.isEmpty()) { @@ -180,7 +180,7 @@ void SQ_LibraryHandler::allFilters(QStringList &filters, QStringList &quick) con } } -void SQ_LibraryHandler::allWritableFilters(QStringList &filters, QStringList &quick) const +void SQ_LibraryHandler::allWritableFilters(TQStringList &filters, TQStringList &quick) const { // clear rubbish filters.clear(); @@ -192,7 +192,7 @@ void SQ_LibraryHandler::allWritableFilters(QStringList &filters, QStringList &qu const_iterator itEnd = end(); - // go through array and fill QStringLists + // go through array and fill TQStringLists for(const_iterator it = begin();it != itEnd;++it) if((*it).writestatic && !(*it).filter.isEmpty()) { @@ -228,32 +228,32 @@ void SQ_LibraryHandler::clear() (*it).lib = 0; } - QValueVector<SQ_LIBRARY>::clear(); + TQValueVector<SQ_LIBRARY>::clear(); } /* * Add new libraries. */ -void SQ_LibraryHandler::add(QStringList &foundLibraries) +void SQ_LibraryHandler::add(TQStringList &foundLibraries) { codec_options o; - QStringList::iterator itEnd = foundLibraries.end(); + TQStringList::iterator itEnd = foundLibraries.end(); - for(QStringList::iterator it = foundLibraries.begin();it != itEnd;++it) + for(TQStringList::iterator it = foundLibraries.begin();it != itEnd;++it) { - QFileInfo ff(*it); + TQFileInfo ff(*it); SQ_LIBRARY libtmp; - // create QLibrary object - libtmp.lib = new QLibrary(*it); + // create TQLibrary object + libtmp.lib = new TQLibrary(*it); libtmp.libpath = *it; libtmp.lib->load(); // resolve create() and destroy() functions - libtmp.codec_create = (fmt_codec_base*(*)())(libtmp.lib)->resolve(QString::fromLatin1("codec_create")); - libtmp.codec_destroy = (void (*)(fmt_codec_base*))(libtmp.lib)->resolve(QString::fromLatin1("codec_destroy")); + libtmp.codec_create = (fmt_codec_base*(*)())(libtmp.lib)->resolve(TQString::tqfromLatin1("codec_create")); + libtmp.codec_destroy = (void (*)(fmt_codec_base*))(libtmp.lib)->resolve(TQString::tqfromLatin1("codec_destroy")); // couldn't resolve - corrupted library ? if(!libtmp.codec_create || !libtmp.codec_destroy) @@ -269,14 +269,14 @@ void SQ_LibraryHandler::add(QStringList &foundLibraries) // read options codeK->options(&o); - QString q = o.name; + TQString q = o.name; // Yet unknown library ? if(!alreadyInMap(q)) { - libtmp.mime = QPixmap(reinterpret_cast<const char **>(o.pixmap)); + libtmp.mime = TQPixmap(reinterpret_cast<const char **>(o.pixmap)); libtmp.mimetype = o.mimetype; - libtmp.mime_multi = libtmp.mimetype.find(';') != -1; + libtmp.mime_multi = libtmp.mimetype.tqfind(';') != -1; libtmp.quickinfo = q; libtmp.filter = o.filter; libtmp.version = o.version; @@ -298,12 +298,12 @@ void SQ_LibraryHandler::add(QStringList &foundLibraries) libtmp.tmp = new KTempFile; libtmp.tmp->setAutoDelete(true); libtmp.tmp->close(); - codeK->settempfile(libtmp.tmp->name()); + codeK->settempfile(libtmp.tmp->name().ascii()); libtmp.tmp_il = new KTempFile; libtmp.tmp_il->setAutoDelete(true); libtmp.tmp_il->close(); - libtmp.codec_il->settempfile(libtmp.tmp_il->name()); + libtmp.codec_il->settempfile(libtmp.tmp_il->name().ascii()); } if(libtmp.writestatic) @@ -335,11 +335,11 @@ void SQ_LibraryHandler::add(QStringList &foundLibraries) /* * Is library named 'quick' already been handled ? */ -bool SQ_LibraryHandler::alreadyInMap(const QString &quick) const +bool SQ_LibraryHandler::alreadyInMap(const TQString &quick) const { const_iterator itEnd = end(); - // go through array and find 'quick' + // go through array and tqfind 'quick' for(const_iterator it = begin();it != itEnd;++it) if((*it).quickinfo == quick) return true; @@ -361,7 +361,7 @@ void SQ_LibraryHandler::dump() const for(const_iterator it = begin();it != itEnd;++it) { std::cerr << std::setw(30) - << KStringHandler::csqueeze(QFileInfo((*it).libpath).fileName(), 30) + << KStringHandler::csqueeze(TQFileInfo((*it).libpath).fileName(), 30) << std::setw(0) << " [" << KStringHandler::rsqueeze((*it).quickinfo, 45) @@ -373,14 +373,14 @@ void SQ_LibraryHandler::dump() const /* * Does any of found libraries handle given extension ? */ -bool SQ_LibraryHandler::knownExtension(const QString &ext) +bool SQ_LibraryHandler::knownExtension(const TQString &ext) { iterator itEnd = end(); // go through array and compare extensions for(iterator it = begin();it != itEnd;++it) { - if((*it).filter.contains(ext, false)) + if((*it).filter.tqcontains(ext, false)) return true; } @@ -393,7 +393,7 @@ bool SQ_LibraryHandler::knownExtension(const QString &ext) * * Name is a string, returned by fmt_quickinfo() */ -SQ_LIBRARY* SQ_LibraryHandler::libraryByName(const QString &name) +SQ_LIBRARY* SQ_LibraryHandler::libraryByName(const TQString &name) { SQ_LIBRARY *l; @@ -421,7 +421,7 @@ void SQ_LibraryHandler::writeSettings(SQ_LIBRARY *lib) fmt_settings::iterator itEnd = lib->settings.end(); - QString k; + TQString k; for(fmt_settings::iterator it = lib->settings.begin();it != itEnd;++it) { @@ -456,7 +456,7 @@ void SQ_LibraryHandler::readSettings(SQ_LIBRARY *lib) if(lib->config.isEmpty()) return; - QMap<QString, QString> map = kconf->entryMap(lib->quickinfo); + TQMap<TQString, TQString> map = kconf->entryMap(lib->quickinfo); if(!map.size()) { @@ -465,27 +465,27 @@ void SQ_LibraryHandler::readSettings(SQ_LIBRARY *lib) return; } - QMap<QString, QString>::iterator mapEnd = map.end(); + TQMap<TQString, TQString>::iterator mapEnd = map.end(); fmt_settings &sett = lib->settings; - QString d, k; + TQString d, k; settings_value val; - for(QMap<QString, QString>::iterator mapIt = map.begin();mapIt != mapEnd;++mapIt) + for(TQMap<TQString, TQString>::iterator mapIt = map.begin();mapIt != mapEnd;++mapIt) { k = mapIt.key(); d = mapIt.data(); - if(k.startsWith(QChar('i'))) + if(k.startsWith(TQChar('i'))) { val.type = settings_value::v_int; val.iVal = d.toInt(); } - else if(k.startsWith(QChar('d'))) + else if(k.startsWith(TQChar('d'))) { val.type = settings_value::v_double; val.dVal = d.toDouble(); } - else if(k.startsWith(QChar('b'))) + else if(k.startsWith(TQChar('b'))) { val.type = settings_value::v_bool; val.bVal = (d == "true"); @@ -511,16 +511,16 @@ void SQ_LibraryHandler::reload() void SQ_LibraryHandler::load() { - QStringList libs; + TQStringList libs; - QDir dir(SQ_KLIBS, QString::null, QDir::Unsorted, QDir::Files); + TQDir dir(SQ_KLIBS, TQString(), TQDir::Unsorted, TQDir::Files); - const QFileInfoList *list = dir.entryInfoList(); + const TQFileInfoList *list = dir.entryInfoList(); if(list) { - QFileInfoListIterator it(*list); - QFileInfo *fi; + TQFileInfoListIterator it(*list); + TQFileInfo *fi; while((fi = it.current()) != 0) { @@ -533,7 +533,7 @@ void SQ_LibraryHandler::load() add(libs); } -SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, const QString &mime) const +SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, const TQString &mime) const { const_iterator itEnd = constEnd(); @@ -541,7 +541,7 @@ SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, cons bool treat = SQ_Config::instance()->readBoolEntry("treat", true); // we can determine mimetype by hand or use "mime" - QString mimeDet = mime.isEmpty() ? KMimeType::findByURL(u)->name() : mime; + TQString mimeDet = mime.isEmpty() ? KMimeType::findByURL(u)->name() : mime; // mimetype by magic is not determined automatically // for non-local urls - we may support this file type or may not @@ -554,10 +554,10 @@ SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, cons { if((*it).mime_multi) { - if((*it).mimetype.find(mimeDet, 0, false) != -1) + if((*it).mimetype.tqfind(mimeDet, 0, false) != -1) return SQ_LibraryHandler::Yes; } - else if((*it).mimetype == mimeDet) // don't waste CPU time with find() + else if((*it).mimetype == mimeDet) // don't waste CPU time with tqfind() return SQ_LibraryHandler::Yes; } |