From 7346aee26bf190a7e70333c40fab4caca847cd27 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:22:56 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kfile-plugins/cert/kfile_cert.cpp | 68 ++++++++++++++-------------- kfile-plugins/cert/kfile_cert.h | 4 +- kfile-plugins/desktop/kfile_desktop.cpp | 38 ++++++++-------- kfile-plugins/desktop/kfile_desktop.h | 4 +- kfile-plugins/folder/kfile_folder.cpp | 20 ++++----- kfile-plugins/folder/kfile_folder.h | 2 +- kfile-plugins/html/kfile_html.cpp | 44 +++++++++--------- kfile-plugins/html/kfile_html.h | 2 +- kfile-plugins/lnk/kfile_lnk.cpp | 14 +++--- kfile-plugins/lnk/kfile_lnk.h | 2 +- kfile-plugins/lnk/lnkforward.cpp | 10 ++--- kfile-plugins/lnk/read_lnk.cpp | 6 +-- kfile-plugins/lnk/read_lnk.h | 10 ++--- kfile-plugins/mhtml/kfile_mhtml.cpp | 80 ++++++++++++++++----------------- kfile-plugins/mhtml/kfile_mhtml.h | 6 +-- kfile-plugins/txt/kfile_txt.cpp | 30 ++++++------- kfile-plugins/txt/kfile_txt.h | 4 +- 17 files changed, 172 insertions(+), 172 deletions(-) (limited to 'kfile-plugins') diff --git a/kfile-plugins/cert/kfile_cert.cpp b/kfile-plugins/cert/kfile_cert.cpp index 78c20f5..8a711ba 100644 --- a/kfile-plugins/cert/kfile_cert.cpp +++ b/kfile-plugins/cert/kfile_cert.cpp @@ -29,17 +29,17 @@ //#include //#include -#include -#include -#include -//#include -//#include +#include +#include +#include +//#include +//#include typedef KGenericFactory CertFactory; K_EXPORT_COMPONENT_FACTORY(kfile_cert, CertFactory("kfile-cert")) -CertPlugin::CertPlugin(QObject *parent, const char *name, const QStringList &args) +CertPlugin::CertPlugin(TQObject *parent, const char *name, const TQStringList &args) : KFilePlugin(parent, name, args) { //add the mimetype here - example: @@ -51,41 +51,41 @@ CertPlugin::CertPlugin(QObject *parent, const char *name, const QStringList &arg KFileMimeTypeInfo::ItemInfo* item; group = addGroupInfo(info, "certInfo", i18n("Certificate Information")); - item = addItemInfo(group, "ValidFrom", i18n("Valid From"), QVariant::DateTime); - item = addItemInfo(group, "ValidUntil", i18n("Valid Until"), QVariant::DateTime); - item = addItemInfo(group, "State", i18n("State"), QVariant::String); - item = addItemInfo(group, "SerialNo", i18n("Serial Number"), QVariant::String); + item = addItemInfo(group, "ValidFrom", i18n("Valid From"), TQVariant::DateTime); + item = addItemInfo(group, "ValidUntil", i18n("Valid Until"), TQVariant::DateTime); + item = addItemInfo(group, "State", i18n("State"), TQVariant::String); + item = addItemInfo(group, "SerialNo", i18n("Serial Number"), TQVariant::String); group = addGroupInfo(info, "certSubjectInfo", i18n("Subject")); - item = addItemInfo(group, "O", i18n("Organization"), QVariant::String); - item = addItemInfo(group, "OU", i18n("Organizational Unit"), QVariant::String); - item = addItemInfo(group, "L", i18n("Locality"), QVariant::String); - item = addItemInfo(group, "C", i18n("Country"), QVariant::String); - item = addItemInfo(group, "CN", i18n("Common Name"), QVariant::String); - item = addItemInfo(group, "E", i18n("Email"), QVariant::String); + item = addItemInfo(group, "O", i18n("Organization"), TQVariant::String); + item = addItemInfo(group, "OU", i18n("Organizational Unit"), TQVariant::String); + item = addItemInfo(group, "L", i18n("Locality"), TQVariant::String); + item = addItemInfo(group, "C", i18n("Country"), TQVariant::String); + item = addItemInfo(group, "CN", i18n("Common Name"), TQVariant::String); + item = addItemInfo(group, "E", i18n("Email"), TQVariant::String); group = addGroupInfo(info, "certIssuerInfo", i18n("Issuer")); - item = addItemInfo(group, "O", i18n("Organization"), QVariant::String); - item = addItemInfo(group, "OU", i18n("Organizational Unit"), QVariant::String); - item = addItemInfo(group, "L", i18n("Locality"), QVariant::String); - item = addItemInfo(group, "C", i18n("Country"), QVariant::String); - item = addItemInfo(group, "CN", i18n("Common Name"), QVariant::String); - item = addItemInfo(group, "E", i18n("Email"), QVariant::String); + item = addItemInfo(group, "O", i18n("Organization"), TQVariant::String); + item = addItemInfo(group, "OU", i18n("Organizational Unit"), TQVariant::String); + item = addItemInfo(group, "L", i18n("Locality"), TQVariant::String); + item = addItemInfo(group, "C", i18n("Country"), TQVariant::String); + item = addItemInfo(group, "CN", i18n("Common Name"), TQVariant::String); + item = addItemInfo(group, "E", i18n("Email"), TQVariant::String); //setUnit(item, KFileMimeTypeInfo::KiloBytes); // strings are possible, too: - //addItemInfo(group, "Text", i18n("Document Type"), QVariant::String); + //addItemInfo(group, "Text", i18n("Document Type"), TQVariant::String); } -void CertPlugin::appendDNItems(KFileMetaInfoGroup &group, const QString &DN) +void CertPlugin::appendDNItems(KFileMetaInfoGroup &group, const TQString &DN) { KSSLX509Map map(DN); - QString value; - //QString dbg; - QStringList keys = group.supportedKeys(); - QStringList::ConstIterator end = keys.end(); - for (QStringList::ConstIterator it = keys.begin(); it != end; ++it) { + TQString value; + //TQString dbg; + TQStringList keys = group.supportedKeys(); + TQStringList::ConstIterator end = keys.end(); + for (TQStringList::ConstIterator it = keys.begin(); it != end; ++it) { value = map.getValue(*it); //dbg += *it + " = " + value + "; "; if (!value.isNull()) appendItem(group, *it, value); @@ -93,16 +93,16 @@ void CertPlugin::appendDNItems(KFileMetaInfoGroup &group, const QString &DN) } } -static KSSLCertificate *readCertFromFile(const QString &path) +static KSSLCertificate *readCertFromFile(const TQString &path) { KSSLCertificate *ret = NULL; - QFile file(path); + TQFile file(path); if (!file.open(IO_ReadOnly)) return NULL; - QByteArray file_data = file.readAll(); + TQByteArray file_data = file.readAll(); file.close(); - QCString file_string = QCString(file_data.data(), file_data.size()); + TQCString file_string = TQCString(file_data.data(), file_data.size()); // try as is: ret = KSSLCertificate::fromString(file_string); if (ret) return ret; @@ -116,7 +116,7 @@ static KSSLCertificate *readCertFromFile(const QString &path) int end_pos = file_string.find(end_line, begin_pos); if (end_pos >= 0) { // read the data between begin and end lines - QCString body = file_string.mid(begin_pos, end_pos - begin_pos); + TQCString body = file_string.mid(begin_pos, end_pos - begin_pos); ret = KSSLCertificate::fromString(body); return ret; // even if it's NULL, we can't help it } diff --git a/kfile-plugins/cert/kfile_cert.h b/kfile-plugins/cert/kfile_cert.h index 544ef39..4ecb7a2 100644 --- a/kfile-plugins/cert/kfile_cert.h +++ b/kfile-plugins/cert/kfile_cert.h @@ -32,9 +32,9 @@ class QString; class CertPlugin: public KFilePlugin { Q_OBJECT private: - void appendDNItems(KFileMetaInfoGroup &group, const QString &DN); + void appendDNItems(KFileMetaInfoGroup &group, const TQString &DN); public: - CertPlugin(QObject *parent, const char *name, const QStringList& args); + CertPlugin(TQObject *parent, const char *name, const TQStringList& args); virtual bool readInfo(KFileMetaInfo& info, uint what); }; diff --git a/kfile-plugins/desktop/kfile_desktop.cpp b/kfile-plugins/desktop/kfile_desktop.cpp index 3a78dbc..5c56d9e 100644 --- a/kfile-plugins/desktop/kfile_desktop.cpp +++ b/kfile-plugins/desktop/kfile_desktop.cpp @@ -30,8 +30,8 @@ typedef KGenericFactory DotDesktopFactory; K_EXPORT_COMPONENT_FACTORY(kfile_desktop, DotDesktopFactory("kfile_desktop")) -KDotDesktopPlugin::KDotDesktopPlugin(QObject *parent, const char *name, - const QStringList &preferredItems) +KDotDesktopPlugin::KDotDesktopPlugin(TQObject *parent, const char *name, + const TQStringList &preferredItems) : KFilePlugin(parent, name, preferredItems) { kdDebug(7034) << ".desktop plugin\n"; @@ -43,22 +43,22 @@ KDotDesktopPlugin::KDotDesktopPlugin(QObject *parent, const char *name, info = addMimeTypeInfo("application/x-desktop"); group = addGroupInfo(info, "General", i18n("General")); - item = addItemInfo(group, "Name", i18n("Name"), QVariant::String); + item = addItemInfo(group, "Name", i18n("Name"), TQVariant::String); setHint(item, KFileMimeTypeInfo::Name); - item = addItemInfo(group, "Comment", i18n("Comment"), QVariant::String); + item = addItemInfo(group, "Comment", i18n("Comment"), TQVariant::String); setHint(item, KFileMimeTypeInfo::Description); - addItemInfo(group, "Type", i18n("Type"), QVariant::String); + addItemInfo(group, "Type", i18n("Type"), TQVariant::String); - addItemInfo(group, "Device", i18n("Device"), QVariant::String); - addItemInfo(group, "Mount Point", i18n("Mount Point"), QVariant::String); - addItemInfo(group, "File System", i18n("File System"), QVariant::String); - addItemInfo(group, "Writable", i18n("Writable"), QVariant::Bool); + addItemInfo(group, "Device", i18n("Device"), TQVariant::String); + addItemInfo(group, "Mount Point", i18n("Mount Point"), TQVariant::String); + addItemInfo(group, "File System", i18n("File System"), TQVariant::String); + addItemInfo(group, "Writable", i18n("Writable"), TQVariant::Bool); - addItemInfo(group, "File Type", i18n("File Type"), QVariant::String); - addItemInfo(group, "Service Type", i18n("Service Type"), QVariant::String); - addItemInfo(group, "Preferred Items", i18n("Preferred Items"), QVariant::String); - addItemInfo(group, "Link To", i18n("Link To"), QVariant::String); + addItemInfo(group, "File Type", i18n("File Type"), TQVariant::String); + addItemInfo(group, "Service Type", i18n("Service Type"), TQVariant::String); + addItemInfo(group, "Preferred Items", i18n("Preferred Items"), TQVariant::String); + addItemInfo(group, "Link To", i18n("Link To"), TQVariant::String); } bool KDotDesktopPlugin::readInfo( KFileMetaInfo& info, uint ) @@ -68,7 +68,7 @@ bool KDotDesktopPlugin::readInfo( KFileMetaInfo& info, uint ) KDesktopFile file(info.path(), true); - QString s; + TQString s; KFileMetaInfoGroup group = appendGroup(info, "General"); @@ -78,7 +78,7 @@ bool KDotDesktopPlugin::readInfo( KFileMetaInfo& info, uint ) s = file.readComment(); if (!s.isEmpty()) appendItem(group, "Comment", s); - QString type = file.readType(); + TQString type = file.readType(); if (type == "FSDevice") { appendItem(group, "Type", i18n("Device")); @@ -93,7 +93,7 @@ bool KDotDesktopPlugin::readInfo( KFileMetaInfo& info, uint ) if (!s.isEmpty()) appendItem(group, "File System", s); appendItem(group, "Writable", - QVariant(!file.readBoolEntry("ReadOnly", true), 42)); + TQVariant(!file.readBoolEntry("ReadOnly", true), 42)); } else if (type == "Service") @@ -107,18 +107,18 @@ bool KDotDesktopPlugin::readInfo( KFileMetaInfo& info, uint ) appendItem(group, "File Type", mt->comment()); } - QString sType = file.readEntry("ServiceTypes"); + TQString sType = file.readEntry("ServiceTypes"); appendItem(group, "Service Type", sType); if (sType == "KFilePlugin") { - QStringList preferred = file.readListEntry("PreferredItems"); + TQStringList preferred = file.readListEntry("PreferredItems"); appendItem(group, "Preferred Items", preferred); } } else if (type == "Link") { - QString url = file.readPathEntry("URL"); + TQString url = file.readPathEntry("URL"); appendItem(group, "Link To", url); } diff --git a/kfile-plugins/desktop/kfile_desktop.h b/kfile-plugins/desktop/kfile_desktop.h index 1001e22..0ef286e 100644 --- a/kfile-plugins/desktop/kfile_desktop.h +++ b/kfile-plugins/desktop/kfile_desktop.h @@ -30,8 +30,8 @@ class KDotDesktopPlugin: public KFilePlugin Q_OBJECT public: - KDotDesktopPlugin( QObject *parent, const char *name, - const QStringList& args ); + KDotDesktopPlugin( TQObject *parent, const char *name, + const TQStringList& args ); virtual bool readInfo ( KFileMetaInfo& info, uint what ); }; diff --git a/kfile-plugins/folder/kfile_folder.cpp b/kfile-plugins/folder/kfile_folder.cpp index 911a2e5..fe4ea9a 100644 --- a/kfile-plugins/folder/kfile_folder.cpp +++ b/kfile-plugins/folder/kfile_folder.cpp @@ -23,15 +23,15 @@ #include #include -#include -#include +#include +#include typedef KGenericFactory KFolderFactory; K_EXPORT_COMPONENT_FACTORY(kfile_folder, KFolderFactory( "kfile_folder" )) -KFolderPlugin::KFolderPlugin(QObject *parent, const char *name, - const QStringList &args) +KFolderPlugin::KFolderPlugin(TQObject *parent, const char *name, + const TQStringList &args) : KFilePlugin(parent, name, args) { @@ -43,8 +43,8 @@ KFolderPlugin::KFolderPlugin(QObject *parent, const char *name, KFileMimeTypeInfo::ItemInfo* item; - item = addItemInfo(group, "Items", i18n("Items"), QVariant::Int); - item = addItemInfo(group, "Size", i18n("Size"), QVariant::Int); + item = addItemInfo(group, "Items", i18n("Items"), TQVariant::Int); + item = addItemInfo(group, "Size", i18n("Size"), TQVariant::Int); setUnit(item, KFileMimeTypeInfo::Bytes); } @@ -55,17 +55,17 @@ bool KFolderPlugin::readInfo( KFileMetaInfo& info, uint /*what*/) if (info.path().isEmpty()) return false; - QDir dir; + TQDir dir; if ( !dir.cd(info.path()) ) return false; - const QPtrList *fileList = dir.entryInfoList(); + const TQPtrList *fileList = dir.entryInfoList(); if (!fileList) return false; - QPtrListIterator list = QPtrListIterator(*fileList); + TQPtrListIterator list = TQPtrListIterator(*fileList); - QFileInfo* file; + TQFileInfo* file; int items = 0; KIO::filesize_t bytes = 0; diff --git a/kfile-plugins/folder/kfile_folder.h b/kfile-plugins/folder/kfile_folder.h index 602c369..96fcd16 100644 --- a/kfile-plugins/folder/kfile_folder.h +++ b/kfile-plugins/folder/kfile_folder.h @@ -29,7 +29,7 @@ class KFolderPlugin: public KFilePlugin Q_OBJECT public: - KFolderPlugin( QObject *parent, const char *name, const QStringList& args ); + KFolderPlugin( TQObject *parent, const char *name, const TQStringList& args ); virtual bool readInfo( KFileMetaInfo& info, uint what); }; diff --git a/kfile-plugins/html/kfile_html.cpp b/kfile-plugins/html/kfile_html.cpp index bfe736b..5adddfc 100644 --- a/kfile-plugins/html/kfile_html.cpp +++ b/kfile-plugins/html/kfile_html.cpp @@ -25,17 +25,17 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include typedef KGenericFactory HtmlFactory; K_EXPORT_COMPONENT_FACTORY( kfile_html, HtmlFactory( "kfile_html" ) ) -KHtmlPlugin::KHtmlPlugin( QObject *parent, const char *name, - const QStringList &args ) +KHtmlPlugin::KHtmlPlugin( TQObject *parent, const char *name, + const TQStringList &args ) : KFilePlugin( parent, name, args ) { kdDebug(7034) << "html plugin\n"; @@ -46,13 +46,13 @@ KHtmlPlugin::KHtmlPlugin( QObject *parent, const char *name, KFileMimeTypeInfo::ItemInfo* item; group = addGroupInfo(info, "General", i18n("General")); - addItemInfo(group, "Doctype", i18n("Document Type"), QVariant::String); - addItemInfo(group, "Javascript", i18n("JavaScript"), QVariant::Bool); - item = addItemInfo(group, "Title", i18n("Title"), QVariant::String); + addItemInfo(group, "Doctype", i18n("Document Type"), TQVariant::String); + addItemInfo(group, "Javascript", i18n("JavaScript"), TQVariant::Bool); + item = addItemInfo(group, "Title", i18n("Title"), TQVariant::String); setHint(item, KFileMimeTypeInfo::Name); group = addGroupInfo(info, "Metatags", i18n("Meta Tags")); - addVariableInfo(group, QVariant::String, 0); + addVariableInfo(group, TQVariant::String, 0); } @@ -61,7 +61,7 @@ bool KHtmlPlugin::readInfo( KFileMetaInfo& info, uint ) if ( info.path().isEmpty() ) // remote file return false; - QFile f(info.path()); + TQFile f(info.path()); if (!f.open(IO_ReadOnly)) return false; @@ -70,14 +70,14 @@ bool KHtmlPlugin::readInfo( KFileMetaInfo& info, uint ) // In this case, it's better to limit the size of the buffer to something // sensible. Think a 0-filled 3GB file with an .html extension. int maxBufSize = QMIN(f.size(), 32768); - QByteArray data(maxBufSize + 1); + TQByteArray data(maxBufSize + 1); f.readBlock(data.data(), maxBufSize); data[maxBufSize]='\0'; - QString s(data); + TQString s(data); int start=0, last=0; - QRegExp exp; + TQRegExp exp; exp.setCaseSensitive(false); exp.setMinimal(true); @@ -91,7 +91,7 @@ bool KHtmlPlugin::readInfo( KFileMetaInfo& info, uint ) last += exp.matchedLength(); } - QString title; + TQString title; exp.setPattern("<\\s*title\\s*>\\s*(.*)\\s*<\\s*/\\s*title\\s*>"); if (exp.search(s, last) != -1) { @@ -101,12 +101,12 @@ bool KHtmlPlugin::readInfo( KFileMetaInfo& info, uint ) KFileMetaInfoGroup metatags = appendGroup(info, "Metatags"); - QString meta, name, content; + TQString meta, name, content; exp.setPattern("<\\s*meta\\s*([^>]*)\\s*>"); - QRegExp rxName("(?:name|http-equiv)\\s*=\\s*\"([^\"]+)\"", false); - QRegExp rxContent("content\\s*=\\s*\"([^\"]+)\"", false); - QRegExp rxCharset("charset\\s*=\\s*(.*)", false); - QTextCodec *codec = 0; + TQRegExp rxName("(?:name|http-equiv)\\s*=\\s*\"([^\"]+)\"", false); + TQRegExp rxContent("content\\s*=\\s*\"([^\"]+)\"", false); + TQRegExp rxCharset("charset\\s*=\\s*(.*)", false); + TQTextCodec *codec = 0; // find the meta tags last = 0; @@ -133,7 +133,7 @@ bool KHtmlPlugin::readInfo( KFileMetaInfo& info, uint ) if ( rxCharset.search(content) != -1 ) { kdDebug(7034) << "CodecForName : " << rxCharset.cap(1) << endl; - codec = QTextCodec::codecForName(rxCharset.cap(1).ascii()); + codec = TQTextCodec::codecForName(rxCharset.cap(1).ascii()); } } @@ -151,7 +151,7 @@ bool KHtmlPlugin::readInfo( KFileMetaInfo& info, uint ) // find out if it contains javascript exp.setPattern("