summaryrefslogtreecommitdiffstats
path: root/lib/libchmfile/libchmurlfactory.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
commit25794f504692e5a36c490438814e9dfda8aaa2dd (patch)
tree8061e6d27b5bc9042afdff177872779c4e8c9015 /lib/libchmfile/libchmurlfactory.h
parent35ff2a942f63b5201c04f41c3097e61cdd7817e9 (diff)
downloadkchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.tar.gz
kchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.zip
TQt4 port kchmviewer
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kchmviewer@1234150 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/libchmfile/libchmurlfactory.h')
-rw-r--r--lib/libchmfile/libchmurlfactory.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/libchmfile/libchmurlfactory.h b/lib/libchmfile/libchmurlfactory.h
index 29ac433..5481e8d 100644
--- a/lib/libchmfile/libchmurlfactory.h
+++ b/lib/libchmfile/libchmurlfactory.h
@@ -19,18 +19,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qdir.h>
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqdir.h>
+#include <tqstring.h>
+#include <tqregexp.h>
namespace LCHMUrlFactory
{
-static inline bool isRemoteURL( const QString & url, QString & protocol )
+static inline bool isRemoteURL( const TQString & url, TQString & protocol )
{
// Check whether the URL is external
- QRegExp uriregex ( "^(\\w+):\\/\\/" );
- QRegExp mailtoregex ( "^(mailto):" );
+ TQRegExp uriregex ( "^(\\w+):\\/\\/" );
+ TQRegExp mailtoregex ( "^(mailto):" );
// mailto: can also have different format, so handle it
if ( url.startsWith( "mailto:" ) )
@@ -40,7 +40,7 @@ static inline bool isRemoteURL( const QString & url, QString & protocol )
}
else if ( uriregex.search ( url ) != -1 )
{
- QString proto = uriregex.cap ( 1 ).lower();
+ TQString proto = TQString(uriregex.cap( 1 )).lower();
// Filter the URLs which need to be opened by a browser
if ( proto == "http"
@@ -57,15 +57,15 @@ static inline bool isRemoteURL( const QString & url, QString & protocol )
}
// Some JS urls start with javascript://
-static inline bool isJavascriptURL( const QString & url )
+static inline bool isJavascriptURL( const TQString & url )
{
return url.startsWith ("javascript://");
}
// Parse urls like "ms-its:file name.chm::/topic.htm"
-static inline bool isNewChmURL( const QString & url, QString & chmfile, QString & page )
+static inline bool isNewChmURL( const TQString & url, TQString & chmfile, TQString & page )
{
- QRegExp uriregex ( "^ms-its:(.*)::(.*)$" );
+ TQRegExp uriregex ( "^ms-its:(.*)::(.*)$" );
if ( uriregex.search ( url ) != -1 )
{
@@ -78,15 +78,15 @@ static inline bool isNewChmURL( const QString & url, QString & chmfile, QString
return false;
}
-static inline QString makeURLabsoluteIfNeeded( const QString & url )
+static inline TQString makeURLabsoluteIfNeeded( const TQString & url )
{
- QString p1, p2, newurl = url;
+ TQString p1, p2, newurl = url;
if ( !isRemoteURL (url, p1)
&& !isJavascriptURL (url)
&& !isNewChmURL (url, p1, p2) )
{
- newurl = QDir::cleanDirPath (url);
+ newurl = TQDir::cleanDirPath (url);
// Normalize url, so it becomes absolute
if ( newurl[0] != '/' )
@@ -100,20 +100,20 @@ static inline QString makeURLabsoluteIfNeeded( const QString & url )
// Returns a special string, which allows the kio-slave, or viewwindow-browser iteraction
// to regognize our own internal urls, which is necessary to show image-only pages.
-static inline QString getInternalUriExtension()
+static inline TQString getInternalUriExtension()
{
return ".KCHMVIEWER_SPECIAL_HANDLER";
}
-static inline bool handleFileType( const QString& link, QString& generated )
+static inline bool handleFileType( const TQString& link, TQString& generated )
{
- QString intext = getInternalUriExtension();
+ TQString intext = getInternalUriExtension();
if ( !link.endsWith( intext ) )
return false;
- QString filelink = link.left( link.length() - strlen( intext ) );
+ TQString filelink = link.left( link.length() - strlen( intext ) );
generated = "<html><body><img src=\"" + filelink + "\"></body></html>";
return true;
}