summaryrefslogtreecommitdiffstats
path: root/kdecore/kconfigbase.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
commit560378aaca1784ba19806a0414a32b20c744de39 (patch)
treece0dfd7c3febf2a1adc7603d1019a8be2083c415 /kdecore/kconfigbase.cpp
parentd4d5af1cdbd3cc65d095e0afc5b1f4260091cf5d (diff)
downloadtdelibs-560378aaca1784ba19806a0414a32b20c744de39.tar.gz
tdelibs-560378aaca1784ba19806a0414a32b20c744de39.zip
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/kconfigbase.cpp')
-rw-r--r--kdecore/kconfigbase.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/kdecore/kconfigbase.cpp b/kdecore/kconfigbase.cpp
index 1cbe1f3ab..0acd20041 100644
--- a/kdecore/kconfigbase.cpp
+++ b/kdecore/kconfigbase.cpp
@@ -272,7 +272,7 @@ TQString KConfigBase::readEntry( const char *pKey,
if( expand || bExpand )
{
// check for environment variables and make necessary translations
- int nDollarPos = aValue.find( '$' );
+ int nDollarPos = aValue.tqfind( '$' );
while( nDollarPos != -1 && nDollarPos+1 < static_cast<int>(aValue.length())) {
// there is at least one $
@@ -294,7 +294,7 @@ TQString KConfigBase::readEntry( const char *pKey,
}
pclose(fs);
}
- aValue.replace( nDollarPos, nEndPos-nDollarPos, result );
+ aValue.tqreplace( nDollarPos, nEndPos-nDollarPos, result );
} else if( (aValue)[nDollarPos+1] != '$' ) {
uint nEndPos = nDollarPos+1;
// the next character is no $
@@ -320,7 +320,7 @@ TQString KConfigBase::readEntry( const char *pKey,
// !!! Sergey A. Sukiyazov <corwin@micom.don.ru> !!!
// A environment variables may contain values in 8bit
// locale cpecified encoding or in UTF8 encoding.
- aValue.replace( nDollarPos, nEndPos-nDollarPos, KStringHandler::from8Bit( pEnv ) );
+ aValue.tqreplace( nDollarPos, nEndPos-nDollarPos, KStringHandler::from8Bit( pEnv ) );
} else
aValue.remove( nDollarPos, nEndPos-nDollarPos );
} else {
@@ -328,7 +328,7 @@ TQString KConfigBase::readEntry( const char *pKey,
aValue.remove( nDollarPos, 1 );
nDollarPos++;
}
- nDollarPos = aValue.find( '$', nDollarPos );
+ nDollarPos = aValue.tqfind( '$', nDollarPos );
}
}
@@ -697,12 +697,12 @@ unsigned long KConfigBase::readUnsignedLongNumEntry( const char *pKey, unsigned
}
}
-Q_INT64 KConfigBase::readNum64Entry( const TQString& pKey, Q_INT64 nDefault) const
+TQ_INT64 KConfigBase::readNum64Entry( const TQString& pKey, TQ_INT64 nDefault) const
{
return readNum64Entry(pKey.utf8().data(), nDefault);
}
-Q_INT64 KConfigBase::readNum64Entry( const char *pKey, Q_INT64 nDefault) const
+TQ_INT64 KConfigBase::readNum64Entry( const char *pKey, TQ_INT64 nDefault) const
{
// Note that TQCString::toLongLong() is missing, we muse use a TQString instead.
TQString aValue = readEntry( pKey );
@@ -711,18 +711,18 @@ Q_INT64 KConfigBase::readNum64Entry( const char *pKey, Q_INT64 nDefault) const
else
{
bool ok;
- Q_INT64 rc = aValue.toLongLong( &ok );
+ TQ_INT64 rc = aValue.toLongLong( &ok );
return( ok ? rc : nDefault );
}
}
-Q_UINT64 KConfigBase::readUnsignedNum64Entry( const TQString& pKey, Q_UINT64 nDefault) const
+TQ_UINT64 KConfigBase::readUnsignedNum64Entry( const TQString& pKey, TQ_UINT64 nDefault) const
{
return readUnsignedNum64Entry(pKey.utf8().data(), nDefault);
}
-Q_UINT64 KConfigBase::readUnsignedNum64Entry( const char *pKey, Q_UINT64 nDefault) const
+TQ_UINT64 KConfigBase::readUnsignedNum64Entry( const char *pKey, TQ_UINT64 nDefault) const
{
// Note that TQCString::toULongLong() is missing, we muse use a TQString instead.
TQString aValue = readEntry( pKey );
@@ -731,7 +731,7 @@ Q_UINT64 KConfigBase::readUnsignedNum64Entry( const char *pKey, Q_UINT64 nDefaul
else
{
bool ok;
- Q_UINT64 rc = aValue.toULongLong( &ok );
+ TQ_UINT64 rc = aValue.toULongLong( &ok );
return( ok ? rc : nDefault );
}
}
@@ -793,7 +793,7 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
TQString aValue = readEntry( pKey );
if( !aValue.isNull() ) {
- if ( aValue.contains( ',' ) > 5 ) {
+ if ( aValue.tqcontains( ',' ) > 5 ) {
// KDE3 and upwards entry
if ( !aRetFont.fromString( aValue ) && pDefault )
aRetFont = *pDefault;
@@ -801,8 +801,8 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
else {
// backward compatibility with older font formats
// ### remove KDE 3.1 ?
- // find first part (font family)
- int nIndex = aValue.find( ',' );
+ // tqfind first part (font family)
+ int nIndex = aValue.tqfind( ',' );
if( nIndex == -1 ){
if( pDefault )
aRetFont = *pDefault;
@@ -810,9 +810,9 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
}
aRetFont.setFamily( aValue.left( nIndex ) );
- // find second part (point size)
+ // tqfind second part (point size)
int nOldIndex = nIndex;
- nIndex = aValue.find( ',', nOldIndex+1 );
+ nIndex = aValue.tqfind( ',', nOldIndex+1 );
if( nIndex == -1 ){
if( pDefault )
aRetFont = *pDefault;
@@ -822,9 +822,9 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
aRetFont.setPointSize( aValue.mid( nOldIndex+1,
nIndex-nOldIndex-1 ).toInt() );
- // find third part (style hint)
+ // tqfind third part (style hint)
nOldIndex = nIndex;
- nIndex = aValue.find( ',', nOldIndex+1 );
+ nIndex = aValue.tqfind( ',', nOldIndex+1 );
if( nIndex == -1 ){
if( pDefault )
@@ -834,9 +834,9 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
aRetFont.setStyleHint( (TQFont::StyleHint)aValue.mid( nOldIndex+1, nIndex-nOldIndex-1 ).toUInt() );
- // find fourth part (char set)
+ // tqfind fourth part (char set)
nOldIndex = nIndex;
- nIndex = aValue.find( ',', nOldIndex+1 );
+ nIndex = aValue.tqfind( ',', nOldIndex+1 );
if( nIndex == -1 ){
if( pDefault )
@@ -846,9 +846,9 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
TQString chStr=aValue.mid( nOldIndex+1,
nIndex-nOldIndex-1 );
- // find fifth part (weight)
+ // tqfind fifth part (weight)
nOldIndex = nIndex;
- nIndex = aValue.find( ',', nOldIndex+1 );
+ nIndex = aValue.tqfind( ',', nOldIndex+1 );
if( nIndex == -1 ){
if( pDefault )
@@ -859,7 +859,7 @@ TQFont KConfigBase::readFontEntry( const char *pKey, const TQFont* pDefault ) co
aRetFont.setWeight( aValue.mid( nOldIndex+1,
nIndex-nOldIndex-1 ).toUInt() );
- // find sixth part (font bits)
+ // tqfind sixth part (font bits)
uint nFontBits = aValue.right( aValue.length()-nIndex-1 ).toUInt();
aRetFont.setItalic( nFontBits & 0x01 );
@@ -978,8 +978,8 @@ TQColor KConfigBase::readColorEntry( const char *pKey,
bool bOK;
- // find first part (red)
- int nIndex = aValue.find( ',' );
+ // tqfind first part (red)
+ int nIndex = aValue.tqfind( ',' );
if( nIndex == -1 ){
// return a sensible default -- Bernd
@@ -990,9 +990,9 @@ TQColor KConfigBase::readColorEntry( const char *pKey,
nRed = aValue.left( nIndex ).toInt( &bOK );
- // find second part (green)
+ // tqfind second part (green)
int nOldIndex = nIndex;
- nIndex = aValue.find( ',', nOldIndex+1 );
+ nIndex = aValue.tqfind( ',', nOldIndex+1 );
if( nIndex == -1 ){
// return a sensible default -- Bernd
@@ -1003,7 +1003,7 @@ TQColor KConfigBase::readColorEntry( const char *pKey,
nGreen = aValue.mid( nOldIndex+1,
nIndex-nOldIndex-1 ).toInt( &bOK );
- // find third part (blue)
+ // tqfind third part (blue)
nBlue = aValue.right( aValue.length()-nIndex-1 ).toInt( &bOK );
aRetColor.setRgb( nRed, nGreen, nBlue );
@@ -1025,7 +1025,7 @@ TQDateTime KConfigBase::readDateTimeEntry( const TQString& pKey,
return readDateTimeEntry(pKey.utf8().data(), pDefault);
}
-// ### currentDateTime() as fallback ? (Harri)
+// ### tqcurrentDateTime() as fallback ? (Harri)
TQDateTime KConfigBase::readDateTimeEntry( const char *pKey,
const TQDateTime* pDefault ) const
{
@@ -1034,7 +1034,7 @@ TQDateTime KConfigBase::readDateTimeEntry( const char *pKey,
if( pDefault )
return *pDefault;
else
- return TQDateTime::currentDateTime();
+ return TQDateTime::tqcurrentDateTime();
}
TQStrList list;
@@ -1048,7 +1048,7 @@ TQDateTime KConfigBase::readDateTimeEntry( const char *pKey,
return TQDateTime( date, time );
}
- return TQDateTime::currentDateTime();
+ return TQDateTime::tqcurrentDateTime();
}
void KConfigBase::writeEntry( const TQString& pKey, const TQString& value,
@@ -1119,9 +1119,9 @@ static bool cleanHomeDirPath( TQString &path, const TQString &homeDir )
#endif
unsigned int len = homeDir.length();
- // replace by "$HOME" if possible
+ // tqreplace by "$HOME" if possible
if (len && (path.length() == len || path[len] == '/')) {
- path.replace(0, len, TQString::fromLatin1("$HOME"));
+ path.tqreplace(0, len, TQString::tqfromLatin1("$HOME"));
return true;
} else
return false;
@@ -1133,7 +1133,7 @@ static TQString translatePath( TQString path )
return path;
// only "our" $HOME should be interpreted
- path.replace('$', "$$");
+ path.tqreplace('$', "$$");
bool startsWithFile = path.startsWith("file:", false);
@@ -1160,7 +1160,7 @@ static TQString translatePath( TQString path )
if (cleanHomeDirPath(path, homeDir0) ||
cleanHomeDirPath(path, homeDir1) ||
cleanHomeDirPath(path, homeDir2) ) {
- // kdDebug() << "Path was replaced\n";
+ // kdDebug() << "Path was tqreplaced\n";
}
if (startsWithFile)
@@ -1189,7 +1189,7 @@ void KConfigBase::writePathEntry ( const char *pKey, const TQStringList &list,
{
if( list.isEmpty() )
{
- writeEntry( pKey, TQString::fromLatin1(""), bPersistent );
+ writeEntry( pKey, TQString::tqfromLatin1(""), bPersistent );
return;
}
TQStringList new_list;
@@ -1402,7 +1402,7 @@ void KConfigBase::writeEntry ( const char *pKey, const TQStrList &list,
{
if( list.isEmpty() )
{
- writeEntry( pKey, TQString::fromLatin1(""), bPersistent );
+ writeEntry( pKey, TQString::tqfromLatin1(""), bPersistent );
return;
}
TQString str_list;
@@ -1449,7 +1449,7 @@ void KConfigBase::writeEntry ( const char *pKey, const TQStringList &list,
{
if( list.isEmpty() )
{
- writeEntry( pKey, TQString::fromLatin1(""), bPersistent );
+ writeEntry( pKey, TQString::tqfromLatin1(""), bPersistent );
return;
}
TQString str_list;
@@ -1548,14 +1548,14 @@ void KConfigBase::writeEntry( const char *pKey, unsigned long nValue,
writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
}
-void KConfigBase::writeEntry( const TQString& pKey, Q_INT64 nValue,
+void KConfigBase::writeEntry( const TQString& pKey, TQ_INT64 nValue,
bool bPersistent, bool bGlobal,
bool bNLS )
{
writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
}
-void KConfigBase::writeEntry( const char *pKey, Q_INT64 nValue,
+void KConfigBase::writeEntry( const char *pKey, TQ_INT64 nValue,
bool bPersistent, bool bGlobal,
bool bNLS )
{
@@ -1563,14 +1563,14 @@ void KConfigBase::writeEntry( const char *pKey, Q_INT64 nValue,
}
-void KConfigBase::writeEntry( const TQString& pKey, Q_UINT64 nValue,
+void KConfigBase::writeEntry( const TQString& pKey, TQ_UINT64 nValue,
bool bPersistent, bool bGlobal,
bool bNLS )
{
writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
}
-void KConfigBase::writeEntry( const char *pKey, Q_UINT64 nValue,
+void KConfigBase::writeEntry( const char *pKey, TQ_UINT64 nValue,
bool bPersistent, bool bGlobal,
bool bNLS )
{