summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/src/tools/tqsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/src/tools/tqsettings.cpp')
-rw-r--r--tqtinterface/qt4/src/tools/tqsettings.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/tqtinterface/qt4/src/tools/tqsettings.cpp b/tqtinterface/qt4/src/tools/tqsettings.cpp
index 3ef5e5e..d949940 100644
--- a/tqtinterface/qt4/src/tools/tqsettings.cpp
+++ b/tqtinterface/qt4/src/tools/tqsettings.cpp
@@ -150,13 +150,13 @@ static inline int qt_open( const char *pathname, int flags, mode_t mode )
\code
TQStringList keys = settings.entryList( "/MyApplication" );
- // keys tqcontains 'background color' and 'foreground color'.
+ // keys contains 'background color' and 'foreground color'.
TQStringList keys = settings.entryList( "/MyApplication/recent files" );
- // keys tqcontains '1', '2' and '3'.
+ // keys contains '1', '2' and '3'.
TQStringList subkeys = settings.subkeyList( "/MyApplication" );
- // subkeys tqcontains 'tqgeometry' and 'recent files'
+ // subkeys contains 'tqgeometry' and 'recent files'
TQStringList subkeys = settings.subkeyList( "/MyApplication/recent files" );
// subkeys is empty.
@@ -385,9 +385,9 @@ void TQSettingsHeading::parseLine(TQTextStream &stream)
if (gname[(int)gname.length() - 1] == TQChar(']'))
gname = gname.remove(gname.length() - 1, 1);
- git = tqfind(gname);
+ git = find(gname);
if (git == end())
- git = tqreplace(gname, TQSettingsGroup());
+ git = replace(gname, TQSettingsGroup());
} else {
if (git == end()) {
#if defined(TQT_CHECK_STATE)
@@ -396,7 +396,7 @@ void TQSettingsHeading::parseLine(TQTextStream &stream)
return;
}
- int i = line.tqfind('=');
+ int i = line.find('=');
if (i == -1) {
#if defined(TQT_CHECK_STATE)
qWarning("TQSettings: malformed line '%s' in group '%s'",
@@ -529,27 +529,27 @@ TQSettingsGroup TQSettingsPrivate::readGroup()
TQSettingsHeading hd;
TQSettingsGroup grp;
- TQMap<TQString,TQSettingsHeading>::Iterator headingsit = headings.tqfind(heading);
+ TQMap<TQString,TQSettingsHeading>::Iterator headingsit = headings.find(heading);
if (headingsit != headings.end())
hd = *headingsit;
- TQSettingsHeading::Iterator grpit = hd.tqfind(group);
+ TQSettingsHeading::Iterator grpit = hd.find(group);
if (grpit == hd.end()) {
TQStringList::Iterator it = searchPaths.begin();
if ( !globalScope )
++it;
while (it != searchPaths.end()) {
- TQString filebase = heading.lower().tqreplace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
+ TQString filebase = heading.lower().replace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
TQString fn((*it++) + "/" + filebase + "rc");
- if (! hd.tqcontains(fn + "cached")) {
+ if (! hd.contains(fn + "cached")) {
hd.read(fn);
hd.insert(fn + "cached", TQSettingsGroup());
}
}
- headings.tqreplace(heading, hd);
+ headings.replace(heading, hd);
- grpit = hd.tqfind(group);
+ grpit = hd.find(group);
if (grpit != hd.end())
grp = *grpit;
} else if (hd.count() != 0)
@@ -565,27 +565,27 @@ void TQSettingsPrivate::removeGroup(const TQString &key)
TQSettingsGroup grp;
bool found = FALSE;
- TQMap<TQString,TQSettingsHeading>::Iterator headingsit = headings.tqfind(heading);
+ TQMap<TQString,TQSettingsHeading>::Iterator headingsit = headings.find(heading);
if (headingsit != headings.end())
hd = *headingsit;
- TQSettingsHeading::Iterator grpit = hd.tqfind(group);
+ TQSettingsHeading::Iterator grpit = hd.find(group);
if (grpit == hd.end()) {
TQStringList::Iterator it = searchPaths.begin();
if ( !globalScope )
++it;
while (it != searchPaths.end()) {
- TQString filebase = heading.lower().tqreplace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
+ TQString filebase = heading.lower().replace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
TQString fn((*it++) + "/" + filebase + "rc");
- if (! hd.tqcontains(fn + "cached")) {
+ if (! hd.contains(fn + "cached")) {
hd.read(fn);
hd.insert(fn + "cached", TQSettingsGroup());
}
}
- headings.tqreplace(heading, hd);
+ headings.replace(heading, hd);
- grpit = hd.tqfind(group);
+ grpit = hd.find(group);
if (grpit != hd.end()) {
found = TRUE;
grp = *grpit;
@@ -599,12 +599,12 @@ void TQSettingsPrivate::removeGroup(const TQString &key)
grp.remove(key);
if (grp.count() > 0)
- hd.tqreplace(group, grp);
+ hd.replace(group, grp);
else
hd.remove(group);
if (hd.count() > 0)
- headings.tqreplace(heading, hd);
+ headings.replace(heading, hd);
else
headings.remove(heading);
@@ -618,36 +618,36 @@ void TQSettingsPrivate::writeGroup(const TQString &key, const TQString &value)
TQSettingsHeading hd;
TQSettingsGroup grp;
- TQMap<TQString,TQSettingsHeading>::Iterator headingsit = headings.tqfind(heading);
+ TQMap<TQString,TQSettingsHeading>::Iterator headingsit = headings.find(heading);
if (headingsit != headings.end())
hd = *headingsit;
- TQSettingsHeading::Iterator grpit = hd.tqfind(group);
+ TQSettingsHeading::Iterator grpit = hd.find(group);
if (grpit == hd.end()) {
TQStringList::Iterator it = searchPaths.begin();
if ( !globalScope )
++it;
while (it != searchPaths.end()) {
- TQString filebase = heading.lower().tqreplace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
+ TQString filebase = heading.lower().replace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
TQString fn((*it++) + "/" + filebase + "rc");
- if (! hd.tqcontains(fn + "cached")) {
+ if (! hd.contains(fn + "cached")) {
hd.read(fn);
hd.insert(fn + "cached", TQSettingsGroup());
}
}
- headings.tqreplace(heading, hd);
+ headings.replace(heading, hd);
- grpit = hd.tqfind(group);
+ grpit = hd.find(group);
if (grpit != hd.end())
grp = *grpit;
} else if (hd.count() != 0)
grp = *grpit;
grp.modified = TRUE;
- grp.tqreplace(key, value);
- hd.tqreplace(group, grp);
- headings.tqreplace(heading, hd);
+ grp.replace(key, value);
+ hd.replace(group, grp);
+ headings.replace(heading, hd);
modified = TRUE;
}
@@ -674,7 +674,7 @@ TQDateTime TQSettingsPrivate::modificationTime()
bool qt_verify_key( const TQString &key )
{
- if ( key.isEmpty() || key[0] != '/' || key.tqcontains( TQRegExp(TQString::tqfromLatin1("[=\\r\\n]")) ) )
+ if ( key.isEmpty() || key[0] != '/' || key.contains( TQRegExp(TQString::tqfromLatin1("[=\\r\\n]")) ) )
return FALSE;
return TRUE;
}
@@ -683,7 +683,7 @@ static TQString groupKey( const TQString &group, const TQString &key )
{
TQString grp_key;
if ( group.isEmpty() || ( group.length() == 1 && group[0] == '/' ) ) {
- // group is empty, or it tqcontains a single '/', so we just return the key
+ // group is empty, or it contains a single '/', so we just return the key
if ( key.startsWith( "/" ) )
grp_key = key;
else
@@ -775,7 +775,7 @@ static TQString groupKey( const TQString &group, const TQString &key )
Settings under Unix are stored in files whose names are based on the
first subkey of the key (not including the search path). The algorithm
- for creating names is essentially: lowercase the first subkey, tqreplace
+ for creating names is essentially: lowercase the first subkey, replace
spaces with underscores and add 'rc', e.g.
<tt>/MyCompany/MyApplication/background color</tt> will be stored in
<tt>myapplicationrc</tt> (assuming that <tt>/MyCompany</tt> is part of
@@ -826,7 +826,7 @@ void TQSettings::insertSearchPath( System s, const TQString &path)
realPath = defPath + path;
#endif
- TQStringList::Iterator it = d->searchPaths.tqfind(d->searchPaths.last());
+ TQStringList::Iterator it = d->searchPaths.find(d->searchPaths.last());
if (it != d->searchPaths.end()) {
d->searchPaths.insert(it, realPath);
}
@@ -958,7 +958,7 @@ bool TQSettings::sync()
if ( !d->globalScope )
++pit;
while (pit != d->searchPaths.end()) {
- TQString filebase = it.key().lower().tqreplace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
+ TQString filebase = it.key().lower().replace(TQRegExp(TQString::tqfromLatin1("\\s+")), "_");
TQFileInfo di(*pit);
if ( !di.exists() ) {
TQDir dir;
@@ -1024,8 +1024,8 @@ bool TQSettings::sync()
if ( v.isNull() ) {
v = TQString::tqfromLatin1("\\0"); // escape null string
} else {
- v.tqreplace('\\', TQString::tqfromLatin1("\\\\")); // escape backslash
- v.tqreplace('\n', TQString::tqfromLatin1("\\n")); // escape newlines
+ v.replace('\\', TQString::tqfromLatin1("\\\\")); // escape backslash
+ v.replace('\n', TQString::tqfromLatin1("\\n")); // escape newlines
}
stream << grpit.key() << "=" << v << endl;
@@ -1290,7 +1290,7 @@ TQString TQSettings::readEntry(const TQString &key, const TQString &def, bool *o
}
TQSettingsGroup grp = d->readGroup();
- TQSettingsGroup::const_iterator it = grp.tqfind( realkey ), end = grp.end();
+ TQSettingsGroup::const_iterator it = grp.find( realkey ), end = grp.end();
TQString retval = def;
if ( it != end ) {
// found the value we needed
@@ -1401,7 +1401,7 @@ bool TQSettings::writeEntry(const TQString &key, int value)
Writes the entry specified by \a key with the string-literal \a value,
replacing any previous setting. If \a value is zero-length or null, the
- entry is tqreplaced by an empty setting.
+ entry is replaced by an empty setting.
\e NOTE: This function is provided because some compilers use the
writeEntry (const TQString &, bool) overload for this code:
@@ -1564,7 +1564,7 @@ bool TQSettings::removeEntry(const TQString &key)
In the above example, \c keys will contain 'background color' and
'foreground color'. It will not contain 'tqgeometry' because this key
- tqcontains subkeys not entries.
+ contains subkeys not entries.
To access the tqgeometry values, you could either use subkeyList()
to read the keys then read each entry, or simply read each entry
@@ -1633,7 +1633,7 @@ TQStringList TQSettings::entryList(const TQString &key) const
itkey.remove( 0, realkey.length() + 1 );
}
- if ( itkey.tqfind( '/' ) != -1 )
+ if ( itkey.find( '/' ) != -1 )
continue;
ret << itkey;
@@ -1734,7 +1734,7 @@ TQStringList TQSettings::subkeyList(const TQString &key) const
if ( subkeycount == 1 ) {
TQMap<TQString,TQSettingsHeading>::Iterator it = d->headings.begin();
while ( it != d->headings.end() ) {
- if ( it.key() != "General" && ! ret.tqcontains( it.key() ) )
+ if ( it.key() != "General" && ! ret.contains( it.key() ) )
ret << it.key();
++it;
}
@@ -1758,12 +1758,12 @@ TQStringList TQSettings::subkeyList(const TQString &key) const
itkey.remove( 0, realkey.length() + 1 );
}
- int slash = itkey.tqfind( '/' );
+ int slash = itkey.find( '/' );
if ( slash == -1 )
continue;
itkey.truncate( slash );
- if ( ! ret.tqcontains( itkey ) )
+ if ( ! ret.contains( itkey ) )
ret << itkey;
}
@@ -1868,7 +1868,7 @@ bool TQSettings::writeEntry(const TQString &key, const TQStringList &value)
if ( el.isNull() ) {
el = "^0";
} else {
- el.tqreplace("^", "^^");
+ el.replace("^", "^^");
}
s+=el;
s+="^e"; // end of element
@@ -2005,7 +2005,7 @@ void TQSettings::setPath( const TQString &domain, const TQString &product, Scope
// scope.
//
// On MacOS X, if there is no "." in domain, append ".com", then reverse the
-// order of the elements (Mac OS uses "com.apple.tqfinder" as domain+product).
+// order of the elements (Mac OS uses "com.apple.finder" as domain+product).
// The Global scope corresponds to /Library/Preferences/*.plist, while the
// User scope corresponds to ~/Library/Preferences/*.plist.
// Note that on most installations, not all users can write to the System
@@ -2013,7 +2013,7 @@ void TQSettings::setPath( const TQString &domain, const TQString &product, Scope
d->globalScope = scope == Global;
TQString actualSearchPath;
- int lastDot = domain.tqfindRev( '.' );
+ int lastDot = domain.findRev( '.' );
#if defined(TQ_WS_WIN)
actualSearchPath = "/" + domain.mid( 0, lastDot ) + "/" + product;