diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
commit | 9a3f0aacd44fb866833ebcb852df3cd31475cb33 (patch) | |
tree | 9f699684624f4e78e13e7dd2393a103cc6fa8274 /kioslave/man/kio_man.cpp | |
parent | 341ad02235b9c85cd31782225181ed475b74eaa3 (diff) | |
download | tdebase-9a3f0aacd44fb866833ebcb852df3cd31475cb33.tar.gz tdebase-9a3f0aacd44fb866833ebcb852df3cd31475cb33.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/man/kio_man.cpp')
-rw-r--r-- | kioslave/man/kio_man.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/kioslave/man/kio_man.cpp b/kioslave/man/kio_man.cpp index 20c0d45b8..7cec22c27 100644 --- a/kioslave/man/kio_man.cpp +++ b/kioslave/man/kio_man.cpp @@ -60,17 +60,17 @@ void stripExtension( TQString *name ) { int pos = name->length(); - if ( name->tqfind(".gz", -3) != -1 ) + if ( name->find(".gz", -3) != -1 ) pos -= 3; - else if ( name->tqfind(".z", -2, false) != -1 ) + else if ( name->find(".z", -2, false) != -1 ) pos -= 2; - else if ( name->tqfind(".bz2", -4) != -1 ) + else if ( name->find(".bz2", -4) != -1 ) pos -= 4; - else if ( name->tqfind(".bz", -3) != -1 ) + else if ( name->find(".bz", -3) != -1 ) pos -= 3; if ( pos > 0 ) - pos = name->tqfindRev('.', pos-1); + pos = name->findRev('.', pos-1); if ( pos > 0 ) name->truncate( pos ); @@ -98,7 +98,7 @@ bool parseUrl(const TQString& _url, TQString &title, TQString §ion) title = url; - int pos = url.tqfind('('); + int pos = url.find('('); if (pos < 0) return true; @@ -144,7 +144,7 @@ void MANProtocol::parseWhatIs( TQMap<TQString, TQString> &i, TQTextStream &t, co { TQString names = l.left(pos); TQString descr = l.mid(pos + re.matchedLength()); - while ((pos = names.tqfind(",")) != -1) + while ((pos = names.find(",")) != -1) { i[names.left(pos++)] = descr; while (names[pos] == ' ') @@ -172,9 +172,9 @@ TQMap<TQString, TQString> MANProtocol::buildIndexMap(const TQString §ion) TQStringList man_dirs = manDirectories(); // Supplementary places for whatis databases man_dirs += m_mandbpath; - if (man_dirs.tqfind("/var/cache/man")==man_dirs.end()) + if (man_dirs.find("/var/cache/man")==man_dirs.end()) man_dirs << "/var/cache/man"; - if (man_dirs.tqfind("/var/catman")==man_dirs.end()) + if (man_dirs.find("/var/catman")==man_dirs.end()) man_dirs << "/var/catman"; TQStringList names; @@ -238,14 +238,14 @@ TQStringList MANProtocol::manDirectories() && S_ISDIR( sbuf.st_mode ) ) { const TQString p = TQDir(dir).canonicalPath(); - if (!man_dirs.tqcontains(p)) man_dirs += p; + if (!man_dirs.contains(p)) man_dirs += p; } } } // Untranslated pages in "<mandir>" const TQString p = TQDir(*it_dir).canonicalPath(); - if (!man_dirs.tqcontains(p)) man_dirs += p; + if (!man_dirs.contains(p)) man_dirs += p; } return man_dirs; } @@ -331,7 +331,7 @@ TQStringList MANProtocol::findPages(const TQString &_section, if (sect.lower()==it_real) it_real = sect; // Only add sect if not already contained, avoid duplicates - if (!sect_list.tqcontains(sect) && _section.isEmpty()) { + if (!sect_list.contains(sect) && _section.isEmpty()) { kdDebug() << "another section " << sect << endl; sect_list += sect; } @@ -425,11 +425,11 @@ static TQString text2html(const TQString& txt) { TQString reply = txt; - reply = reply.tqreplace('&', "&"); - reply = reply.tqreplace('<', "<"); - reply = reply.tqreplace('>', ">"); - reply = reply.tqreplace('"', "&dquot;"); - reply = reply.tqreplace('\'', """); + reply = reply.replace('&', "&"); + reply = reply.replace('<', "<"); + reply = reply.replace('>', ">"); + reply = reply.replace('"', "&dquot;"); + reply = reply.replace('\'', """); return reply; } @@ -534,7 +534,7 @@ char *MANProtocol::readManPage(const char *_filename) * If the path name constains the string sman, assume that it's SGML and * convert it to roff format (used on Solaris). */ //TQString file_mimetype = KMimeType::findByPath(TQString(filename), 0, false)->name(); - if (filename.tqcontains("sman", false)) //file_mimetype == "text/html" || ) + if (filename.contains("sman", false)) //file_mimetype == "text/html" || ) { myStdStream =TQString::null; KProcess proc; @@ -560,14 +560,14 @@ char *MANProtocol::readManPage(const char *_filename) kdDebug(7107) << "relative " << filename << endl; filename = TQDir::cleanDirPath(lastdir + "/" + filename).utf8(); if (!KStandardDirs::exists(filename)) { // exists perhaps with suffix - lastdir = filename.left(filename.tqfindRev('/')); + lastdir = filename.left(filename.findRev('/')); TQDir mandir(lastdir); - mandir.setNameFilter(filename.mid(filename.tqfindRev('/') + 1) + ".*"); + mandir.setNameFilter(filename.mid(filename.findRev('/') + 1) + ".*"); filename = lastdir + "/" + TQFile::encodeName(mandir.entryList().first()); } kdDebug(7107) << "resolved to " << filename << endl; } - lastdir = filename.left(filename.tqfindRev('/')); + lastdir = filename.left(filename.findRev('/')); myStdStream = TQString::null; KProcess proc; @@ -883,7 +883,7 @@ void MANProtocol::constructPath(TQStringList& constr_path, TQStringList constr_c } } /* sections are not used - else if ( section_regex.tqfind(line, 0) == 0 ) + else if ( section_regex.find(line, 0) == 0 ) { if ( !conf_section.isEmpty() ) conf_section += ':'; @@ -920,7 +920,7 @@ void MANProtocol::constructPath(TQStringList& constr_path, TQStringList constr_c int i = 0; while (manpaths[i]) { - if ( constr_path.tqfindIndex( TQString( manpaths[i] ) ) == -1 ) + if ( constr_path.findIndex( TQString( manpaths[i] ) ) == -1 ) constr_path += TQString( manpaths[i] ); i++; } @@ -944,35 +944,35 @@ void MANProtocol::constructPath(TQStringList& constr_path, TQStringList constr_c if ( !mandir.isEmpty() ) { // a path mapping exists - if ( constr_path.tqfindIndex( mandir ) == -1 ) + if ( constr_path.findIndex( mandir ) == -1 ) constr_path += mandir; } else { // no manpath mapping, use "<path>/man" and "<path>/../man" mandir = dir + TQString( "/man" ); - if ( constr_path.tqfindIndex( mandir ) == -1 ) + if ( constr_path.findIndex( mandir ) == -1 ) constr_path += mandir; - int pos = dir.tqfindRev( '/' ); + int pos = dir.findRev( '/' ); if ( pos > 0 ) { mandir = dir.left( pos ) + TQString("/man"); - if ( constr_path.tqfindIndex( mandir ) == -1 ) + if ( constr_path.findIndex( mandir ) == -1 ) constr_path += mandir; } } TQString catmandir = mandb_map[ mandir ]; if ( !mandir.isEmpty() ) { - if ( constr_catmanpath.tqfindIndex( catmandir ) == -1 ) + if ( constr_catmanpath.findIndex( catmandir ) == -1 ) constr_catmanpath += catmandir; } else { // What is the default mapping? catmandir = mandir; - catmandir.tqreplace("/usr/share/","/var/cache/"); - if ( constr_catmanpath.tqfindIndex( catmandir ) == -1 ) + catmandir.replace("/usr/share/","/var/cache/"); + if ( constr_catmanpath.findIndex( catmandir ) == -1 ) constr_catmanpath += catmandir; } } @@ -1001,7 +1001,7 @@ void MANProtocol::checkManPaths() if ( manpath_env.isEmpty() || manpath_env[0] == ':' || manpath_env[manpath_env.length()-1] == ':' - || manpath_env.tqcontains( "::" ) ) + || manpath_env.contains( "::" ) ) { construct_path = true; // need to read config file } @@ -1041,7 +1041,7 @@ void MANProtocol::checkManPaths() if ( !dir.isEmpty() ) { // Add dir to the man path if it exists - if ( m_manpath.tqfindIndex( dir ) == -1 ) { + if ( m_manpath.findIndex( dir ) == -1 ) { if ( ::stat( TQFile::encodeName( dir ), &sbuf ) == 0 && S_ISDIR( sbuf.st_mode ) ) { @@ -1060,7 +1060,7 @@ void MANProtocol::checkManPaths() dir = (*it2); if ( !dir.isEmpty() ) { - if ( m_manpath.tqfindIndex( dir ) == -1 ) { + if ( m_manpath.findIndex( dir ) == -1 ) { if ( ::stat( TQFile::encodeName( dir ), &sbuf ) == 0 && S_ISDIR( sbuf.st_mode ) ) { @@ -1080,7 +1080,7 @@ void MANProtocol::checkManPaths() { "1", "2", "3", "4", "5", "6", "7", "8", "9", "n", 0L }; for ( int i = 0; default_sect[i] != 0L; i++ ) - if ( m_mansect.tqfindIndex( TQString( default_sect[i] ) ) == -1 ) + if ( m_mansect.findIndex( TQString( default_sect[i] ) ) == -1 ) m_mansect += TQString( default_sect[i] ); */ @@ -1239,7 +1239,7 @@ void MANProtocol::showIndex(const TQString& section) stripExtension( &fileName ); - pos = fileName.tqfindRev('/'); + pos = fileName.findRev('/'); if (pos > 0) fileName = fileName.mid(pos+1); @@ -1253,7 +1253,7 @@ void MANProtocol::showIndex(const TQString& section) { os << "<tr><td><a href=\"man:" << it.data() << "\">\n" << it.key() << "</a></td><td> </td><td> " - << (indexmap.tqcontains(it.key()) ? indexmap[it.key()] : "" ) + << (indexmap.contains(it.key()) ? indexmap[it.key()] : "" ) << "</td></tr>" << endl; } @@ -1415,7 +1415,7 @@ void MANProtocol::showIndex(const TQString& section) ((char *)manindex->manpage_begin)[manindex->manpage_len] = '\0'; os << manindex->manpage_begin << "</a></td><td> </td><td> " - << (indexmap.tqcontains(manindex->manpage_begin) ? indexmap[manindex->manpage_begin] : "" ) + << (indexmap.contains(manindex->manpage_begin) ? indexmap[manindex->manpage_begin] : "" ) << "</td></tr>" << endl; last_index = manindex; } @@ -1457,7 +1457,7 @@ void MANProtocol::showIndex(const TQString& section) manindex->manpage_begin[manindex->manpage_len] = '\0'; os << manindex->manpage_begin << "</a></td><td> </td><td> " - << (indexmap.tqcontains(manindex->manpage_begin) ? indexmap[manindex->manpage_begin] : "" ) + << (indexmap.contains(manindex->manpage_begin) ? indexmap[manindex->manpage_begin] : "" ) << "</td></tr>" << endl; last_index = manindex; } |