summaryrefslogtreecommitdiffstats
path: root/knode/knconfig.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /knode/knconfig.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/knconfig.cpp')
-rw-r--r--knode/knconfig.cpp156
1 files changed, 78 insertions, 78 deletions
diff --git a/knode/knconfig.cpp b/knode/knconfig.cpp
index cadf402b8..85606d89d 100644
--- a/knode/knconfig.cpp
+++ b/knode/knconfig.cpp
@@ -16,7 +16,7 @@
#include <stdlib.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include <ksimpleconfig.h>
#include <kmessagebox.h>
@@ -75,7 +75,7 @@ void KNConfig::Identity::saveConfig(KConfigBase *c)
c->writeEntry("Reply-To", r_eplyTo);
c->writeEntry("Mail-Copies-To", m_ailCopiesTo);
c->writeEntry("Org", o_rga);
- c->writeEntry("SigningKey", QString(s_igningKey));
+ c->writeEntry("SigningKey", TQString(s_igningKey));
c->writeEntry("UseSigFile", u_seSigFile);
c->writeEntry("UseSigGenerator",u_seSigGenerator);
c->writePathEntry("sigFile", s_igPath);
@@ -110,17 +110,17 @@ bool KNConfig::Identity::emailIsValid()
}
-QString KNConfig::Identity::getSignature()
+TQString KNConfig::Identity::getSignature()
{
- s_igContents = QString::null; // don't cache file contents
- s_igStdErr = QString::null;
+ s_igContents = TQString::null; // don't cache file contents
+ s_igStdErr = TQString::null;
if (u_seSigFile) {
if(!s_igPath.isEmpty()) {
if (!u_seSigGenerator) {
- QFile f(s_igPath);
+ TQFile f(s_igPath);
if(f.open(IO_ReadOnly)) {
- QTextStream ts(&f);
+ TQTextStream ts(&f);
while(!ts.atEnd()) {
s_igContents += ts.readLine();
if (!ts.atEnd())
@@ -134,12 +134,12 @@ QString KNConfig::Identity::getSignature()
KProcess process;
// construct command line...
- QStringList command = QStringList::split(' ',s_igPath);
- for ( QStringList::Iterator it = command.begin(); it != command.end(); ++it )
+ TQStringList command = TQStringList::split(' ',s_igPath);
+ for ( TQStringList::Iterator it = command.begin(); it != command.end(); ++it )
process << (*it);
- connect(&process, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(slotReceiveStdout(KProcess *, char *, int)));
- connect(&process, SIGNAL(receivedStderr(KProcess *, char *, int)), SLOT(slotReceiveStderr(KProcess *, char *, int)));
+ connect(&process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), TQT_SLOT(slotReceiveStdout(KProcess *, char *, int)));
+ connect(&process, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), TQT_SLOT(slotReceiveStderr(KProcess *, char *, int)));
if (!process.start(KProcess::Block,KProcess::AllOutput))
KMessageBox::error(knGlobals.topWidget, i18n("Cannot run the signature generator."));
@@ -158,13 +158,13 @@ QString KNConfig::Identity::getSignature()
void KNConfig::Identity::slotReceiveStdout(KProcess *, char *buffer, int buflen)
{
- s_igContents.append(QString::fromLocal8Bit(buffer,buflen));
+ s_igContents.append(TQString::fromLocal8Bit(buffer,buflen));
}
void KNConfig::Identity::slotReceiveStderr(KProcess *, char *buffer, int buflen)
{
- s_igStdErr.append(QString::fromLocal8Bit(buffer,buflen));
+ s_igStdErr.append(TQString::fromLocal8Bit(buffer,buflen));
}
@@ -179,7 +179,7 @@ KNConfig::Appearance::Appearance()
//colors
u_seColors=c->readBoolEntry("customColors", false);
- QColor defCol = defaultColor( background );
+ TQColor defCol = defaultColor( background );
c_olors[background] = c->readColorEntry( "backgroundColor", &defCol );
c_olorNames[background] = i18n("Background");
@@ -242,7 +242,7 @@ KNConfig::Appearance::Appearance()
//fonts
u_seFonts = c->readBoolEntry("customFonts", false);
- QFont defFont=KGlobalSettings::generalFont();
+ TQFont defFont=KGlobalSettings::generalFont();
f_onts[article]=c->readFontEntry("articleFont",&defFont);
f_ontNames[article]=i18n("Article Body");
@@ -319,7 +319,7 @@ void KNConfig::Appearance::save()
}
-QColor KNConfig::Appearance::backgroundColor() const
+TQColor KNConfig::Appearance::backgroundColor() const
{
if(u_seColors)
return c_olors[background];
@@ -328,7 +328,7 @@ QColor KNConfig::Appearance::backgroundColor() const
}
-QColor KNConfig::Appearance::alternateBackgroundColor() const
+TQColor KNConfig::Appearance::alternateBackgroundColor() const
{
if(u_seColors)
return c_olors[alternateBackground];
@@ -337,7 +337,7 @@ QColor KNConfig::Appearance::alternateBackgroundColor() const
}
-QColor KNConfig::Appearance::textColor() const
+TQColor KNConfig::Appearance::textColor() const
{
if(u_seColors)
return c_olors[normalText];
@@ -346,7 +346,7 @@ QColor KNConfig::Appearance::textColor() const
}
-QColor KNConfig::Appearance::quoteColor( int depth ) const
+TQColor KNConfig::Appearance::quoteColor( int depth ) const
{
if ( u_seColors )
return c_olors[quoted1 + depth];
@@ -355,7 +355,7 @@ QColor KNConfig::Appearance::quoteColor( int depth ) const
}
-QColor KNConfig::Appearance::linkColor() const
+TQColor KNConfig::Appearance::linkColor() const
{
if(u_seColors)
return c_olors[url];
@@ -365,7 +365,7 @@ QColor KNConfig::Appearance::linkColor() const
}
-QColor KNConfig::Appearance::unreadThreadColor() const
+TQColor KNConfig::Appearance::unreadThreadColor() const
{
if(u_seColors)
return c_olors[unreadThread];
@@ -374,7 +374,7 @@ QColor KNConfig::Appearance::unreadThreadColor() const
}
-QColor KNConfig::Appearance::readThreadColor() const
+TQColor KNConfig::Appearance::readThreadColor() const
{
if(u_seColors)
return c_olors[readThread];
@@ -383,7 +383,7 @@ QColor KNConfig::Appearance::readThreadColor() const
}
-QColor KNConfig::Appearance::unreadArticleColor() const
+TQColor KNConfig::Appearance::unreadArticleColor() const
{
if(u_seColors)
return c_olors[unreadArticle];
@@ -392,7 +392,7 @@ QColor KNConfig::Appearance::unreadArticleColor() const
}
-QColor KNConfig::Appearance::readArticleColor() const
+TQColor KNConfig::Appearance::readArticleColor() const
{
if(u_seColors)
return c_olors[readArticle];
@@ -401,7 +401,7 @@ QColor KNConfig::Appearance::readArticleColor() const
}
-QFont KNConfig::Appearance::articleFont() const
+TQFont KNConfig::Appearance::articleFont() const
{
if(u_seFonts)
return f_onts[article];
@@ -410,7 +410,7 @@ QFont KNConfig::Appearance::articleFont() const
}
-QFont KNConfig::Appearance::articleFixedFont() const
+TQFont KNConfig::Appearance::articleFixedFont() const
{
if(u_seFonts)
return f_onts[articleFixed];
@@ -419,7 +419,7 @@ QFont KNConfig::Appearance::articleFixedFont() const
}
-QFont KNConfig::Appearance::composerFont() const
+TQFont KNConfig::Appearance::composerFont() const
{
if(u_seFonts)
return f_onts[composer];
@@ -428,7 +428,7 @@ QFont KNConfig::Appearance::composerFont() const
}
-QFont KNConfig::Appearance::groupListFont() const
+TQFont KNConfig::Appearance::groupListFont() const
{
if(u_seFonts)
return f_onts[groupList];
@@ -437,7 +437,7 @@ QFont KNConfig::Appearance::groupListFont() const
}
-QFont KNConfig::Appearance::articleListFont() const
+TQFont KNConfig::Appearance::articleListFont() const
{
if(u_seFonts)
return f_onts[articleList];
@@ -446,7 +446,7 @@ QFont KNConfig::Appearance::articleListFont() const
}
-QColor KNConfig::Appearance::defaultColor(int i) const
+TQColor KNConfig::Appearance::defaultColor(int i) const
{
// defaults should match libkdepim/csshelper.cpp
switch(i) {
@@ -458,11 +458,11 @@ QColor KNConfig::Appearance::defaultColor(int i) const
return KGlobalSettings::alternateBackgroundColor();
case quoted1:
- return QColor( 0x00, 0x80, 0x00 );
+ return TQColor( 0x00, 0x80, 0x00 );
case quoted2:
- return QColor( 0x00, 0x70, 0x00 );
+ return TQColor( 0x00, 0x70, 0x00 );
case quoted3:
- return QColor( 0x00, 0x60, 0x00 );
+ return TQColor( 0x00, 0x60, 0x00 );
case normalText:
case unreadThread:
@@ -475,28 +475,28 @@ QColor KNConfig::Appearance::defaultColor(int i) const
return kapp->palette().disabled().text();
case unreadArticle:
- return QColor( 183, 154, 11 );
+ return TQColor( 183, 154, 11 );
case readArticle:
- return QColor( 136, 136, 136 );
+ return TQColor( 136, 136, 136 );
case signOkKeyOk:
- return QColor( 0x40, 0xFF, 0x00 );
+ return TQColor( 0x40, 0xFF, 0x00 );
case signOkKeyBad:
case signWarn:
- return QColor( 0xFF, 0xFF, 0x40 );
+ return TQColor( 0xFF, 0xFF, 0x40 );
case signErr:
return Qt::red;
case htmlWarning:
- return QColor( 0xFF, 0x40, 0x40 );
+ return TQColor( 0xFF, 0x40, 0x40 );
}
return kapp->palette().disabled().text();
}
-QFont KNConfig::Appearance::defaultFont(int i) const
+TQFont KNConfig::Appearance::defaultFont(int i) const
{
if ( i == articleFixed || i == composer )
return KGlobalSettings::fixedFont();
@@ -507,9 +507,9 @@ QFont KNConfig::Appearance::defaultFont(int i) const
void KNConfig::Appearance::recreateLVIcons()
{
- QPixmap tempPix = UserIcon("greyball");
+ TQPixmap tempPix = UserIcon("greyball");
- QImage tempImg=tempPix.convertToImage();
+ TQImage tempImg=tempPix.convertToImage();
KIconEffect::colorize(tempImg, readArticleColor(), 1.0);
i_cons[greyBall].convertFromImage(tempImg);
@@ -697,18 +697,18 @@ void KNConfig::ReadNewsViewer::save()
KNConfig::DisplayedHeaders::DisplayedHeaders()
{
- QString fname( locate("data","knode/headers.rc") );
+ TQString fname( locate("data","knode/headers.rc") );
if (!fname.isNull()) {
KSimpleConfig headerConf(fname,true);
- QStringList headers = headerConf.groupList();
+ TQStringList headers = headerConf.groupList();
headers.remove("<default>");
headers.sort();
KNDisplayedHeader *h;
- QValueList<int> flags;
+ TQValueList<int> flags;
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for( it = headers.begin(); it != headers.end(); ++it ) {
h=createNewHeader();
headerConf.setGroup((*it));
@@ -732,7 +732,7 @@ KNConfig::DisplayedHeaders::DisplayedHeaders()
KNConfig::DisplayedHeaders::~DisplayedHeaders()
{
- for ( QValueList<KNDisplayedHeader*>::Iterator it = mHeaderList.begin(); it != mHeaderList.end(); ++it )
+ for ( TQValueList<KNDisplayedHeader*>::Iterator it = mHeaderList.begin(); it != mHeaderList.end(); ++it )
delete (*it);
}
@@ -744,23 +744,23 @@ void KNConfig::DisplayedHeaders::save()
kdDebug(5003) << "KNConfig::DisplayedHeaders::save()" << endl;
- QString dir(locateLocal("data","knode/"));
+ TQString dir(locateLocal("data","knode/"));
if (dir.isNull()) {
KNHelper::displayInternalFileError();
return;
}
KSimpleConfig headerConf(dir+"headers.rc");
- QStringList oldHeaders = headerConf.groupList();
+ TQStringList oldHeaders = headerConf.groupList();
- QStringList::Iterator oldIt=oldHeaders.begin();
+ TQStringList::Iterator oldIt=oldHeaders.begin();
for( ;oldIt != oldHeaders.end(); ++oldIt ) // remove all old groups
headerConf.deleteGroup((*oldIt)); // find a better way to do it?
- QValueList<int> flags;
+ TQValueList<int> flags;
int idx=0;
- QString group;
+ TQString group;
- for ( QValueList<KNDisplayedHeader*>::Iterator it = mHeaderList.begin(); it != mHeaderList.end(); ++it ) {
+ for ( TQValueList<KNDisplayedHeader*>::Iterator it = mHeaderList.begin(); it != mHeaderList.end(); ++it ) {
group.setNum(idx++);
while (group.length()<3)
group.prepend("0");
@@ -859,7 +859,7 @@ void KNConfig::Scoring::save()
//==============================================================================================================
-KNConfig::XHeader::XHeader(const QString &s)
+KNConfig::XHeader::XHeader(const TQString &s)
{
if(s.left(2)=="X-") {
int pos=s.find(": ");
@@ -885,14 +885,14 @@ KNConfig::PostNewsTechnical::PostNewsTechnical()
c_omposerCharsets=conf->readListEntry("ComposerCharsets");
if (c_omposerCharsets.isEmpty())
- c_omposerCharsets=QStringList::split(',',"us-ascii,utf-8,iso-8859-1,iso-8859-2,"
+ c_omposerCharsets=TQStringList::split(',',"us-ascii,utf-8,iso-8859-1,iso-8859-2,"
"iso-8859-3,iso-8859-4,iso-8859-5,iso-8859-6,iso-8859-7,iso-8859-8,"
"iso-8859-9,iso-8859-10,iso-8859-13,iso-8859-14,iso-8859-15,koi8-r,koi8-u,"
"iso-2022-jp,iso-2022-jp-2,iso-2022-kr,euc-jp,euc-kr,Big5,gb2312");
c_harset=conf->readEntry("Charset").latin1();
if (c_harset.isEmpty()) {
- QCString localeCharset(QTextCodec::codecForLocale()->mimeName());
+ TQCString localeCharset(TQTextCodec::codecForLocale()->mimeName());
// special logic for japanese users:
// "euc-jp" is default encoding for them, but in the news
@@ -912,11 +912,11 @@ KNConfig::PostNewsTechnical::PostNewsTechnical()
d_ontIncludeUA=conf->readBoolEntry("dontIncludeUA", false);
u_seExternalMailer=conf->readBoolEntry("useExternalMailer", false);
- QString dir(locateLocal("data","knode/"));
+ TQString dir(locateLocal("data","knode/"));
if (!dir.isNull()) {
- QFile f(dir+"xheaders");
+ TQFile f(dir+"xheaders");
if(f.open(IO_ReadOnly)) {
- QTextStream ts(&f);
+ TQTextStream ts(&f);
while(!ts.eof())
x_headers.append( XHeader(ts.readLine()) );
@@ -942,21 +942,21 @@ void KNConfig::PostNewsTechnical::save()
conf->setGroup("POSTNEWS");
conf->writeEntry("ComposerCharsets", c_omposerCharsets);
- conf->writeEntry("Charset", QString::fromLatin1(c_harset));
+ conf->writeEntry("Charset", TQString::fromLatin1(c_harset));
conf->writeEntry("8BitEncoding", a_llow8BitBody);
conf->writeEntry("UseOwnCharset", u_seOwnCharset);
conf->writeEntry("generateMId", g_enerateMID);
- conf->writeEntry("MIdhost", QString::fromLatin1(h_ostname));
+ conf->writeEntry("MIdhost", TQString::fromLatin1(h_ostname));
conf->writeEntry("dontIncludeUA", d_ontIncludeUA);
conf->writeEntry("useExternalMailer", u_seExternalMailer);
- QString dir(locateLocal("data","knode/"));
+ TQString dir(locateLocal("data","knode/"));
if (dir.isNull())
KNHelper::displayInternalFileError();
else {
- QFile f(dir+"xheaders");
+ TQFile f(dir+"xheaders");
if(f.open(IO_WriteOnly)) {
- QTextStream ts(&f);
+ TQTextStream ts(&f);
XHeaders::Iterator it;
for(it=x_headers.begin(); it!=x_headers.end(); ++it)
ts << (*it).header() << "\n";
@@ -970,11 +970,11 @@ void KNConfig::PostNewsTechnical::save()
}
-int KNConfig::PostNewsTechnical::indexForCharset(const QCString &str)
+int KNConfig::PostNewsTechnical::indexForCharset(const TQCString &str)
{
int i=0;
bool found=false;
- for ( QStringList::Iterator it = c_omposerCharsets.begin(); it != c_omposerCharsets.end(); ++it ) {
+ for ( TQStringList::Iterator it = c_omposerCharsets.begin(); it != c_omposerCharsets.end(); ++it ) {
if ((*it).lower() == str.lower().data()) {
found = true;
break;
@@ -983,7 +983,7 @@ int KNConfig::PostNewsTechnical::indexForCharset(const QCString &str)
}
if (!found) {
i=0;
- for ( QStringList::Iterator it = c_omposerCharsets.begin(); it != c_omposerCharsets.end(); ++it ) {
+ for ( TQStringList::Iterator it = c_omposerCharsets.begin(); it != c_omposerCharsets.end(); ++it ) {
if ((*it).lower() == c_harset.lower().data()) {
found = true;
break;
@@ -997,15 +997,15 @@ int KNConfig::PostNewsTechnical::indexForCharset(const QCString &str)
}
-QCString KNConfig::PostNewsTechnical::findComposerCharset(QCString cs)
+TQCString KNConfig::PostNewsTechnical::findComposerCharset(TQCString cs)
{
- QCString *ret=findComposerCSCache.find(cs);
+ TQCString *ret=findComposerCSCache.find(cs);
if (ret)
return *ret;
- QCString s;
+ TQCString s;
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for( it = c_omposerCharsets.begin(); it != c_omposerCharsets.end(); ++it ) {
// match by name
if ((*it).lower()==cs.lower().data()) {
@@ -1018,8 +1018,8 @@ QCString KNConfig::PostNewsTechnical::findComposerCharset(QCString cs)
for( it = c_omposerCharsets.begin(); it != c_omposerCharsets.end(); ++it ) {
// match by charset, avoid to return "us-ascii" for iso-8859-1
if ((*it).lower()!="us-ascii") {
- QTextCodec *composerCodec = QTextCodec::codecForName((*it).latin1());
- QTextCodec *csCodec = QTextCodec::codecForName(cs);
+ TQTextCodec *composerCodec = TQTextCodec::codecForName((*it).latin1());
+ TQTextCodec *csCodec = TQTextCodec::codecForName(cs);
if ((composerCodec != 0) &&
(csCodec != 0) &&
(0 == strcmp(composerCodec->name(), csCodec->name()))) {
@@ -1033,7 +1033,7 @@ QCString KNConfig::PostNewsTechnical::findComposerCharset(QCString cs)
if (s.isEmpty())
s = "us-ascii";
- findComposerCSCache.insert(cs, new QCString(s));
+ findComposerCSCache.insert(cs, new TQCString(s));
return s;
}
@@ -1100,7 +1100,7 @@ KNConfig::Cleanup::Cleanup( bool global ) :
// default values for new accounts / groups
d_oExpire( true ), r_emoveUnavailable( true ), p_reserveThr( true ),
e_xpireInterval( 5 ), r_eadMaxAge( 10 ), u_nreadMaxAge( 15 ),
- mGlobal(global), mDefault(!global), mLastExpDate( QDate::currentDate() )
+ mGlobal(global), mDefault(!global), mLastExpDate( TQDate::currentDate() )
{
if (mGlobal) {
KConfig *conf = knGlobals.config();
@@ -1174,7 +1174,7 @@ bool KNConfig::Cleanup::expireToday()
if (!d_oExpire)
return false;
- QDate today = QDate::currentDate();
+ TQDate today = TQDate::currentDate();
if (mLastExpDate == today)
return false;
@@ -1184,7 +1184,7 @@ bool KNConfig::Cleanup::expireToday()
void KNConfig::Cleanup::setLastExpireDate()
{
- mLastExpDate = QDateTime::currentDateTime();
+ mLastExpDate = TQDateTime::currentDateTime();
}
@@ -1193,7 +1193,7 @@ bool KNConfig::Cleanup::compactToday()
if (!d_oCompact)
return false;
- QDate today = QDate::currentDate();
+ TQDate today = TQDate::currentDate();
if (mLastCompDate == today)
return false;
@@ -1203,7 +1203,7 @@ bool KNConfig::Cleanup::compactToday()
void KNConfig::Cleanup::setLastCompactDate()
{
- mLastCompDate = QDateTime::currentDateTime();
+ mLastCompDate = TQDateTime::currentDateTime();
}