diff options
Diffstat (limited to 'kdecore/kstandarddirs.cpp')
-rw-r--r-- | kdecore/kstandarddirs.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/kdecore/kstandarddirs.cpp b/kdecore/kstandarddirs.cpp index 54dab242a..f8b7bd307 100644 --- a/kdecore/kstandarddirs.cpp +++ b/kdecore/kstandarddirs.cpp @@ -144,7 +144,7 @@ bool KStandardDirs::isRestrictedResource(const char *type, const TQString& relPa void KStandardDirs::applyDataRestrictions(const TQString &relPath) const { TQString key; - int i = relPath.tqfind(QChar('/')); + int i = relPath.find(QChar('/')); if (i != -1) key = "data_"+relPath.left(i); else @@ -159,7 +159,7 @@ TQStringList KStandardDirs::allTypes() const { TQStringList list; for (int i = 0; types[i] != 0; ++i) - list.append(TQString::tqfromLatin1(types[i])); + list.append(TQString::fromLatin1(types[i])); return list; } @@ -192,7 +192,7 @@ void KStandardDirs::addPrefix( const TQString& _dir, bool priority ) if (dir.at(dir.length() - 1) != QChar('/')) dir += QChar('/'); - if (!prefixes.tqcontains(dir)) { + if (!prefixes.contains(dir)) { priorityAdd(prefixes, dir, priority); dircache.clear(); } @@ -212,7 +212,7 @@ void KStandardDirs::addXdgConfigPrefix( const TQString& _dir, bool priority ) if (dir.at(dir.length() - 1) != QChar('/')) dir += QChar('/'); - if (!d->xdgconf_prefixes.tqcontains(dir)) { + if (!d->xdgconf_prefixes.contains(dir)) { priorityAdd(d->xdgconf_prefixes, dir, priority); dircache.clear(); } @@ -232,7 +232,7 @@ void KStandardDirs::addXdgDataPrefix( const TQString& _dir, bool priority ) if (dir.at(dir.length() - 1) != QChar('/')) dir += QChar('/'); - if (!d->xdgdata_prefixes.tqcontains(dir)) { + if (!d->xdgdata_prefixes.contains(dir)) { priorityAdd(d->xdgdata_prefixes, dir, priority); dircache.clear(); } @@ -265,7 +265,7 @@ bool KStandardDirs::addResourceType( const char *type, if (relativename.isEmpty()) return false; - TQStringList *rels = relatives.tqfind(type); + TQStringList *rels = relatives.find(type); if (!rels) { rels = new TQStringList(); relatives.insert(type, rels); @@ -273,7 +273,7 @@ bool KStandardDirs::addResourceType( const char *type, TQString copy = relativename; if (copy.at(copy.length() - 1) != QChar('/')) copy += QChar('/'); - if (!rels->tqcontains(copy)) { + if (!rels->contains(copy)) { if (priority) rels->prepend(copy); else @@ -295,7 +295,7 @@ bool KStandardDirs::addResourceDir( const char *type, const TQString& absdir, bool priority) { - TQStringList *paths = absolutes.tqfind(type); + TQStringList *paths = absolutes.find(type); if (!paths) { paths = new TQStringList(); absolutes.insert(type, paths); @@ -304,7 +304,7 @@ bool KStandardDirs::addResourceDir( const char *type, if (copy.at(copy.length() - 1) != QChar('/')) copy += QChar('/'); - if (!paths->tqcontains(copy)) { + if (!paths->contains(copy)) { if (priority) paths->prepend(copy); else @@ -337,7 +337,7 @@ for (TQStringList::ConstIterator pit = prefixes.begin(); else return dir + filename; } -static TQ_UINT32 updateHash(const TQString &file, TQ_UINT32 hash) +static Q_UINT32 updateHash(const TQString &file, Q_UINT32 hash) { TQCString cFile = TQFile::encodeName(file); KDE_struct_stat buff; @@ -345,15 +345,15 @@ static TQ_UINT32 updateHash(const TQString &file, TQ_UINT32 hash) (KDE_stat( cFile, &buff ) == 0) && (S_ISREG( buff.st_mode ))) { - hash = hash + (TQ_UINT32) buff.st_ctime; + hash = hash + (Q_UINT32) buff.st_ctime; } return hash; } -TQ_UINT32 KStandardDirs::calcResourceHash( const char *type, +Q_UINT32 KStandardDirs::calcResourceHash( const char *type, const TQString& filename, bool deep) const { - TQ_UINT32 hash = 0; + Q_UINT32 hash = 0; if (!TQDir::isRelativePath(filename)) { @@ -442,7 +442,7 @@ TQString KStandardDirs::findResourceDir( const char *type, #ifndef NDEBUG if(false && strcmp(type, "locale")) - kdDebug() << "KStdDirs::tqfindResDir(): can't tqfind \"" << filename << "\" in type \"" << type << "\"." << endl; + kdDebug() << "KStdDirs::findResDir(): can't find \"" << filename << "\" in type \"" << type << "\"." << endl; #endif return TQString::null; @@ -468,7 +468,7 @@ static void lookupDirectory(const TQString& path, const TQString &relPart, bool recursive, bool unique) { TQString pattern = regexp.pattern(); - if (recursive || pattern.tqcontains('?') || pattern.tqcontains('*')) + if (recursive || pattern.contains('?') || pattern.contains('*')) { if (path.isEmpty()) //for sanity return; @@ -512,7 +512,7 @@ static void lookupDirectory(const TQString& path, const TQString &relPart, } if ( S_ISREG( buff.st_mode)) { - if (!unique || !relList.tqcontains(relPart + fn)) + if (!unique || !relList.contains(relPart + fn)) { list.append( pathfn ); relList.append( relPart + fn ); @@ -531,7 +531,7 @@ static void lookupDirectory(const TQString& path, const TQString &relPart, return; // File not found if ( S_ISREG( buff.st_mode)) { - if (!unique || !relList.tqcontains(relPart + fn)) + if (!unique || !relList.contains(relPart + fn)) { list.append( pathfn ); relList.append( relPart + fn ); @@ -557,7 +557,7 @@ static void lookupPrefix(const TQString& prefix, const TQString& relpath, if (relpath.length()) { - int slash = relpath.tqfind(QChar('/')); + int slash = relpath.find(QChar('/')); if (slash < 0) rest = relpath.left(relpath.length() - 1); else { @@ -575,7 +575,7 @@ static void lookupPrefix(const TQString& prefix, const TQString& relpath, #endif KDE_struct_stat buff; - if (path.tqcontains('*') || path.tqcontains('?')) { + if (path.contains('*') || path.contains('?')) { TQRegExp pathExp(path, true, true); DIR *dp = opendir( TQFile::encodeName(prefix) ); @@ -608,7 +608,7 @@ static void lookupPrefix(const TQString& prefix, const TQString& relpath, closedir( dp ); } else { - // Don't stat, if the dir doesn't exist we will tqfind out + // Don't stat, if the dir doesn't exist we will find out // when we try to open it. lookupPrefix(prefix + path + QChar('/'), rest, relPart + path + QChar('/'), regexp, list, @@ -629,7 +629,7 @@ KStandardDirs::findAllResources( const char *type, if (filter.length()) { - int slash = filter.tqfindRev('/'); + int slash = filter.findRev('/'); if (slash < 0) filterFile = filter; else { @@ -688,7 +688,7 @@ KStandardDirs::realPath(const TQString &dirname) char realpath_buffer[MAXPATHLEN + 1]; memset(realpath_buffer, 0, MAXPATHLEN + 1); - /* If the path tqcontains symlinks, get the real name */ + /* If the path contains symlinks, get the real name */ if (realpath( TQFile::encodeName(dirname).data(), realpath_buffer) != 0) { // success, use result from realpath int len = strlen(realpath_buffer); @@ -706,7 +706,7 @@ KStandardDirs::realFilePath(const TQString &filename) char realpath_buffer[MAXPATHLEN + 1]; memset(realpath_buffer, 0, MAXPATHLEN + 1); - /* If the path tqcontains symlinks, get the real name */ + /* If the path contains symlinks, get the real name */ if (realpath( TQFile::encodeName(filename).data(), realpath_buffer) != 0) { // success, use result from realpath return TQFile::decodeName(realpath_buffer); @@ -762,9 +762,9 @@ void KStandardDirs::createSpecialResource(const char *type) #else //UNIX if (relink) { - TQString srv = findExe(TQString::tqfromLatin1("lnusertemp"), kfsstnd_defaultbindir()); + TQString srv = findExe(TQString::fromLatin1("lnusertemp"), kfsstnd_defaultbindir()); if (srv.isEmpty()) - srv = findExe(TQString::tqfromLatin1("lnusertemp")); + srv = findExe(TQString::fromLatin1("lnusertemp")); if (!srv.isEmpty()) { system(TQFile::encodeName(srv)+" "+type); @@ -785,7 +785,7 @@ void KStandardDirs::createSpecialResource(const char *type) TQStringList KStandardDirs::resourceDirs(const char *type) const { - TQStringList *candidates = dircache.tqfind(type); + TQStringList *candidates = dircache.find(type); if (!candidates) { // filling cache if (strcmp(type, "socket") == 0) @@ -812,7 +812,7 @@ TQStringList KStandardDirs::resourceDirs(const char *type) const d->dataRestrictionActive = false; // Reset } - dirs = relatives.tqfind(type); + dirs = relatives.find(type); if (dirs) { bool local = true; @@ -834,7 +834,7 @@ TQStringList KStandardDirs::resourceDirs(const char *type) const testdir.setPath(path); if (local && restrictionActive) continue; - if ((local || testdir.exists()) && !candidates->tqcontains(path)) + if ((local || testdir.exists()) && !candidates->contains(path)) candidates->append(path); } // UGLY HACK - Chris CHeney @@ -844,7 +844,7 @@ TQStringList KStandardDirs::resourceDirs(const char *type) const local = false; } } - dirs = absolutes.tqfind(type); + dirs = absolutes.find(type); if (dirs) for (TQStringList::ConstIterator it = dirs->begin(); it != dirs->end(); ++it) @@ -853,7 +853,7 @@ TQStringList KStandardDirs::resourceDirs(const char *type) const if (testdir.exists()) { TQString filename = realPath(*it); - if (!candidates->tqcontains(filename)) + if (!candidates->contains(filename)) candidates->append(filename); } } @@ -897,19 +897,19 @@ TQStringList KStandardDirs::systemPaths( const TQString& pstr ) if ( p[ 0 ] == QChar('~') ) { - int len = p.tqfind( QChar('/') ); + int len = p.find( QChar('/') ); if ( len == -1 ) len = p.length(); if ( len == 1 ) { - p.tqreplace( 0, 1, TQDir::homeDirPath() ); + p.replace( 0, 1, TQDir::homeDirPath() ); } else { TQString user = p.mid( 1, len - 1 ); struct passwd *dir = getpwnam( user.local8Bit().data() ); if ( dir && strlen( dir->pw_dir ) ) - p.tqreplace( 0, len, TQString::fromLocal8Bit( dir->pw_dir ) ); + p.replace( 0, len, TQString::fromLocal8Bit( dir->pw_dir ) ); } } @@ -931,7 +931,7 @@ TQString KStandardDirs::findExe( const TQString& appname, TQFileInfo info; // absolute or relative path given - if (real_appname.tqfind(TQDir::separator()) >= 0) + if (real_appname.find(TQDir::separator()) >= 0) { info.setFile( real_appname ); if( info.exists() && ( ignore || info.isExecutable() ) @@ -969,7 +969,7 @@ TQString KStandardDirs::findExe( const TQString& appname, return TQString::null; } -int KStandardDirs::tqfindAllExe( TQStringList& list, const TQString& appname, +int KStandardDirs::findAllExe( TQStringList& list, const TQString& appname, const TQString& pstr, bool ignore ) { #ifdef Q_WS_WIN @@ -1006,7 +1006,7 @@ static int tokenize( TQStringList& tokens, const TQString& str, for( int index = 0; index < len; index++) { - if ( delim.tqfind( str[ index ] ) >= 0 ) + if ( delim.find( str[ index ] ) >= 0 ) { tokens.append( token ); token = ""; @@ -1093,17 +1093,17 @@ TQString KStandardDirs::saveLocation(const char *type, { checkConfig(); - TQString *pPath = savelocations.tqfind(type); + TQString *pPath = savelocations.find(type); if (!pPath) { - TQStringList *dirs = relatives.tqfind(type); + TQStringList *dirs = relatives.find(type); if (!dirs && ( (strcmp(type, "socket") == 0) || (strcmp(type, "tmp") == 0) || (strcmp(type, "cache") == 0) )) { (void) resourceDirs(type); // Generate socket|tmp|cache resource. - dirs = relatives.tqfind(type); // Search again. + dirs = relatives.find(type); // Search again. } if (dirs) { @@ -1116,7 +1116,7 @@ TQString KStandardDirs::saveLocation(const char *type, pPath = new TQString(realPath(localkdedir() + dirs->last())); } else { - dirs = absolutes.tqfind(type); + dirs = absolutes.find(type); if (!dirs) qFatal("KStandardDirs: The resource type %s is not registered", type); pPath = new TQString(realPath(dirs->last())); @@ -1147,7 +1147,7 @@ TQString KStandardDirs::saveLocation(const char *type, TQString KStandardDirs::relativeLocation(const char *type, const TQString &absPath) { TQString fullPath = absPath; - int i = absPath.tqfindRev('/'); + int i = absPath.findRev('/'); if (i != -1) { fullPath = realPath(absPath.left(i+1))+absPath.mid(i+1); // Normalize @@ -1185,7 +1185,7 @@ bool KStandardDirs::makeDir(const TQString& dir, int mode) while( i < len ) { KDE_struct_stat st; - int pos = target.tqfind(QChar('/'), i); + int pos = target.find(QChar('/'), i); base += target.mid(i - 1, pos - i + 1); TQCString baseEncoded = TQFile::encodeName(base); // bail out if we encountered a problem @@ -1236,10 +1236,10 @@ static TQString executablePrefix() if(path.isEmpty()) return TQString::null; - int pos = path.tqfindRev('/'); // Skip filename + int pos = path.findRev('/'); // Skip filename if(pos <= 0) return TQString::null; - pos = path.tqfindRev(QChar('/'), pos - 1); // Skip last directory + pos = path.findRev(QChar('/'), pos - 1); // Skip last directory if(pos <= 0) return TQString::null; @@ -1256,7 +1256,7 @@ TQString KStandardDirs::kfsstnd_defaultprefix() s->defaultprefix = readEnvPath("KDEDIR"); if (s->defaultprefix.isEmpty()) { s->defaultprefix = TQFile::decodeName("c:\\kde"); - //TODO: tqfind other location (the Registry?) + //TODO: find other location (the Registry?) } #else //UNIX s->defaultprefix = KDEDIR; @@ -1272,11 +1272,11 @@ TQString KStandardDirs::kfsstnd_defaultbindir() if (!s->defaultbindir.isEmpty()) return s->defaultbindir; #ifdef Q_WS_WIN - s->defaultbindir = kfsstnd_defaultprefix() + TQString::tqfromLatin1("/bin"); + s->defaultbindir = kfsstnd_defaultprefix() + TQString::fromLatin1("/bin"); #else //UNIX s->defaultbindir = __KDE_BINDIR; if (s->defaultbindir.isEmpty()) - s->defaultbindir = kfsstnd_defaultprefix() + TQString::tqfromLatin1("/bin"); + s->defaultbindir = kfsstnd_defaultprefix() + TQString::fromLatin1("/bin"); #endif if (s->defaultbindir.isEmpty()) kdWarning() << "KStandardDirs::kfsstnd_defaultbindir(): default binary KDE dir not found!" << endl; @@ -1543,13 +1543,13 @@ bool KStandardDirs::addCustomized(KConfig *config) addedCustoms = true; // reading the prefixes in - TQString group = TQString::tqfromLatin1("Directories"); + TQString group = TQString::fromLatin1("Directories"); config->setGroup(group); TQString kioskAdmin = config->readEntry("kioskAdmin"); if (!kioskAdmin.isEmpty() && !kde_kiosk_admin) { - int i = kioskAdmin.tqfind(':'); + int i = kioskAdmin.find(':'); TQString user = kioskAdmin.left(i); TQString host = kioskAdmin.mid(i+1); @@ -1603,7 +1603,7 @@ bool KStandardDirs::addCustomized(KConfig *config) } // iterating over all entries in the group Directories - // to tqfind entries that start with dir_$type + // to find entries that start with dir_$type TQMap<TQString, TQString> entries = config->entryMap(group); for (TQMap<TQString, TQString>::ConstIterator it2 = entries.begin(); it2 != entries.end(); it2++) @@ -1623,7 +1623,7 @@ bool KStandardDirs::addCustomized(KConfig *config) if (profiles.isEmpty()) break; profile = profiles.back(); - group = TQString::tqfromLatin1("Directories-%1").arg(profile); + group = TQString::fromLatin1("Directories-%1").arg(profile); profiles.pop_back(); priority = true; } @@ -1692,9 +1692,9 @@ TQString locateLocal( const char *type, TQString locateLocal( const char *type, const TQString& filename, bool createDir, const KInstance* inst ) { - // try to tqfind slashes. If there are some, we have to + // try to find slashes. If there are some, we have to // create the subdir first - int slash = filename.tqfindRev('/')+1; + int slash = filename.findRev('/')+1; if (!slash) // only one filename return inst->dirs()->saveLocation(type, TQString::null, createDir) + filename; |