summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/mhtml
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kfile-plugins/mhtml
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfile-plugins/mhtml')
-rw-r--r--kfile-plugins/mhtml/kfile_mhtml.cpp80
-rw-r--r--kfile-plugins/mhtml/kfile_mhtml.h6
2 files changed, 43 insertions, 43 deletions
diff --git a/kfile-plugins/mhtml/kfile_mhtml.cpp b/kfile-plugins/mhtml/kfile_mhtml.cpp
index f9ef320..0a07ea9 100644
--- a/kfile-plugins/mhtml/kfile_mhtml.cpp
+++ b/kfile-plugins/mhtml/kfile_mhtml.cpp
@@ -24,48 +24,48 @@
#include <kgenericfactory.h>
#include <kmdcodec.h>
-#include <qstring.h>
-#include <qcstring.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qtextcodec.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqtextcodec.h>
typedef KGenericFactory<mhtmlPlugin> mhtmlFactory;
K_EXPORT_COMPONENT_FACTORY(kfile_mhtml, mhtmlFactory( "kfile_mhtml" ))
-mhtmlPlugin::mhtmlPlugin(QObject *parent, const char *name,
- const QStringList &args)
+mhtmlPlugin::mhtmlPlugin(TQObject *parent, const char *name,
+ const TQStringList &args)
: KFilePlugin(parent, name, args)
{
KFileMimeTypeInfo* info = addMimeTypeInfo( "application/x-mimearchive" );
KFileMimeTypeInfo::GroupInfo* group = 0L;
group = addGroupInfo(info, "mhtmlInfo", i18n("Document Information"));
KFileMimeTypeInfo::ItemInfo* item;
- item = addItemInfo(group, "Subject", i18n("Subject"), QVariant::String);
- item = addItemInfo(group, "Sender", i18n("Sender"), QVariant::String);
- item = addItemInfo(group, "Recipient", i18n("Recipient"), QVariant::String);
- item = addItemInfo(group, "CopyTo", i18n("CC"), QVariant::String);
- item = addItemInfo(group, "BlindCopyTo", i18n("BCC"), QVariant::String);
- item = addItemInfo(group, "Date", i18n("Date"), QVariant::String);
+ item = addItemInfo(group, "Subject", i18n("Subject"), TQVariant::String);
+ item = addItemInfo(group, "Sender", i18n("Sender"), TQVariant::String);
+ item = addItemInfo(group, "Recipient", i18n("Recipient"), TQVariant::String);
+ item = addItemInfo(group, "CopyTo", i18n("CC"), TQVariant::String);
+ item = addItemInfo(group, "BlindCopyTo", i18n("BCC"), TQVariant::String);
+ item = addItemInfo(group, "Date", i18n("Date"), TQVariant::String);
}
bool mhtmlPlugin::readInfo( KFileMetaInfo& info, uint /*what*/)
{
- QString mSender;
- QString mRecipient;
- QString mCopyTo;
- QString mBlindCopyTo;
- QString mSubject;
- QString mDate;
+ TQString mSender;
+ TQString mRecipient;
+ TQString mCopyTo;
+ TQString mBlindCopyTo;
+ TQString mSubject;
+ TQString mDate;
bool canUnfold;
if ( info.path().isEmpty() ) // remote file
return false;
- QFile f(info.path());
+ TQFile f(info.path());
if (!f.open(IO_ReadOnly)) return false;
- QTextStream stream(&f);
- QString l=stream.readLine();
+ TQTextStream stream(&f);
+ TQString l=stream.readLine();
int nFieldsFound = 0;
while(!l.isEmpty()){
if(l.startsWith("From: ")) {
@@ -95,7 +95,7 @@ bool mhtmlPlugin::readInfo( KFileMetaInfo& info, uint /*what*/)
}else if(l.startsWith(" ") || l.startsWith("\t")){
// unfold field
if(canUnfold){
- QString tmp=l.stripWhiteSpace();
+ TQString tmp=l.stripWhiteSpace();
if(nFieldsFound & 16) mBlindCopyTo=mBlindCopyTo+" "+tmp;
else if(nFieldsFound & 8) mCopyTo=mCopyTo+" "+tmp;
else if(nFieldsFound & 4) mSubject=mSubject+" "+tmp;
@@ -119,19 +119,19 @@ bool mhtmlPlugin::readInfo( KFileMetaInfo& info, uint /*what*/)
return true;
}
-QString mhtmlPlugin::decodeRFC2047Phrase(const QString &msg, bool removeLessGreater){
+TQString mhtmlPlugin::decodeRFC2047Phrase(const TQString &msg, bool removeLessGreater){
int st=msg.find("=?");
int en=-1;
- QString msgCopy=msg;
- QString decodedText=msgCopy.left(st);
- QString encodedText=msgCopy.mid(st);
+ TQString msgCopy=msg;
+ TQString decodedText=msgCopy.left(st);
+ TQString encodedText=msgCopy.mid(st);
st=encodedText.find("=?");
while(st!=-1){
en=encodedText.find("?=");
while(encodedText.mid(en+2,1)!=" " && en+2<(int)encodedText.length()) en=encodedText.find("?=",en+1);
if(en==-1) break;
decodedText+=encodedText.left(st);
- QString tmp=encodedText.mid(st,en-st+2);
+ TQString tmp=encodedText.mid(st,en-st+2);
encodedText=encodedText.mid(en+2);
decodedText+=decodeRFC2047String(tmp);
st=encodedText.find("=?",st+1);
@@ -140,12 +140,12 @@ QString mhtmlPlugin::decodeRFC2047Phrase(const QString &msg, bool removeLessGrea
// remove unwanted '<' and '>'
if(removeLessGreater){
if(decodedText.stripWhiteSpace().startsWith("<") && decodedText.stripWhiteSpace().endsWith(">")){
- QString tmp=decodedText.stripWhiteSpace();
+ TQString tmp=decodedText.stripWhiteSpace();
tmp=tmp.mid(1,tmp.length()-2);
decodedText=tmp;
}else{
- QString dec=decodedText;
- QString tmp;
+ TQString dec=decodedText;
+ TQString tmp;
st=decodedText.find("<");
while(st!=-1){
@@ -165,12 +165,12 @@ QString mhtmlPlugin::decodeRFC2047Phrase(const QString &msg, bool removeLessGrea
return decodedText;
}
-QString mhtmlPlugin::decodeRFC2047String(const QString &msg){
- QString charset;
- QString encoding;
- QString notEncodedText;
- QString encodedText;
- QString decodedText;
+TQString mhtmlPlugin::decodeRFC2047String(const TQString &msg){
+ TQString charset;
+ TQString encoding;
+ TQString notEncodedText;
+ TQString encodedText;
+ TQString decodedText;
int encEnd=0;
if(msg.startsWith("=?") && (encEnd=msg.findRev("?="))!=-1){
notEncodedText=msg.mid(encEnd+2);
@@ -183,13 +183,13 @@ QString mhtmlPlugin::decodeRFC2047String(const QString &msg){
if(encoding!="b" && encoding!="q") return msg;
encodedText=encodedText.mid(questionMark+3);
if(charset.find(" ")!=-1 && encodedText.find(" ")!=-1) return msg;
- QCString tmpIn;
- QCString tmpOut;
+ TQCString tmpIn;
+ TQCString tmpOut;
tmpIn = encodedText.local8Bit();
if(encoding=="q")tmpOut=KCodecs::quotedPrintableDecode(tmpIn);
else tmpOut=KCodecs::base64Decode(tmpIn);
if(charset!="us-ascii"){
- QTextCodec *codec = QTextCodec::codecForName(charset.local8Bit());
+ TQTextCodec *codec = TQTextCodec::codecForName(charset.local8Bit());
if(!codec) return msg;
decodedText=codec->toUnicode(tmpOut);
decodedText=decodedText.replace("_"," ");
diff --git a/kfile-plugins/mhtml/kfile_mhtml.h b/kfile-plugins/mhtml/kfile_mhtml.h
index dc29ec3..cb5abe9 100644
--- a/kfile-plugins/mhtml/kfile_mhtml.h
+++ b/kfile-plugins/mhtml/kfile_mhtml.h
@@ -34,11 +34,11 @@ class mhtmlPlugin: public KFilePlugin
Q_OBJECT
public:
- mhtmlPlugin( QObject *parent, const char *name, const QStringList& args );
+ mhtmlPlugin( TQObject *parent, const char *name, const TQStringList& args );
virtual bool readInfo( KFileMetaInfo& info, uint what);
private:
- QString decodeRFC2047Phrase(const QString &msg, bool removeLessGreater=TRUE);
- QString decodeRFC2047String(const QString &msg);
+ TQString decodeRFC2047Phrase(const TQString &msg, bool removeLessGreater=TRUE);
+ TQString decodeRFC2047String(const TQString &msg);
};
#endif // __KFILE_MHTML_H__