From e985f7e545f4739493965aad69bbecb136dc9346 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 16 Jun 2011 19:02:47 +0000 Subject: TQt4 port kdewebdev This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kimagemapeditor/qextfileinfo.cpp | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'kimagemapeditor/qextfileinfo.cpp') diff --git a/kimagemapeditor/qextfileinfo.cpp b/kimagemapeditor/qextfileinfo.cpp index 4c10d102..19c638cf 100644 --- a/kimagemapeditor/qextfileinfo.cpp +++ b/kimagemapeditor/qextfileinfo.cpp @@ -32,10 +32,10 @@ //app includes #include "qextfileinfo.h" -TQString QExtFileInfo::lastErrorMsg = ""; +TQString TQExtFileInfo::lastErrorMsg = ""; /** create a relative short url based in baseURL*/ -KURL QExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL) +KURL TQExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL) { KURL resultURL = urlToConvert; if (urlToConvert.protocol() == baseURL.protocol()) @@ -52,8 +52,8 @@ KURL QExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL) int pos1=0; for (;;) { - pos=path.find("/"); - pos1=basePath.find("/"); + pos=path.tqfind("/"); + pos1=basePath.tqfind("/"); if ( pos<0 || pos1<0 ) break; if ( path.left(pos+1 ) == basePath.left(pos1+1) ) { @@ -65,7 +65,7 @@ KURL QExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL) }; if ( basePath == "/" ) basePath=""; - int level = basePath.contains("/"); + int level = basePath.tqcontains("/"); for (int i=0; i=0 ) + while ( (pos = cutname.tqfind("../")) >=0 ) { cutname.remove( 0, pos+3 ); cutdir.remove( cutdir.length()-1, 1 ); - cutdir.remove( cutdir.findRev('/')+1 , 1000); + cutdir.remove( cutdir.tqfindRev('/')+1 , 1000); } resultURL.setPath(TQDir::cleanDirPath(cutdir+cutname)); } @@ -105,27 +105,27 @@ KURL QExtFileInfo::toAbsolute(const KURL& urlToConvert,const KURL& baseURL) This is needed for empty directory adding/handling. (Andras) Currently works only for local directories */ -KURL::List QExtFileInfo::allFiles( const KURL& path, const TQString& mask) +KURL::List TQExtFileInfo::allFiles( const KURL& path, const TQString& tqmask) { - QExtFileInfo internalFileInfo; - return internalFileInfo.allFilesInternal(path, mask); + TQExtFileInfo internalFileInfo; + return internalFileInfo.allFilesInternal(path, tqmask); } -KURL::List QExtFileInfo::allFilesRelative( const KURL& path, const TQString& mask) +KURL::List TQExtFileInfo::allFilesRelative( const KURL& path, const TQString& tqmask) { - QExtFileInfo internalFileInfo; - KURL::List r = internalFileInfo.allFilesInternal( path, mask); + TQExtFileInfo internalFileInfo; + KURL::List r = internalFileInfo.allFilesInternal( path, tqmask); KURL::List::Iterator it; for ( it = r.begin(); it != r.end(); ++it ) { - *it = QExtFileInfo::toRelative( *it, path ); + *it = TQExtFileInfo::toRelative( *it, path ); } return r; } -bool QExtFileInfo::createDir( const KURL& path ) +bool TQExtFileInfo::createDir( const KURL& path ) { int i=0; bool result; @@ -150,7 +150,7 @@ bool QExtFileInfo::createDir( const KURL& path ) return result; } -KURL QExtFileInfo::cdUp(const KURL &url) +KURL TQExtFileInfo::cdUp(const KURL &url) { KURL u = url; TQString dir = u.path(-1); @@ -162,17 +162,17 @@ KURL QExtFileInfo::cdUp(const KURL &url) return u; } -TQString QExtFileInfo::shortName(const TQString &fname) +TQString TQExtFileInfo::shortName(const TQString &fname) { return fname.section("/",-1); } -KURL QExtFileInfo::path( const KURL &url ) +KURL TQExtFileInfo::path( const KURL &url ) { return KURL( url.directory(false,false) ); } -KURL QExtFileInfo::home() +KURL TQExtFileInfo::home() { KURL url; url.setPath(TQDir::currentDirPath()+"/"); @@ -180,7 +180,7 @@ KURL QExtFileInfo::home() } -bool QExtFileInfo::exists(const KURL& a_url) +bool TQExtFileInfo::exists(const KURL& a_url) { // Andras: Don't use it now, as it brings up an extra dialog and need manual // intervention when usign fish @@ -192,21 +192,21 @@ bool QExtFileInfo::exists(const KURL& a_url) return TQFile::exists( a_url.path() ); } else { - QExtFileInfo internalFileInfo; + TQExtFileInfo internalFileInfo; return internalFileInfo.internalExists(a_url); } } /* Synchronouse copy, like NetAccess::file_copy in KDE 3.2 */ -bool QExtFileInfo::copy( const KURL& src, const KURL& target, int permissions, +bool TQExtFileInfo::copy( const KURL& src, const KURL& target, int permissions, bool overwrite, bool resume, TQWidget* window ) { - QExtFileInfo internalFileInfo; + TQExtFileInfo internalFileInfo; return internalFileInfo.internalCopy( src, target, permissions, overwrite, resume, window ); } /** No descriptions */ -KURL::List QExtFileInfo::allFilesInternal(const KURL& startURL, const TQString& mask) +KURL::List TQExtFileInfo::allFilesInternal(const KURL& startURL, const TQString& tqmask) { dirListItems.clear(); if (internalExists(startURL)) @@ -214,7 +214,7 @@ KURL::List QExtFileInfo::allFilesInternal(const KURL& startURL, const TQString& lstFilters.setAutoDelete(true); lstFilters.clear(); // Split on white space - TQStringList list = TQStringList::split( ' ', mask ); + TQStringList list = TQStringList::split( ' ', tqmask ); for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) lstFilters.append( new TQRegExp(*it, false, true ) ); @@ -240,10 +240,10 @@ KURL::List QExtFileInfo::allFilesInternal(const KURL& startURL, const TQString& //Some hackery from KIO::NetAccess as they do not do exactly what we want /* return true if the url exists*/ -bool QExtFileInfo::internalExists(const KURL& url) +bool TQExtFileInfo::internalExists(const KURL& url) { bJobOK = true; - // kdDebug(24000)<<"QExtFileInfo::internalExists"<setDetails(0); job->setSide(false); //check the url for writing @@ -252,13 +252,13 @@ bool QExtFileInfo::internalExists(const KURL& url) //To avoid lock-ups, start a timer. TQTimer::singleShot(10*1000, this,TQT_SLOT(slotTimeout())); -// kdDebug(24000)<<"QExtFileInfo::internalExists:before enter_loop"<enter_loop()"<enter_loop(); -// kdDebug(24000)<<"QExtFileInfo::enter_loop:after qApp->enter_loop()"<enter_loop()"<enter_loop(); +// kdDebug(24000)<<"TQExtFileInfo::enter_loop:after tqApp->enter_loop()"<error(); if ( !bJobOK ) @@ -298,14 +298,14 @@ void QExtFileInfo::slotResult( KIO::Job * job ) } if ( job->isA("KIO::StatJob") ) m_entry = static_cast(job)->statResult(); - qApp->exit_loop(); + tqApp->exit_loop(); } -void QExtFileInfo::slotNewEntries(KIO::Job *job, const KIO::UDSEntryList& udsList) +void TQExtFileInfo::slotNewEntries(KIO::Job *job, const KIO::UDSEntryList& udsList) { KURL url = static_cast(job)->url(); url.adjustPath(-1); - // avoid creating these QStrings again and again + // avoid creating these TQStrings again and again static const TQString& dot = KGlobal::staticQString("."); static const TQString& dotdot = KGlobal::staticQString(".."); @@ -339,9 +339,9 @@ void QExtFileInfo::slotNewEntries(KIO::Job *job, const KIO::UDSEntryList& udsLis } /** Timeout occured while waiting for some network function to return. */ -void QExtFileInfo::slotTimeout() +void TQExtFileInfo::slotTimeout() { bJobOK = false; - qApp->exit_loop(); + tqApp->exit_loop(); } #include "qextfileinfo.moc" -- cgit v1.2.1