28 #include <tqtextstream.h>
30 #include <tdeapplication.h>
31 #include <tdeglobalsettings.h>
32 #include <tdeglobal.h>
34 #include <kcharsets.h>
36 #include "tdeconfigbase.h"
37 #include "tdeconfigbackend.h"
39 #include "kstandarddirs.h"
40 #include "kstringhandler.h"
42 class TDEConfigBase::TDEConfigBasePrivate
52 : backEnd(0L), bDirty(false), bLocaleInitialized(false),
53 bReadOnly(false), bExpand(false), d(0)
65 bLocaleInitialized =
true;
82 if ( group.isEmpty() )
95 if ( group.isEmpty() )
102 return TQString::fromUtf8(
mGroup);
112 return hasKey(key.utf8().data());
118 aEntryKey.c_key = pKey;
123 aEntryKey.bLocal =
true;
125 if (!entry.mValue.isNull())
127 aEntryKey.bLocal =
false;
132 return !entry.mValue.isNull();
135 bool TDEConfigBase::hasTranslatedKey(
const char* pKey)
const
138 aEntryKey.c_key = pKey;
143 aEntryKey.bLocal =
true;
145 if (!entry.mValue.isNull())
147 aEntryKey.bLocal =
false;
155 return internalHasGroup( group.utf8());
160 return internalHasGroup( TQCString(_pGroup));
165 return internalHasGroup( _pGroup);
180 return entry.bImmutable;
193 TQCString utf8_key = key.utf8();
194 entryKey.c_key = utf8_key.data();
206 const TQString& aDefault )
const
213 const TQString& aDefault )
const
215 TQCString result = readEntryUtf8(pKey);
218 return TQString::fromUtf8(result);
223 const TQString& aDefault )
const
229 const TQString& aDefault )
const
235 if (!bLocaleInitialized && TDEGlobal::_locale) {
248 entryKey.c_key = pKey;
252 if (!aEntryData.mValue.isNull()) {
259 if (!aEntryData.mValue.isNull()) {
260 aValue = TQString::fromUtf8(aEntryData.mValue.data());
264 aValue = emptyString;
273 if( expand || bExpand )
276 int nDollarPos = aValue.find(
'$' );
278 while( nDollarPos != -1 && (nDollarPos + 1) < static_cast<int>(aValue.length())) {
280 if( aValue[nDollarPos+1] !=
'$' ) {
281 uint nEndPos = nDollarPos+1;
284 if (aValue[nEndPos]==
'{')
286 while ( (nEndPos <= aValue.length()) && (aValue[nEndPos]!=
'}') )
289 aVarName = aValue.mid( nDollarPos+2, nEndPos-nDollarPos-3 );
293 while ( nEndPos <= aValue.length() && (aValue[nEndPos].isNumber()
294 || aValue[nEndPos].isLetter() || aValue[nEndPos]==
'_' ) )
296 aVarName = aValue.mid( nDollarPos+1, nEndPos-nDollarPos-1 );
298 const char *pEnv = 0;
299 if (!aVarName.isEmpty())
300 pEnv = getenv( aVarName.ascii() );
307 else if (aVarName.length() > 8 && aVarName.startsWith(
"XDG_") && aVarName.endsWith(
"_DIR")) {
309 if (aVarName ==
"XDG_DESKTOP_DIR") {
312 else if (aVarName ==
"XDG_DOCUMENTS_DIR") {
315 else if (aVarName ==
"XDG_DOWNLOAD_DIR") {
318 else if (aVarName ==
"XDG_MUSIC_DIR") {
321 else if (aVarName ==
"XDG_PICTURES_DIR") {
324 else if (aVarName ==
"XDG_PUBLICSHARE_DIR") {
327 else if (aVarName ==
"XDG_TEMPLATES_DIR") {
330 else if (aVarName ==
"XDG_VIDEOS_DIR") {
333 aValue.replace( nDollarPos, nEndPos-nDollarPos, result );
336 aValue.remove( nDollarPos, nEndPos-nDollarPos );
341 aValue.remove( nDollarPos, 1 );
344 nDollarPos = aValue.find(
'$', nDollarPos );
351 TQCString TDEConfigBase::readEntryUtf8(
const char *pKey)
const
356 entryKey.c_key = pKey;
361 return readEntry(pKey, TQString::null).utf8();
363 return aEntryData.mValue;
367 TQVariant::Type type )
const
373 TQVariant::Type type )
const
376 if ( !
hasKey( pKey ) )
return va;
382 const TQVariant &aDefault )
const
388 const TQVariant &aDefault )
const
390 if ( !
hasKey( pKey ) )
return aDefault;
392 TQVariant tmp = aDefault;
394 switch( aDefault.type() )
396 case TQVariant::Invalid:
398 case TQVariant::String:
399 return TQVariant(
readEntry( pKey, aDefault.toString() ) );
400 case TQVariant::StringList:
402 case TQVariant::List: {
404 TQStringList::ConstIterator it = strList.begin();
405 TQStringList::ConstIterator end = strList.end();
406 TQValueList<TQVariant> list;
408 for (; it != end; ++it ) {
412 return TQVariant( list );
414 case TQVariant::Font:
416 case TQVariant::Point:
418 case TQVariant::Rect:
420 case TQVariant::Size:
422 case TQVariant::Color:
425 return TQVariant(
readNumEntry( pKey, aDefault.toInt() ) );
426 case TQVariant::UInt:
428 case TQVariant::LongLong:
429 return TQVariant(
readNum64Entry( pKey, aDefault.toLongLong() ) );
430 case TQVariant::ULongLong:
432 case TQVariant::Bool:
433 return TQVariant(
readBoolEntry( pKey, aDefault.toBool() ) );
434 case TQVariant::Double:
436 case TQVariant::DateTime:
438 case TQVariant::Date:
439 return TQVariant(TQT_TQDATE_OBJECT(
readDateTimeEntry( pKey, &tmp.asDateTime() ).date()));
441 case TQVariant::Pixmap:
442 case TQVariant::Image:
443 case TQVariant::Brush:
444 case TQVariant::Palette:
445 case TQVariant::ColorGroup:
447 case TQVariant::IconSet:
448 case TQVariant::CString:
449 case TQVariant::PointArray:
450 case TQVariant::Region:
451 case TQVariant::Bitmap:
452 case TQVariant::Cursor:
453 case TQVariant::SizePolicy:
454 case TQVariant::Time:
456 case TQVariant::ByteArray:
458 case TQVariant::BitArray:
459 case TQVariant::KeySequence:
462 case TQVariant::Char:
464 case TQVariant::Locale:
465 case TQVariant::RectF:
466 case TQVariant::SizeF:
467 case TQVariant::Line:
468 case TQVariant::LineF:
469 case TQVariant::PointF:
470 case TQVariant::RegExp:
471 case TQVariant::Hash:
472 case TQVariant::TextLength:
473 case QVariant::TextFormat:
474 case TQVariant::Matrix:
475 case TQVariant::Transform:
476 case TQVariant::Matrix4x4:
477 case TQVariant::Vector2D:
478 case TQVariant::Vector3D:
479 case TQVariant::Vector4D:
480 case TQVariant::Quaternion:
481 case TQVariant::UserType:
491 TQStrList &list,
char sep )
const
497 TQStrList &list,
char sep )
const
502 TQCString str_list = readEntryUtf8( pKey );
503 if (str_list.isEmpty())
507 TQCString value =
"";
508 int len = str_list.length();
510 for (
int i = 0; i < len; i++) {
511 if (str_list[i] != sep && str_list[i] !=
'\\') {
512 value += str_list[i];
515 if (str_list[i] ==
'\\') {
518 value += str_list[i];
526 list.append( value );
530 if ( str_list[len-1] != sep || ( len > 1 && str_list[len-2] ==
'\\' ) )
531 list.append( value );
548 if( str_list.isEmpty() )
550 TQString value(emptyString);
551 int len = str_list.length();
553 value.reserve( len );
554 for(
int i = 0; i < len; i++ )
556 if( str_list[i] != sep && str_list[i] !=
'\\' )
558 value += str_list[i];
561 if( str_list[i] ==
'\\' )
565 value += str_list[i];
568 TQString finalvalue( value );
569 finalvalue.squeeze();
570 list.append( finalvalue );
573 if ( str_list[len-1] != sep || ( len > 1 && str_list[len-2] ==
'\\' ) )
576 list.append( value );
598 TQValueList<int> list;
599 TQStringList::ConstIterator end(strlist.end());
600 for (TQStringList::ConstIterator it = strlist.begin(); it != end; ++it)
603 list << (*it).toInt();
615 const bool bExpandSave = bExpand;
617 TQString aValue =
readEntry( pKey, pDefault );
618 bExpand = bExpandSave;
629 const bool bExpandSave = bExpand;
632 bExpand = bExpandSave;
643 TQCString aValue = readEntryUtf8( pKey );
644 if( aValue.isNull() )
646 else if( aValue ==
"true" || aValue ==
"on" || aValue ==
"yes" )
651 int rc = aValue.toInt( &ok );
652 return( ok ? rc : nDefault );
664 TQCString aValue = readEntryUtf8( pKey );
665 if( aValue.isNull() )
670 unsigned int rc = aValue.toUInt( &ok );
671 return( ok ? rc : nDefault );
683 TQCString aValue = readEntryUtf8( pKey );
684 if( aValue.isNull() )
689 long rc = aValue.toLong( &ok );
690 return( ok ? rc : nDefault );
702 TQCString aValue = readEntryUtf8( pKey );
703 if( aValue.isNull() )
708 unsigned long rc = aValue.toULong( &ok );
709 return( ok ? rc : nDefault );
722 if( aValue.isNull() )
727 TQ_INT64 rc = aValue.toLongLong( &ok );
728 return( ok ? rc : nDefault );
742 if( aValue.isNull() )
747 TQ_UINT64 rc = aValue.toULongLong( &ok );
748 return( ok ? rc : nDefault );
759 TQCString aValue = readEntryUtf8( pKey );
760 if( aValue.isNull() )
765 double rc = aValue.toDouble( &ok );
766 return( ok ? rc : nDefault );
778 TQCString aValue = readEntryUtf8( pKey );
780 if( aValue.isNull() )
784 if( aValue ==
"true" || aValue ==
"on" || aValue ==
"yes" || aValue ==
"1" )
789 int val = aValue.toInt( &bOK );
790 if( bOK && val != 0 )
808 if( !aValue.isNull() ) {
809 if ( aValue.contains(
',' ) > 5 ) {
811 if ( !aRetFont.fromString( aValue ) && pDefault )
812 aRetFont = *pDefault;
818 int nIndex = aValue.find(
',' );
821 aRetFont = *pDefault;
824 aRetFont.setFamily( aValue.left( nIndex ) );
827 int nOldIndex = nIndex;
828 nIndex = aValue.find(
',', nOldIndex+1 );
831 aRetFont = *pDefault;
835 aRetFont.setPointSize( aValue.mid( nOldIndex+1,
836 nIndex-nOldIndex-1 ).toInt() );
840 nIndex = aValue.find(
',', nOldIndex+1 );
844 aRetFont = *pDefault;
848 aRetFont.setStyleHint( (TQFont::StyleHint)aValue.mid( nOldIndex+1, nIndex-nOldIndex-1 ).toUInt() );
852 nIndex = aValue.find(
',', nOldIndex+1 );
856 aRetFont = *pDefault;
860 TQString chStr=aValue.mid( nOldIndex+1,
861 nIndex-nOldIndex-1 );
864 nIndex = aValue.find(
',', nOldIndex+1 );
868 aRetFont = *pDefault;
872 aRetFont.setWeight( aValue.mid( nOldIndex+1,
873 nIndex-nOldIndex-1 ).toUInt() );
876 uint nFontBits = aValue.right( aValue.length()-nIndex-1 ).toUInt();
878 aRetFont.setItalic( nFontBits & 0x01 );
879 aRetFont.setUnderline( nFontBits & 0x02 );
880 aRetFont.setStrikeOut( nFontBits & 0x04 );
881 aRetFont.setFixedPitch( nFontBits & 0x08 );
882 aRetFont.setRawMode( nFontBits & 0x20 );
888 aRetFont = *pDefault;
902 TQCString aValue = readEntryUtf8(pKey);
904 if (!aValue.isEmpty())
906 int left, top, width, height;
908 if (sscanf(aValue.data(),
"%d,%d,%d,%d", &left, &top, &width, &height) == 4)
910 return TQRect(left, top, width, height);
920 const TQPoint* pDefault )
const
926 const TQPoint* pDefault )
const
928 TQCString aValue = readEntryUtf8(pKey);
930 if (!aValue.isEmpty())
934 if (sscanf(aValue.data(),
"%d,%d", &x, &y) == 2)
945 const TQSize* pDefault )
const
951 const TQSize* pDefault )
const
953 TQCString aValue = readEntryUtf8(pKey);
955 if (!aValue.isEmpty())
959 if (sscanf(aValue.data(),
"%d,%d", &width, &height) == 2)
961 return TQSize(width, height);
971 const TQColor* pDefault )
const
977 const TQColor* pDefault )
const
980 int nRed = 0, nGreen = 0, nBlue = 0;
983 if( !aValue.isEmpty() )
985 if ( aValue.at(0) == (QChar)
'#' )
987 aRetColor.setNamedColor(aValue);
995 int nIndex = aValue.find(
',' );
1000 aRetColor = *pDefault;
1004 nRed = aValue.left( nIndex ).toInt( &bOK );
1007 int nOldIndex = nIndex;
1008 nIndex = aValue.find(
',', nOldIndex+1 );
1013 aRetColor = *pDefault;
1016 nGreen = aValue.mid( nOldIndex+1,
1017 nIndex-nOldIndex-1 ).toInt( &bOK );
1020 nBlue = aValue.right( aValue.length()-nIndex-1 ).toInt( &bOK );
1022 aRetColor.setRgb( nRed, nGreen, nBlue );
1028 aRetColor = *pDefault;
1036 const TQDateTime* pDefault )
const
1043 const TQDateTime* pDefault )
const
1050 return TQDateTime::currentDateTime();
1056 TQDate date( atoi( list.at( 0 ) ), atoi( list.at( 1 ) ),
1057 atoi( list.at( 2 ) ) );
1058 TQTime time( atoi( list.at( 3 ) ), atoi( list.at( 4 ) ),
1059 atoi( list.at( 5 ) ) );
1061 return TQDateTime( date, time );
1064 return TQDateTime::currentDateTime();
1072 writeEntry(pKey.utf8().data(), value, bPersistent, bGlobal, bNLS);
1080 writeEntry(pKey, value, bPersistent, bGlobal, bNLS,
false);
1101 entryKey.bLocal = bNLS;
1104 aEntryData.mValue = value.utf8();
1106 aEntryData.
bNLS = bNLS;
1110 aEntryData.
bDirty =
true;
1113 putData(entryKey, aEntryData,
true);
1117 bool bPersistent,
bool bGlobal,
1120 writePathEntry(pKey.utf8().data(), path, bPersistent, bGlobal, bNLS);
1124 static bool cleanHomeDirPath( TQString &path,
const TQString &homeDir )
1126 #ifdef Q_WS_WIN //safer
1127 if (!TQDir::convertSeparators(path).startsWith(TQDir::convertSeparators(homeDir)))
1130 if (!path.startsWith(homeDir))
1134 unsigned int len = homeDir.length();
1136 if (len && (path.length() == len || path[len] ==
'/')) {
1137 path.replace(0, len, TQString::fromLatin1(
"$HOME"));
1143 static TQString translatePath( TQString path )
1149 path.replace(
'$',
"$$");
1151 bool startsWithFile = path.startsWith(
"file:",
false);
1155 if (((!startsWithFile) && (path[0] !=
'/')) || (startsWithFile && (path[5] !=
'/'))) {
1159 if (startsWithFile) {
1164 while (path[0] ==
'/' && path[1] ==
'/') {
1172 TQString homeDir0 = TQFile::decodeName(getenv(
"HOME"));
1173 TQString homeDir1 = TQDir::homeDirPath();
1174 TQString homeDir2 = TQDir(homeDir1).canonicalPath();
1175 if (cleanHomeDirPath(path, homeDir0) ||
1176 cleanHomeDirPath(path, homeDir1) ||
1177 cleanHomeDirPath(path, homeDir2) ) {
1182 path.prepend(
"file://" );
1188 bool bPersistent,
bool bGlobal,
1191 writeEntry(pKey, translatePath(path), bPersistent, bGlobal, bNLS,
true);
1195 bool bPersistent,
bool bGlobal,
1196 bool bNLS,
bool expand)
1198 writeEntry(pKey, translatePath(path), bPersistent, bGlobal, bNLS, expand);
1202 char sep ,
bool bPersistent,
1203 bool bGlobal,
bool bNLS )
1205 writePathEntry(pKey.utf8().data(), list, sep, bPersistent, bGlobal, bNLS);
1209 char sep ,
bool bPersistent,
1210 bool bGlobal,
bool bNLS )
1212 if( list.isEmpty() )
1214 writeEntry( pKey, TQString::fromLatin1(
""), bPersistent );
1217 TQStringList new_list;
1218 TQStringList::ConstIterator it = list.begin();
1219 for( ; it != list.end(); ++it )
1221 TQString value = *it;
1222 new_list.append( translatePath(value) );
1224 writeEntry( pKey, new_list, sep, bPersistent, bGlobal, bNLS,
true );
1252 aEntryData.
bNLS = bNLS;
1253 aEntryData.
bDirty =
true;
1257 putData(entryKey, aEntryData,
true);
1266 return aEntryMap.isEmpty();
1270 bool checkGroup =
true;
1272 KEntryMapIterator aIt;
1273 for (aIt = aEntryMap.begin(); aIt != aEntryMap.end(); ++aIt)
1275 if (!aIt.key().mKey.isEmpty() && !aIt.key().bDefault && !(*aIt).bDeleted)
1277 (*aIt).bDeleted =
true;
1278 (*aIt).bDirty =
true;
1279 (*aIt).bGlobal = bGlobal;
1281 putData(aIt.key(), *aIt, checkGroup);
1293 bool bGlobal,
bool bNLS )
1295 writeEntry(pKey.utf8().data(), prop, bPersistent, bGlobal, bNLS);
1300 bool bGlobal,
bool bNLS )
1302 switch( prop.type() )
1304 case TQVariant::Invalid:
1305 writeEntry( pKey,
"", bPersistent, bGlobal, bNLS );
1307 case TQVariant::String:
1308 writeEntry( pKey, prop.toString(), bPersistent, bGlobal, bNLS );
1310 case TQVariant::StringList:
1311 writeEntry( pKey, prop.toStringList(),
',', bPersistent, bGlobal, bNLS );
1313 case TQVariant::List: {
1314 TQValueList<TQVariant> list = prop.toList();
1315 TQValueList<TQVariant>::ConstIterator it = list.begin();
1316 TQValueList<TQVariant>::ConstIterator end = list.end();
1317 TQStringList strList;
1319 for (; it != end; ++it )
1320 strList.
append( (*it).toString() );
1322 writeEntry( pKey, strList,
',', bPersistent, bGlobal, bNLS );
1326 case TQVariant::Font:
1327 writeEntry( pKey, prop.toFont(), bPersistent, bGlobal, bNLS );
1329 case TQVariant::Point:
1330 writeEntry( pKey, prop.toPoint(), bPersistent, bGlobal, bNLS );
1332 case TQVariant::Rect:
1333 writeEntry( pKey, prop.toRect(), bPersistent, bGlobal, bNLS );
1335 case TQVariant::Size:
1336 writeEntry( pKey, prop.toSize(), bPersistent, bGlobal, bNLS );
1338 case TQVariant::Color:
1339 writeEntry( pKey, prop.toColor(), bPersistent, bGlobal, bNLS );
1341 case TQVariant::Int:
1342 writeEntry( pKey, prop.toInt(), bPersistent, bGlobal, bNLS );
1344 case TQVariant::UInt:
1345 writeEntry( pKey, prop.toUInt(), bPersistent, bGlobal, bNLS );
1347 case TQVariant::LongLong:
1348 writeEntry( pKey, prop.toLongLong(), bPersistent, bGlobal, bNLS );
1350 case TQVariant::ULongLong:
1351 writeEntry( pKey, prop.toULongLong(), bPersistent, bGlobal, bNLS );
1353 case TQVariant::Bool:
1354 writeEntry( pKey, prop.toBool(), bPersistent, bGlobal, bNLS );
1356 case TQVariant::Double:
1357 writeEntry( pKey, prop.toDouble(), bPersistent, bGlobal,
'g', 6, bNLS );
1359 case TQVariant::DateTime:
1360 writeEntry( pKey, prop.toDateTime(), bPersistent, bGlobal, bNLS);
1362 case TQVariant::Date:
1363 writeEntry( pKey, TQDateTime(prop.toDate()), bPersistent, bGlobal, bNLS);
1366 case TQVariant::Pixmap:
1367 case TQVariant::Image:
1368 case TQVariant::Brush:
1369 case TQVariant::Palette:
1370 case TQVariant::ColorGroup:
1371 case TQVariant::Map:
1372 case TQVariant::IconSet:
1373 case TQVariant::CString:
1374 case TQVariant::PointArray:
1375 case TQVariant::Region:
1376 case TQVariant::Bitmap:
1377 case TQVariant::Cursor:
1378 case TQVariant::SizePolicy:
1379 case TQVariant::Time:
1381 case TQVariant::ByteArray:
1383 case TQVariant::BitArray:
1384 case TQVariant::KeySequence:
1385 case TQVariant::Pen:
1387 case TQVariant::Char:
1388 case TQVariant::Url:
1389 case TQVariant::Locale:
1390 case TQVariant::RectF:
1391 case TQVariant::SizeF:
1392 case TQVariant::Line:
1393 case TQVariant::LineF:
1394 case TQVariant::PointF:
1395 case TQVariant::RegExp:
1396 case TQVariant::Hash:
1397 case TQVariant::TextLength:
1398 case QVariant::TextFormat:
1399 case TQVariant::Matrix:
1400 case TQVariant::Transform:
1401 case TQVariant::Matrix4x4:
1402 case TQVariant::Vector2D:
1403 case TQVariant::Vector3D:
1404 case TQVariant::Vector4D:
1405 case TQVariant::Quaternion:
1406 case TQVariant::UserType:
1415 char sep ,
bool bPersistent,
1416 bool bGlobal,
bool bNLS )
1418 writeEntry(pKey.utf8().data(), list, sep, bPersistent, bGlobal, bNLS);
1422 char sep ,
bool bPersistent,
1423 bool bGlobal,
bool bNLS )
1425 if( list.isEmpty() )
1427 writeEntry( pKey, TQString::fromLatin1(
""), bPersistent );
1431 TQStrListIterator it( list );
1432 for( ; it.current(); ++it )
1440 uint strLengh(value.length());
1441 for( i = 0; i < strLengh; i++ )
1443 if( value[i] == sep || value[i] ==
'\\' )
1445 str_list += value[i];
1449 if( str_list.at(str_list.length() - 1) == (QChar)sep )
1450 str_list.truncate( str_list.length() -1 );
1451 writeEntry( pKey, str_list, bPersistent, bGlobal, bNLS );
1455 char sep ,
bool bPersistent,
1456 bool bGlobal,
bool bNLS )
1458 writeEntry(pKey.utf8().data(), list, sep, bPersistent, bGlobal, bNLS);
1462 char sep ,
bool bPersistent,
1463 bool bGlobal,
bool bNLS )
1465 writeEntry(pKey, list, sep, bPersistent, bGlobal, bNLS,
false);
1469 char sep,
bool bPersistent,
1470 bool bGlobal,
bool bNLS,
bool bExpand )
1472 if( list.isEmpty() )
1474 writeEntry( pKey, TQString::fromLatin1(
""), bPersistent );
1478 str_list.reserve( 4096 );
1479 TQStringList::ConstIterator it = list.begin();
1480 for( ; it != list.end(); ++it )
1482 TQString value = *it;
1484 uint strLength(value.length());
1485 for( i = 0; i < strLength; i++ )
1487 if( value[i] == sep || value[i] ==
'\\' )
1489 str_list += value[i];
1493 if( str_list.at(str_list.length() - 1) == (QChar)sep )
1494 str_list.truncate( str_list.length() -1 );
1495 writeEntry( pKey, str_list, bPersistent, bGlobal, bNLS, bExpand );
1499 bool bPersistent,
bool bGlobal,
bool bNLS )
1501 writeEntry(pKey.utf8().data(), list, bPersistent, bGlobal, bNLS);
1505 bool bPersistent,
bool bGlobal,
bool bNLS )
1507 TQStringList strlist;
1508 TQValueList<int>::ConstIterator end = list.end();
1509 for (TQValueList<int>::ConstIterator it = list.begin(); it != end; it++)
1510 strlist << TQString::number(*it);
1511 writeEntry(pKey, strlist,
',', bPersistent, bGlobal, bNLS );
1515 bool bPersistent,
bool bGlobal,
1518 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1522 bool bPersistent,
bool bGlobal,
1525 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1530 bool bPersistent,
bool bGlobal,
1533 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1537 bool bPersistent,
bool bGlobal,
1540 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1545 bool bPersistent,
bool bGlobal,
1548 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1552 bool bPersistent,
bool bGlobal,
1555 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1560 bool bPersistent,
bool bGlobal,
1563 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1567 bool bPersistent,
bool bGlobal,
1570 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1574 bool bPersistent,
bool bGlobal,
1577 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1581 bool bPersistent,
bool bGlobal,
1584 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1589 bool bPersistent,
bool bGlobal,
1592 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1596 bool bPersistent,
bool bGlobal,
1599 writeEntry( pKey, TQString::number(nValue), bPersistent, bGlobal, bNLS );
1603 bool bPersistent,
bool bGlobal,
1604 char format,
int precision,
1607 writeEntry( pKey, TQString::number(nValue, format, precision),
1608 bPersistent, bGlobal, bNLS );
1612 bool bPersistent,
bool bGlobal,
1613 char format,
int precision,
1616 writeEntry( pKey, TQString::number(nValue, format, precision),
1617 bPersistent, bGlobal, bNLS );
1626 writeEntry(pKey.utf8().data(), bValue, bPersistent, bGlobal, bNLS);
1641 writeEntry( pKey, aValue, bPersistent, bGlobal, bNLS );
1646 bool bPersistent,
bool bGlobal,
1649 writeEntry(pKey.utf8().data(), rFont, bPersistent, bGlobal, bNLS);
1653 bool bPersistent,
bool bGlobal,
1656 writeEntry( pKey, TQString(rFont.toString()), bPersistent, bGlobal, bNLS );
1661 bool bPersistent,
bool bGlobal,
1664 writeEntry(pKey.utf8().data(), rRect, bPersistent, bGlobal, bNLS);
1668 bool bPersistent,
bool bGlobal,
1673 list.insert( 0, tempstr.setNum( rRect.left() ) );
1674 list.insert( 1, tempstr.setNum( rRect.top() ) );
1675 list.insert( 2, tempstr.setNum( rRect.width() ) );
1676 list.insert( 3, tempstr.setNum( rRect.height() ) );
1678 writeEntry( pKey, list,
',', bPersistent, bGlobal, bNLS );
1683 bool bPersistent,
bool bGlobal,
1686 writeEntry(pKey.utf8().data(), rPoint, bPersistent, bGlobal, bNLS);
1690 bool bPersistent,
bool bGlobal,
1695 list.insert( 0, tempstr.setNum( rPoint.x() ) );
1696 list.insert( 1, tempstr.setNum( rPoint.y() ) );
1698 writeEntry( pKey, list,
',', bPersistent, bGlobal, bNLS );
1703 bool bPersistent,
bool bGlobal,
1706 writeEntry(pKey.utf8().data(), rSize, bPersistent, bGlobal, bNLS);
1710 bool bPersistent,
bool bGlobal,
1715 list.insert( 0, tempstr.setNum( rSize.width() ) );
1716 list.insert( 1, tempstr.setNum( rSize.height() ) );
1718 writeEntry( pKey, list,
',', bPersistent, bGlobal, bNLS );
1726 writeEntry( pKey.utf8().data(), rColor, bPersistent, bGlobal, bNLS);
1735 if (rColor.isValid())
1736 aValue.sprintf(
"%d,%d,%d", rColor.red(), rColor.green(), rColor.blue() );
1740 writeEntry( pKey, aValue, bPersistent, bGlobal, bNLS );
1744 bool bPersistent,
bool bGlobal,
1747 writeEntry(pKey.utf8().data(), rDateTime, bPersistent, bGlobal, bNLS);
1751 bool bPersistent,
bool bGlobal,
1757 TQTime time = TQT_TQTIME_OBJECT(rDateTime.time());
1758 TQDate date = TQT_TQDATE_OBJECT(rDateTime.date());
1760 list.insert( 0, tempstr.setNum( date.year() ) );
1761 list.insert( 1, tempstr.setNum( date.month() ) );
1762 list.insert( 2, tempstr.setNum( date.day() ) );
1764 list.insert( 3, tempstr.setNum( time.hour() ) );
1765 list.insert( 4, tempstr.setNum( time.minute() ) );
1766 list.insert( 5, tempstr.setNum( time.second() ) );
1768 writeEntry( pKey, list,
',', bPersistent, bGlobal, bNLS );
1773 if (!bLocaleInitialized && TDEGlobal::_locale) {
1811 d =
new TDEConfigBasePrivate();
1814 d->readDefaults = b;
1819 return (d && d->readDefaults);
1829 if (!
locale().isNull()) {
1831 aEntryKey.bLocal =
true;
1833 if (entry.mValue.isNull())
1837 putData(aEntryKey, entry,
true);
1838 aEntryKey.bLocal =
false;
1843 if (entry.mValue.isNull())
1846 putData(aEntryKey, entry,
true);
1854 if (!
locale().isNull()) {
1856 aEntryKey.bLocal =
true;
1858 if (!entry.mValue.isNull())
1861 aEntryKey.bLocal =
false;
1866 if (!entry.mValue.isNull())
1878 bLocaleInitialized =
true;
1879 bReadOnly = mMaster->bReadOnly;
1891 bLocaleInitialized =
true;
1892 bReadOnly = mMaster->bReadOnly;
1904 bLocaleInitialized =
true;
1905 bReadOnly = mMaster->bReadOnly;
1930 mMaster->
putData(_key, _data, _checkGroup);
1943 void TDEConfigBase::virtual_hook(
int,
void* )
1946 void TDEConfigGroup::virtual_hook(
int id,
void* data )
1947 { TDEConfigBase::virtual_hook(
id, data ); }
1957 #include "tdeconfigbase.moc"