summaryrefslogtreecommitdiffstats
path: root/kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp')
-rw-r--r--kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp b/kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp
index 9d15802f1..40d97e29d 100644
--- a/kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp
+++ b/kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp
@@ -43,7 +43,7 @@
#define IPv6_PATTERN "^\\[.*\\]"
#define ENV_VAR_PATTERN "\\$[a-zA-Z_][a-zA-Z0-9_]*"
-#define QFL1(x) TQString::fromLatin1(x)
+#define QFL1(x) TQString::tqfromLatin1(x)
/**
* IMPORTANT:
@@ -66,7 +66,7 @@ static bool isValidShortURL( const TQString& cmd, bool verbose = false )
// Match FQDN_PATTERN
exp.setPattern( QFL1(FQDN_PATTERN) );
- if ( cmd.contains( exp ) )
+ if ( cmd.tqcontains( exp ) )
{
if (verbose)
kdDebug() << "KShortURIFilter::isValidShortURL: " << cmd
@@ -85,7 +85,7 @@ static bool isValidShortURL( const TQString& cmd, bool verbose = false )
// Match IPv4 addresses
exp.setPattern( QFL1(IPv4_PATTERN) );
- if ( cmd.contains( exp ) )
+ if ( cmd.tqcontains( exp ) )
{
if (verbose)
kdDebug() << "KShortURIFilter::isValidShortURL: " << cmd
@@ -95,7 +95,7 @@ static bool isValidShortURL( const TQString& cmd, bool verbose = false )
// Match IPv6 addresses
exp.setPattern( QFL1(IPv6_PATTERN) );
- if ( cmd.contains( exp ) )
+ if ( cmd.tqcontains( exp ) )
{
if (verbose)
kdDebug() << "KShortURIFilter::isValidShortURL: " << cmd
@@ -121,7 +121,7 @@ static TQString removeArgs( const TQString& _cmd )
do
{
- spacePos = cmd.find( ' ', spacePos+1 );
+ spacePos = cmd.tqfind( ' ', spacePos+1 );
} while ( spacePos > 1 && cmd[spacePos - 1] == '\\' );
if( spacePos > 0 )
@@ -164,13 +164,13 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
if (!isMalformed &&
(url.protocol().length() == 4) &&
- (url.protocol() != TQString::fromLatin1("http")) &&
+ (url.protocol() != TQString::tqfromLatin1("http")) &&
(url.protocol()[0]=='h') &&
(url.protocol()[1]==url.protocol()[2]) &&
(url.protocol()[3]=='p'))
{
// Handle "encrypted" URLs like: h++p://www.kde.org
- url.setProtocol( TQString::fromLatin1("http"));
+ url.setProtocol( TQString::tqfromLatin1("http"));
setFilteredURI( data, url);
setURIType( data, KURIFilterData::NET_PROTOCOL );
return true;
@@ -182,7 +182,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
// You mean caching the last filtering, to try and reuse it, to save stat()s? (David)
const TQString starthere_proto = QFL1("start-here:");
- if (cmd.find(starthere_proto, 0, true) == 0 )
+ if (cmd.tqfind(starthere_proto, 0, true) == 0 )
{
setFilteredURI( data, KURL("system:/") );
setURIType( data, KURIFilterData::LOCAL_DIR );
@@ -193,8 +193,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
const TQString man_proto = QFL1("man:");
const TQString info_proto = QFL1("info:");
if( cmd[0] == '#' ||
- cmd.find( man_proto, 0, true ) == 0 ||
- cmd.find( info_proto, 0, true ) == 0 )
+ cmd.tqfind( man_proto, 0, true ) == 0 ||
+ cmd.tqfind( info_proto, 0, true ) == 0 )
{
if( cmd.left(2) == QFL1("##") )
cmd = QFL1("info:/") + cmd.mid(2);
@@ -210,11 +210,11 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
}
// Detect UNC style (aka windows SMB) URLs
- if ( cmd.startsWith( TQString::fromLatin1( "\\\\") ) )
+ if ( cmd.startsWith( TQString::tqfromLatin1( "\\\\") ) )
{
// make sure path is unix style
- cmd.replace('\\', '/');
- cmd.prepend( TQString::fromLatin1( "smb:" ) );
+ cmd.tqreplace('\\', '/');
+ cmd.prepend( TQString::tqfromLatin1( "smb:" ) );
setFilteredURI( data, KURL( cmd ));
setURIType( data, KURIFilterData::NET_PROTOCOL );
return true;
@@ -257,7 +257,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
if( path[0] == '~' )
{
- int slashPos = path.find('/');
+ int slashPos = path.tqfind('/');
if( slashPos == -1 )
slashPos = path.length();
if( slashPos == 1 ) // ~/
@@ -293,7 +293,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
const char* exp = getenv( path.mid( 1, r.matchedLength() - 1 ).local8Bit().data() );
if(exp)
{
- path.replace( 0, r.matchedLength(), TQString::fromLocal8Bit(exp) );
+ path.tqreplace( 0, r.matchedLength(), TQString::fromLocal8Bit(exp) );
expanded = true;
}
}
@@ -303,7 +303,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
{
// Look for #ref again, after $ and ~ expansion (testcase: $QTDIR/doc/html/functions.html#s)
// Can't use KURL here, setPath would escape it...
- int pos = path.find('#');
+ int pos = path.tqfind('#');
if ( pos > -1 )
{
ref = path.mid( pos + 1 );
@@ -354,12 +354,12 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
if ( !exists ) {
// Support for name filter (/foo/*.txt), see also KonqMainWindow::detectNameFilter
// If the app using this filter doesn't support it, well, it'll simply error out itself
- int lastSlash = path.findRev( '/' );
- if ( lastSlash > -1 && path.find( ' ', lastSlash ) == -1 ) // no space after last slash, otherwise it's more likely command-line arguments
+ int lastSlash = path.tqfindRev( '/' );
+ if ( lastSlash > -1 && path.tqfind( ' ', lastSlash ) == -1 ) // no space after last slash, otherwise it's more likely command-line arguments
{
TQString fileName = path.mid( lastSlash + 1 );
TQString testPath = path.left( lastSlash + 1 );
- if ( ( fileName.find( '*' ) != -1 || fileName.find( '[' ) != -1 || fileName.find( '?' ) != -1 )
+ if ( ( fileName.tqfind( '*' ) != -1 || fileName.tqfind( '[' ) != -1 || fileName.tqfind( '?' ) != -1 )
&& stat( TQFile::encodeName(testPath).data(), &buff ) == 0 )
{
nameFilter = fileName;
@@ -379,7 +379,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
u.setRef(ref);
u.setQuery(query);
- if (kapp && !kapp->authorizeURLAction( TQString::fromLatin1("open"), KURL(), u))
+ if (kapp && !kapp->authorizeURLAction( TQString::tqfromLatin1("open"), KURL(), u))
{
// No authorisation, we pretend it's a file will get
// an access denied error later on.
@@ -453,7 +453,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
// Okay this is the code that allows users to supply custom matches for
// specific URLs using Qt's regexp class. This is hard-coded for now.
// TODO: Make configurable at some point...
- if ( !cmd.contains( ' ' ) )
+ if ( !cmd.tqcontains( ' ' ) )
{
TQValueList<URLHint>::ConstIterator it;
for( it = m_urlHints.begin(); it != m_urlHints.end(); ++it )
@@ -492,7 +492,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
u.setPath(path);
u.setRef(ref);
- if (kapp && !kapp->authorizeURLAction( TQString::fromLatin1("open"), KURL(), u))
+ if (kapp && !kapp->authorizeURLAction( TQString::tqfromLatin1("open"), KURL(), u))
{
// No authorisation, we pretend it exists and will get
// an access denied error later on.