diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 21:50:57 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 21:50:57 +0000 |
commit | 8af7968d9309f6869a93ff6f1a4ef51bcff964fb (patch) | |
tree | f875b03e53eb9170c93fc2d2a9d1047e570789e8 | |
parent | 0cbbdc735b3069758b90527554e43ad905e46665 (diff) | |
download | tdeio-locate-8af7968d9309f6869a93ff6f1a4ef51bcff964fb.tar.gz tdeio-locate-8af7968d9309f6869a93ff6f1a4ef51bcff964fb.zip |
TQt4 port kio-locate
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kio-locate@1239314 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | admin/kde.py | 30 | ||||
-rw-r--r-- | debian/changelog | 189 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 18 | ||||
-rw-r--r-- | debian/copyright | 29 | ||||
-rwxr-xr-x | debian/rules | 37 | ||||
-rw-r--r-- | src/SConscript | 2 | ||||
-rw-r--r-- | src/kio_locate.cpp | 204 | ||||
-rw-r--r-- | src/kio_locate.h | 63 | ||||
-rw-r--r-- | src/klocateconfigfilterwidget.ui | 12 | ||||
-rw-r--r-- | src/klocateconfiglocatewidget.ui | 38 | ||||
-rw-r--r-- | src/klocateconfigwidget.ui | 58 | ||||
-rw-r--r-- | src/locater.cpp | 24 | ||||
-rw-r--r-- | src/locater.h | 21 | ||||
-rw-r--r-- | src/pattern.cpp | 20 | ||||
-rw-r--r-- | src/pattern.h | 26 |
16 files changed, 252 insertions, 520 deletions
diff --git a/admin/kde.py b/admin/kde.py index 43927f2..2afdb49 100644 --- a/admin/kde.py +++ b/admin/kde.py @@ -107,40 +107,40 @@ def detect_kde(env): p('GREEN',kde_version) ## Detect the qt library - print "Checking for the qt library : ", + print "Checking for the tqt library : ", if not qtdir: qtdir = os.getenv("QTDIR") if qtdir: - p('GREEN',"qt is in "+qtdir) + p('GREEN',"tqt is in "+qtdir) else: try: tmplibdir = os.popen(kde_config+' --expandvars --install lib').read().strip() libkdeuiSO = env.join(tmplibdir, getSOfromLA(env.join(tmplibdir,'/libkdeui.la')) ) - m = re.search('(.*)/lib/libqt.*', os.popen('ldd ' + libkdeuiSO + ' | grep libqt').read().strip().split()[2]) + m = re.search('(.*)/lib/libtqt.*', os.popen('ldd ' + libkdeuiSO + ' | grep libtqt').read().strip().split()[2]) except: m=None if m: qtdir = m.group(1) - p('YELLOW',"qt was found as "+m.group(1)) + p('YELLOW',"tqt was found as "+m.group(1)) else: - p('RED','qt was not found') + p('RED','tqt was not found') p('RED','Please set QTDIR first (/usr/lib/qt3?) or try scons -h for more options') env.Exit(1) env['QTDIR'] = qtdir.strip() ## Find the necessary programs uic and moc - print "Checking for uic : ", - uic = qtdir + "/bin/uic" + print "Checking for uic-tqt : ", + uic = qtdir + "/bin/uic-tqt" if os.path.isfile(uic): - p('GREEN',"uic was found as "+uic) + p('GREEN',"uic-tqt was found as "+uic) else: - uic = os.popen("which uic 2>/dev/null").read().strip() + uic = os.popen("which uic-tqt 2>/dev/null").read().strip() if len(uic): - p('YELLOW',"uic was found as "+uic) + p('YELLOW',"uic-tqt was found as "+uic) else: - uic = os.popen("which uic 2>/dev/null").read().strip() + uic = os.popen("which uic-tqt 2>/dev/null").read().strip() if len(uic): - p('YELLOW',"uic was found as "+uic) + p('YELLOW',"uic-tqt was found as "+uic) else: - p('RED',"uic was not found - set QTDIR put it in your PATH ?") + p('RED',"uic-tqt was not found - set QTDIR put it in your PATH ?") env.Exit(1) env['QT_UIC'] = uic @@ -174,6 +174,10 @@ def detect_kde(env): # Debian probably p('YELLOW','the qt headers were found in /usr/include/qt3/') qtincludes = "/usr/include/qt3" + elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"): + # Debian probably + p('YELLOW', 'the qt headers were found in /usr/include/qt4/') + qtincludes = "/usr/include/qt4" else: p('RED',"the qt headers were not found") env.Exit(1) diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 1d71935..0000000 --- a/debian/changelog +++ /dev/null @@ -1,189 +0,0 @@ -kio-locate-kde3 (0.4.5-1ubuntu4) karmic; urgency=low - - * Karmic rebuild - - -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Thu, 02 July 2009 16:08:00 -0600 - -kio-locate-kde3 (0.4.5-1ubuntu2) intrepid; urgency=low - - * Moved KDE3 to /opt/kde3 - * Integrated properly with KDE4.2+ - - -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Thu, 05 March 2009 29:52:00 -0600 - -kio-locate-kde3 (0.4.5-1ubuntu1) intrepid; urgency=low - - * Added -kde3 suffix - - -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Thu, 04 Dec 2008 00:35:00 -0600 - -kio-locate (0.4.5-0ubuntu3) hardy; urgency=low - - * Rebuild with recent g++ compiler version. - - -- Matthias Klose <doko@ubuntu.com> Thu, 03 Apr 2008 11:24:38 +0000 - -kio-locate (0.4.5-0ubuntu2) feisty; urgency=low - - * debian/control: Update maintainer fields according to debian- - maintainer-field spec. - - -- Martin Pitt <martin.pitt@ubuntu.com> Mon, 26 Feb 2007 08:49:35 +0000 - -kio-locate (0.4.5-0ubuntu1) edgy; urgency=low - - * Sync with upstream. - * Added an entry in debian/rules to work arround a build issue. - * Switched to debhelper 5 - - -- Anthony Mercatante <tonio@ubuntu.com> Sun, 24 Jul 2006 23:30:58 +0200 - -kio-locate (0.4.5-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Sun, 05 Feb 2006 17:02:09 +0100 - -kio-locate (0.4.4-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Wed, 19 Oct 2005 18:01:59 +0200 - -kio-locate (0.4.3-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Thu, 15 Sep 2005 09:12:38 +0200 - -kio-locate (0.4.2tvo0.2) breezy; urgency=low - - * New release of kio-locate. - - -- Tobi Vollebregt <tobivollebregt@gmail.com> Sun, 21 Aug 2005 14:31:16 +0200 - -kio-locate (0.4.2tvo0.1) breezy; urgency=low - - * New release of kio-locate. - * Minor changes for ubuntu. - * Add bzip2 and python to build-deps. - * Fix the clean rule. - - -- Tobi Vollebregt <tobivollebregt@gmail.com> Thu, 14 Jul 2005 23:14:16 +0200 - -kio-locate (0.4.2-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Sun, 22 May 2005 09:55:57 +0200 - -kio-locate (0.4.1-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Sat, 21 May 2005 16:21:19 +0200 - -kio-locate (0.4.0-1) unstable; urgency=low - - * New release of kio-locate. - * Adapted to the usage of scons. - - -- Armin Straub <linux@arminstraub.de> Sun, 10 Apr 2005 13:12:28 +0200 - -kio-locate (0.3.4-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Sat, 22 Jan 2005 16:13:54 +0100 - -kio-locate (0.3.3-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Fri, 21 Jan 2005 10:23:13 +0100 - -kio-locate (0.3.2-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Mon, 17 Jan 2005 16:38:47 +0100 - -kio-locate (0.3.1-1) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Fri, 10 Dec 2004 10:24:34 +0100 - -kio-locate (0.3.0) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Mon, 01 Nov 2004 08:41:55 +0100 - -kio-locate (0.2.4-2) unstable; urgency=low - - * Non-maintainer upload. - * Reupload with orig.tar.gz named correctly. - - -- Christoffer Sawicki <qerub@home.se> Sat, 30 Oct 2004 19:33:56 +0200 - -kio-locate (0.2.4-1) unstable; urgency=low - - * Non-maintainer upload. - * This is a non-native package and should be treated as such. - * Switched to CDBS. - - -- Christoffer Sawicki <qerub@home.se> Sat, 30 Oct 2004 19:03:23 +0200 - -kio-locate (0.2.4) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Tue, 26 Oct 2004 18:08:05 +0200 - -kio-locate (0.2.3) unstable; urgency=low - - * New release of kio-locate. - - -- Armin Straub <linux@arminstraub.de> Mon, 25 Oct 2004 19:49:52 +0200 - -kio-locate (0.2.2) unstable; urgency=low - - * New release of kio-locate. - * Adjusted the control file to the new release. - - -- Armin Straub <linux@arminstraub.de> Sun, 24 Oct 2004 13:29:05 +0200 - -kio-locate (0.2.1) unstable; urgency=low - - * New release of kio-locate. - * Using kde as the section instead of utils. - - -- Armin Straub <linux@arminstraub.de> Fri, 22 Oct 2004 10:31:37 +0200 - -kio-locate (0.2.0) unstable; urgency=low - - * Complete rewrite. - * Works with KDE 3.3. - - -- Armin Straub <linux@arminstraub.de> Fri, 15 Oct 2004 08:20:36 +0200 - -kio-locate (0.1.1-1) unstable; urgency=low - - * Corrected URL prefix ("file:" instead of "file:/"). - * Update admin dir. - - -- Michael Schuerig <michael@schuerig.de> Sun, 7 Mar 2004 13:10:35 +0100 - -kio-locate (0.1-2) unstable; urgency=low - - * Rebuild for KDE 3.1. - - -- Michael Schuerig <schuerig@acm.org> Mon, 24 Feb 2003 09:07:34 +0100 - -kio-locate (0.1-1) unstable; urgency=low - - * Initial Release. - - -- Michael Schuerig <schuerig@acm.org> Sat, 14 Dec 2002 01:24:28 +0100 - diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100644 index 31f8fb3..0000000 --- a/debian/control +++ /dev/null @@ -1,18 +0,0 @@ -Source: kio-locate-kde3 -Section: kde -Priority: optional -Maintainer: Timothy Pearson <kb9vqf@pearsoncomputing.net> -XSBC-Original-Maintainer: Tobi Vollebregt <tobivollebregt@gmail.com> -Build-Depends: cdbs, debhelper (>= 5), kdelibs4-kde3-dev, bzip2, python (>= 2.3), scons -Standards-Version: 3.7.2 - -Package: kio-locate-kde3 -Architecture: any -Depends: ${shlibs:Depends} -Description: kio-slave for the locate command [KDE3] - Adds support for the "locate:" and "locater:" - protocols to Konqueror and other KDE applications. - . - This enables you to perform locate searches as you - would in a terminal. The result is displayed just - as a directory. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 17e1fdc..0000000 --- a/debian/copyright +++ /dev/null @@ -1,29 +0,0 @@ -This package was debianized by Tobi Vollebregt <tobivollebregt@gmail.com> on -Thu, 14 Jul 2005 22:47:39 +0200 - -It was downloaded from http://arminstraub.de - -Copyright: - Copyright (C) 2004 by Tobi Vollebregt - tobivollebregt@gmail.com - - Copyright (C) 2004 by Armin Straub - linux@arminstraub.de - - This program was initially written by Michael Schuerig. - Although I have completely rewritten it, most ideas are adopted - from his original work. - - Copyright (C) 2002 by Michael Schuerig - michael@schuerig.de - -Upstream Authors: - Tobi Vollebregt <tobivollebregt@gmail.com> - Armin Straub <linux@arminstraub.de> - Michael Schuerig <schuerig@acm.org> - -License: - You are free to distribute this software under the terms of - the GNU General Public License. - On Debian systems, the complete text of the GNU General Public - License can be found in the file `/usr/share/common-licenses/GPL'. diff --git a/debian/rules b/debian/rules deleted file mode 100755 index b0cae30..0000000 --- a/debian/rules +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/cdbs/1/rules/debhelper.mk - -DEB_CONFIGURE_INCLUDEDIR := /opt/kde3/include/kde -DEB_CONFIGURE_MANDIR := /opt/kde3/share/man -DEB_CONFIGURE_PREFIX := /opt/kde3 -DEB_CONFIGURE_INFODIR := /opt/kde3/share/info - -cdbs_configure_flags := --with-qt-dir=/usr/share/qt3 --disable-rpath --with-xinerama $(cdbs_kde_enable_final) $(cdbs_kde_enable_debug) - -DEB_COMPRESS_EXCLUDE=.docbook -DEB_SCONS_PREFIX=/opt/kde3 - -CONFIG_STATUS=$(DEB_BUILDDIR)/config.status -SCONS_CMD=/usr/bin/scons - -common-configure-arch common-configure-indep:: common-configure-impl -common-configure-impl:: $(CONFIG_STATUS) -$(CONFIG_STATUS): - env PATH=/opt/kde3/bin:$(PATH) $(SCONS_CMD) configure prefix=$(DEB_DESTDIR)$(DEB_SCONS_PREFIX) - touch $(CONFIG_STATUS) - -common-build-arch common-build-indep:: common-build-impl -common-build-impl:: - env PATH=/opt/kde3/bin:$(PATH) $(SCONS_CMD) - rm -f doc/en/index.cache.bz2 - -common-install-arch common-install-indep:: common-install-impl -common-install-impl:: - env PATH=/opt/kde3/bin:$(PATH) $(SCONS_CMD) install - -clean:: - rm -rf build cache scons-mini - rm -f admin/*.pyc $(CONFIG_STATUS) - -DEB_INSTALL_DOCS_kio-locate-kde3 := -XREADME -XNEWS -XTODO -XAUTHORS diff --git a/src/SConscript b/src/SConscript index 141cd59..df3d11c 100644 --- a/src/SConscript +++ b/src/SConscript @@ -27,7 +27,7 @@ obj.source=""" locater.cpp pattern.cpp """ -obj.libs='qt-mt kio' +obj.libs='tqt kio' obj.linkflags='-module -avoid-version' # add more link flags obj.execute() diff --git a/src/kio_locate.cpp b/src/kio_locate.cpp index 9beee51..0e930ea 100644 --- a/src/kio_locate.cpp +++ b/src/kio_locate.cpp @@ -36,7 +36,7 @@ #include <klocale.h> #include <kurl.h> #include <kuser.h> -#include <qfile.h> +#include <tqfile.h> #include "kio_locate.h" #include "klocateconfig.h" @@ -47,12 +47,12 @@ using namespace KIO; -static const QString queryQuery = "q"; -static const QString queryDirectory = "directory"; -static const QString queryCase = "case"; -static const QString queryRegExp = "regexp"; +static const TQString queryQuery = "q"; +static const TQString queryDirectory = "directory"; +static const TQString queryCase = "case"; +static const TQString queryRegExp = "regexp"; -static const QString iconToStringTable[] = { +static const TQString iconToStringTable[] = { "folder", "folder_green", "folder_grey", "folder_orange", "folder_red", "folder_violet", "folder_yellow" }; @@ -67,7 +67,7 @@ static const QString iconToStringTable[] = { * For older versions of Konqueror: + behaves identical to * * @param s the string to inspect */ -static bool hasWildcards(const QString& s) +static bool hasWildcards(const TQString& s) { for (unsigned int i = 0; i < s.length(); ++i) { if ((s[i] == '*' || s[i] == '+' || s[i] == '?' || s[i] == '[' || s[i] == ']') && (i < 1 || s[i-1] != '\\')) @@ -84,7 +84,7 @@ static bool hasWildcards(const QString& s) * @param s the string to convert * @return the converted string */ -static QString convertWildcardsToRegExp(QString s) +static TQString convertWildcardsToRegExp(TQString s) { bool in_set = false; @@ -92,7 +92,7 @@ static QString convertWildcardsToRegExp(QString s) // (Konqueror makes passing chars like "/" almost impossible anyway.) // Note that this converts actual wildcards to escaped wildcards (\wildcard), // and escaped wildcards to 'triple'-escaped wildcards (\\\wildcard). - s = QRegExp::escape(s); + s = TQRegExp::escape(s); // Walk through the string, converting \wildcard to regexp and // \\\wildcard back to \wildcard. @@ -144,7 +144,7 @@ static QString convertWildcardsToRegExp(QString s) * Determines if path includes a trailing slash. * @param path the path to inspect */ -static bool hasTrailingSlash(const QString& path) +static bool hasTrailingSlash(const TQString& path) { int n = path.length(); return ((n > 0) && (path[n-1] == '/')); @@ -155,7 +155,7 @@ static bool hasTrailingSlash(const QString& path) * Strips a trailing slash / from a path. * @param path the path to strip the slash off */ -static QString stripTrailingSlash(const QString& path) +static TQString stripTrailingSlash(const TQString& path) { int n = path.length(); if ((n > 0) && (path[n-1] == '/')) { @@ -169,7 +169,7 @@ static QString stripTrailingSlash(const QString& path) * Add a trailing slash / to a path if there is none yet. * @param path the path to append the slash to */ -static QString addTrailingSlash(const QString& path) +static TQString addTrailingSlash(const TQString& path) { int n = path.length(); if ((n > 0) && (path[n-1] == '/')) { @@ -179,7 +179,7 @@ static QString addTrailingSlash(const QString& path) } -static void addAtom(UDSEntry& entry, unsigned int uds, const QString& s) +static void addAtom(UDSEntry& entry, unsigned int uds, const TQString& s) { UDSAtom a; a.m_uds = uds; @@ -197,8 +197,8 @@ static void addAtom(UDSEntry& entry, unsigned int uds, long l) } -static const UDSEntry pathToUDSEntry(const QString& path, const QString& display, - const QString& url = QString::null, const QString& icon = QString::null) +static const UDSEntry pathToUDSEntry(const TQString& path, const TQString& display, + const TQString& url = TQString(), const TQString& icon = TQString()) { UDSEntry entry; addAtom(entry, KIO::UDS_NAME, display); @@ -224,7 +224,7 @@ static const UDSEntry pathToUDSEntry(const QString& path, const QString& display mode_t type = info.st_mode; if (S_ISLNK(type)) { - QString slink = QString::null; + TQString slink = TQString(); char buff[1000]; int n = readlink(path, buff, 1000); if (n != -1) { @@ -238,7 +238,7 @@ static const UDSEntry pathToUDSEntry(const QString& path, const QString& display addAtom(entry, KIO::UDS_FILE_TYPE, type); #ifdef HAVE_UDS_HIDDEN - if (path.contains("/.")) { + if (path.tqcontains("/.")) { addAtom(entry, KIO::UDS_HIDDEN, 1); } #endif @@ -262,15 +262,15 @@ static const UDSEntry pathToUDSEntry(const QString& path, const QString& display ///////////////////////////////////////////////////////////////////// // INITIALIZATION -LocateProtocol::LocateProtocol(const QCString &pool_socket, const QCString &app_socket) +LocateProtocol::LocateProtocol(const TQCString &pool_socket, const TQCString &app_socket) : SlaveBase("kio_locate", pool_socket, app_socket) { DEBUGSTR << "LocateProtocol::LocateProtocol()" << endl; - connect(&m_locater, SIGNAL(found(const QStringList&)), - this, SLOT(processLocateOutput(const QStringList&))); - connect(&m_locater, SIGNAL(finished()), - this, SLOT(locateFinished())); + connect(&m_locater, TQT_SIGNAL(found(const TQStringList&)), + this, TQT_SLOT(processLocateOutput(const TQStringList&))); + connect(&m_locater, TQT_SIGNAL(finished()), + this, TQT_SLOT(locateFinished())); m_baseDir = NULL; m_curDir = NULL; @@ -303,7 +303,7 @@ int LocateProtocol::getCollapseDirectoryThreshold() const void LocateProtocol::setUrl(const KURL& url) { if (url.protocol() != "locater") { - QString pattern = KURL::decode_string(url.url()); + TQString pattern = KURL::decode_string(url.url()); pattern = pattern.mid(url.protocol().length() + 1); KURL newUrl; @@ -345,9 +345,9 @@ void LocateProtocol::get(const KURL& url) if (isSearchRequest()) { if (m_locater.binaryExists()) { - error(KIO::ERR_IS_DIRECTORY, QString::null); + error(KIO::ERR_IS_DIRECTORY, TQString()); } else { - QString html = i18n("<h1>\"%1\" could not be started.</h1><p>Please note that kio-locate can't be used on its own. You need an additional program for doing searches. Typically this is the command line tool <i>locate</i> that can be found in many distributions by default. You can check if the correct tool is used by looking at the <a href=\"locater:config\">setting</a> \"Locate Binary\".<p>Besides the mentioned tool <i>locate</i>, kio-locate can use any tool that uses the same syntax. In particular, it was reported to work with <i>slocate</i> and <i>rlocate</i>.").arg(m_locater.binary()); + TQString html = i18n("<h1>\"%1\" could not be started.</h1><p>Please note that kio-locate can't be used on its own. You need an additional program for doing searches. Typically this is the command line tool <i>locate</i> that can be found in many distributions by default. You can check if the correct tool is used by looking at the <a href=\"locater:config\">setting</a> \"Locate Binary\".<p>Besides the mentioned tool <i>locate</i>, kio-locate can use any tool that uses the same syntax. In particular, it was reported to work with <i>slocate</i> and <i>rlocate</i>.").tqarg(m_locater.binary()); outputHtml(html); } } else if (isConfigRequest()) { @@ -356,7 +356,7 @@ void LocateProtocol::get(const KURL& url) helpRequest(); } else { // What's this? - error(KIO::ERR_DOES_NOT_EXIST, QString::null); + error(KIO::ERR_DOES_NOT_EXIST, TQString()); } } @@ -380,7 +380,7 @@ void LocateProtocol::stat(const KURL& url) /// by konqueror anyway. How to change this? } else { // What's this? - error(KIO::ERR_DOES_NOT_EXIST, QString::null); + error(KIO::ERR_DOES_NOT_EXIST, TQString()); } } @@ -394,10 +394,10 @@ void LocateProtocol::listDir(const KURL& url) if (isSearchRequest()) { searchRequest(); } else if (isConfigRequest() || isHelpRequest()) { - error(KIO::ERR_IS_FILE, QString::null); + error(KIO::ERR_IS_FILE, TQString()); } else { // What's this? - error(KIO::ERR_DOES_NOT_EXIST, QString::null); + error(KIO::ERR_DOES_NOT_EXIST, TQString()); } } @@ -421,11 +421,11 @@ void LocateProtocol::mimetype(const KURL& url) } -void LocateProtocol::outputHtml(const QString& body) +void LocateProtocol::outputHtml(const TQString& body) { mimeType("text/html"); - QString theData = "<html><body>" + body + "</body></html>"; + TQString theData = "<html><body>" + body + "</body></html>"; data(theData.local8Bit()); finished(); } @@ -445,10 +445,10 @@ void LocateProtocol::searchRequest() // Reset old values. m_caseSensitivity = caseAuto; m_useRegExp = false; - m_locatePattern = QString::null; - m_locateDirectory = QString::null; + m_locatePattern = TQString(); + m_locateDirectory = TQString(); m_regExps.clear(); - m_pendingPath = QString::null; + m_pendingPath = TQString(); delete m_baseDir; m_baseDir = NULL; @@ -456,17 +456,17 @@ void LocateProtocol::searchRequest() updateConfig(); - QString query = m_url.queryItem(queryQuery); + TQString query = m_url.queryItem(queryQuery); m_locateDirectory = addTrailingSlash(m_url.queryItem(queryDirectory)); - QString caseSensitivity = m_url.queryItem(queryCase); + TQString caseSensitivity = m_url.queryItem(queryCase); if (caseSensitivity == "sensitive") { m_caseSensitivity = caseSensitive; } else if (caseSensitivity == "insensitive") { m_caseSensitivity = caseInsensitive; } - QString useRegExp = m_url.queryItem(queryRegExp); + TQString useRegExp = m_url.queryItem(queryRegExp); if (!useRegExp.isEmpty() && useRegExp != "0") { m_useRegExp = true; } @@ -480,12 +480,12 @@ void LocateProtocol::searchRequest() int s = 0; int n = query.length(); bool regexp; - QString display; + TQString display; for (int i = 0; i <= n; i++) { if ((i == n) || ((query[i] == ' ') && (i > 0) && (query[i-1] != '\\') && (i-s > 0))) { - QString temp = query.mid(s, i-s); - QString part = partToPattern(temp, s==0); + TQString temp = query.mid(s, i-s); + TQString part = partToPattern(temp, s==0); if (s == 0) { // We don't want to show the escaped regexpified string to // the user, so we store the string we get in for later display. @@ -512,7 +512,7 @@ void LocateProtocol::searchRequest() m_locateRegExp = LocateRegExp(convertWildcardsToRegExp(m_locatePattern), !isCaseSensitive(m_locatePattern)); // Now perform the search... - infoMessage(i18n("Locating %1 ...").arg(display)); + infoMessage(i18n("Locating %1 ...").tqarg(display)); bool started = m_locater.locate(m_locatePattern, !isCaseSensitive(m_locatePattern), regexp); @@ -523,7 +523,7 @@ void LocateProtocol::searchRequest() } -bool LocateProtocol::isCaseSensitive(const QString& text) +bool LocateProtocol::isCaseSensitive(const TQString& text) { if (m_caseSensitivity == caseSensitive) { return true; @@ -539,10 +539,10 @@ bool LocateProtocol::isCaseSensitive(const QString& text) } -void LocateProtocol::addHit(const QString& path, int subItems) +void LocateProtocol::addHit(const TQString& path, int subItems) { // DEBUGSTR << "LocateProtocol::addHit( " << path << ", " << subItems << " )" << endl; - if (QFile::exists(path)) { + if (TQFile::exists(path)) { if (subItems > 0) { m_entries += pathToUDSEntry(path, pathToDisplay(path, subItems), makeLocaterUrl(path), iconToStringTable[m_config.m_collapsedIcon]); } else { @@ -574,7 +574,7 @@ void LocateProtocol::addPreviousLocateOutput() } -void LocateProtocol::processPath(const QString &path, const QString &nextPath) +void LocateProtocol::processPath(const TQString &path, const TQString &nextPath) { if (!nextPath) { // We need to know the next path, so we remember this path for later processing. @@ -586,8 +586,8 @@ void LocateProtocol::processPath(const QString &path, const QString &nextPath) } // Add path to current directory. if (m_baseDir == NULL) { - int p = path.find('/', 1); - QString base = path; + int p = path.tqfind('/', 1); + TQString base = path; if (p >= 0) { base = path.left(p+1); } @@ -600,7 +600,7 @@ void LocateProtocol::processPath(const QString &path, const QString &nextPath) } -void LocateProtocol::processLocateOutput(const QStringList& items) +void LocateProtocol::processLocateOutput(const TQStringList& items) { // I don't know if this really necessary, but if we were signaled, we'll // better stop. @@ -609,15 +609,15 @@ void LocateProtocol::processLocateOutput(const QStringList& items) return; } // Go through what we have found. - QStringList::ConstIterator it = items.begin(); + TQStringList::ConstIterator it = items.begin(); if (m_pendingPath) { processPath(m_pendingPath, *it); - m_pendingPath = QString::null; + m_pendingPath = TQString(); } for (; it != items.end();) { - QString path = *it; + TQString path = *it; ++it; - processPath(path, it != items.end() ? *it : QString::null); + processPath(path, it != items.end() ? *it : TQString()); } } @@ -627,7 +627,7 @@ void LocateProtocol::locateFinished() // Add any pending items. if (m_pendingPath) { processPath(m_pendingPath, ""); - m_pendingPath = QString::null; + m_pendingPath = TQString(); } addPreviousLocateOutput(); @@ -637,12 +637,12 @@ void LocateProtocol::locateFinished() } -QString LocateProtocol::partToPattern(const QString& part, bool forLocate) +TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate) { DEBUGSTR << "BEG part: " << part << endl; - QString pattern = part; + TQString pattern = part; // Unescape whitespace. - pattern.replace("\\ ", " "); + pattern.tqreplace("\\ ", " "); // Unquote quoted pattern. int n = pattern.length(), index; if ((n > 1) && (pattern[0] == '"') && (pattern[n-1] == '"')) { @@ -651,7 +651,7 @@ QString LocateProtocol::partToPattern(const QString& part, bool forLocate) // We can't do regular expression matching on the locate pattern, // the regular expression format used by locate is incompatible - // with the format used by QRegExp. + // with the format used by TQRegExp. if (!m_useRegExp || forLocate) { // Escape regexp characters for filtering pattern, and for locate, // but the latter only if it is actually necessary to pass a regexp to locate. @@ -661,11 +661,11 @@ QString LocateProtocol::partToPattern(const QString& part, bool forLocate) } else { // Special case for locate pattern without wildcards: // Unescape all escaped wildcards. - pattern.replace("\\*", "*"); - pattern.replace("\\+", "+"); - pattern.replace("\\?", "?"); - pattern.replace("\\[", "["); - pattern.replace("\\]", "]"); + pattern.tqreplace("\\*", "*"); + pattern.tqreplace("\\+", "+"); + pattern.tqreplace("\\?", "?"); + pattern.tqreplace("\\[", "["); + pattern.tqreplace("\\]", "]"); } } @@ -673,28 +673,28 @@ QString LocateProtocol::partToPattern(const QString& part, bool forLocate) if (forLocate) { // Replace ~/ and ~user/ at the beginning (as the shell does) if ((pattern.length() > 0) && (pattern[0] == '~')) { - index = pattern.find('/'); + index = pattern.tqfind('/'); if (index >= 0) { - QString name = pattern.mid(1, index-1); - QString homeDir; + TQString name = pattern.mid(1, index-1); + TQString homeDir; if (name.isEmpty()) { homeDir = KUser(KUser::UseRealUserID).homeDir(); } else { homeDir = KUser(name).homeDir(); } if (!homeDir.isEmpty()) { - pattern.replace(0, index, homeDir); + pattern.tqreplace(0, index, homeDir); } } } - pattern.replace("\\~", "~"); + pattern.tqreplace("\\~", "~"); } DEBUGSTR << "END part: " << pattern << endl; return pattern; } -bool LocateProtocol::isMatching(const QString& path) +bool LocateProtocol::isMatching(const TQString& path) { // The file has to belong to our directory. if (!path.startsWith(m_locateDirectory)) { @@ -717,28 +717,28 @@ bool LocateProtocol::isMatching(const QString& path) } -QString LocateProtocol::pathToDisplay(const QString& path, int subItems) +TQString LocateProtocol::pathToDisplay(const TQString& path, int subItems) { // Split off the directory part. If it is not just the minimal '/'. - QString display = path; + TQString display = path; if ((m_locateDirectory != "/") && display.startsWith(m_locateDirectory)) { display = display.mid(m_locateDirectory.length()); } if (subItems > 0) { - // Can't use m_collapsedDisplay.arg(subItems).arg(display); here + // Can't use m_collapsedDisplay.tqarg(subItems).tqarg(display); here // because user might forget to type %1 or %2, or type it twice. // In both cases the result of arg() is undefined. - QString output = m_config.m_collapsedDisplay, temp; + TQString output = m_config.m_collapsedDisplay, temp; temp.setNum(subItems); - output.replace("%1", temp); - output.replace("%2", display); + output.tqreplace("%1", temp); + output.tqreplace("%2", display); display = output; } return display; } -QString LocateProtocol::makeLocaterUrl(const QString& directory) +TQString LocateProtocol::makeLocaterUrl(const TQString& directory) { KURL url(m_url); url.removeQueryItem(queryDirectory); @@ -771,18 +771,18 @@ void LocateProtocol::configRequest() KDialogBase::Default|KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help, KDialogBase::Ok, true); dialog->setCaption(i18n("Configure - kio-locate")); - dialog->setIcon(SmallIcon("find")); + dialog->setIcon(SmallIcon("tqfind")); dialog->addPage(new KLocateConfigWidget(), i18n("General"), "package_settings"); dialog->addPage(new KLocateConfigFilterWidget(), i18n("Filters"), "filter"); - dialog->addPage(new KLocateConfigLocateWidget(), i18n("Locate"), "find"); + dialog->addPage(new KLocateConfigLocateWidget(), i18n("Locate"), "tqfind"); // React on user's actions. - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(updateConfig())); - connect(dialog, SIGNAL(finished()), this, SLOT(configFinished())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateConfig())); + connect(dialog, TQT_SIGNAL(finished()), this, TQT_SLOT(configFinished())); dialog->show(); - qApp->enter_loop(); + tqApp->enter_loop(); delete dialog; } @@ -791,9 +791,9 @@ void LocateProtocol::configFinished() { DEBUGSTR << "LocateProtocol::configFinished" << endl; - qApp->exit_loop(); + tqApp->exit_loop(); - QString html; + TQString html; if (m_configUpdated) { html = i18n("Configuration succesfully updated."); } else { @@ -843,20 +843,20 @@ void LocateProtocol::helpRequest() ///////////////////////////////////////////////////////////////////// // SEARCH STRUCTURES -LocateDirectory::LocateDirectory(LocateDirectory *parent, const QString& path) +LocateDirectory::LocateDirectory(LocateDirectory *tqparent, const TQString& path) { - m_parent = parent; + m_parent = tqparent; m_path = path; m_childs.setAutoDelete(true); m_itemsCount = 0; } -LocateDirectory *LocateDirectory::addPath(const QString& path) +LocateDirectory *LocateDirectory::addPath(const TQString& path) { if (path.startsWith(m_path)) { - QString relPath = path.mid(m_path.length()); - int p = relPath.findRev('/'); + TQString relPath = path.mid(m_path.length()); + int p = relPath.tqfindRev('/'); if (p >= 0) { LocateDirectory *child = getSubDirectory(relPath.left(p)); child->addItem(relPath.mid(p+1)); @@ -873,14 +873,14 @@ LocateDirectory *LocateDirectory::addPath(const QString& path) } -LocateDirectory *LocateDirectory::getSubDirectory(const QString& relPath) +LocateDirectory *LocateDirectory::getSubDirectory(const TQString& relPath) { - QString base = relPath; - int p = relPath.find('/'); + TQString base = relPath; + int p = relPath.tqfind('/'); if (p >= 0) { base = relPath.left(p); } - LocateDirectory *child = m_childs.find(base); + LocateDirectory *child = m_childs.tqfind(base); if (child == NULL) { child = new LocateDirectory(this, addTrailingSlash(m_path + base)); m_childs.insert(base, child); @@ -892,7 +892,7 @@ LocateDirectory *LocateDirectory::getSubDirectory(const QString& relPath) } -void LocateDirectory::addItem(const QString& path) +void LocateDirectory::addItem(const TQString& path) { m_items += LocateItem(m_path + path, 0); m_itemsCount++; @@ -929,20 +929,20 @@ void LocateDirectory::prepareListing(const LocateProtocol* protocol, int skip) m_fullCount = countMatchingItems(protocol, newSkip); // Collapse if directory part matches. - LocateDirectory* parent = m_parent; - if (parent == NULL) { - parent = this; + LocateDirectory* tqparent = m_parent; + if (tqparent == NULL) { + tqparent = this; } if (n > skip && protocol->getRegExp().isMatching(m_path.mid(skip))) { // Directory part matches. m_childs.clear(); m_items.clear(); m_itemsCount = 0; - parent->m_items += LocateItem(m_path, m_fullCount); - ++parent->m_itemsCount; + tqparent->m_items += LocateItem(m_path, m_fullCount); + ++tqparent->m_itemsCount; if (m_fullCount != 0) { - parent->m_items += LocateItem(m_path, 0); - ++parent->m_itemsCount; + tqparent->m_items += LocateItem(m_path, 0); + ++tqparent->m_itemsCount; } } @@ -958,7 +958,7 @@ void LocateDirectory::prepareListing(const LocateProtocol* protocol, int skip) ++m_itemsCount; } } else { - // Propagate items to parent. + // Propagate items to tqparent. // (only root LocateDirectory runs listItems) if (m_parent != NULL) { m_parent->m_items += m_items; @@ -979,7 +979,7 @@ void LocateDirectory::listItems(LocateProtocol *protocol) void LocateDirectory::debugTrace(int level) { - QString ws; + TQString ws; ws.fill(' ', level); DEBUGSTR << ws << m_path << endl; LocateItems::ConstIterator item = m_items.begin(); @@ -998,7 +998,7 @@ LocateItem::LocateItem() } -LocateItem::LocateItem(const QString& path, int subItems) +LocateItem::LocateItem(const TQString& path, int subItems) { m_path = path; m_subItems = subItems; diff --git a/src/kio_locate.h b/src/kio_locate.h index d5df32c..f944c5c 100644 --- a/src/kio_locate.h +++ b/src/kio_locate.h @@ -59,11 +59,11 @@ #ifndef _kio_locate_H_ #define _kio_locate_H_ -#include <qcstring.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> +#include <tqvaluelist.h> #include <kio/global.h> #include <kio/slavebase.h> @@ -71,7 +71,7 @@ #include "locater.h" #include "pattern.h" -class QCString; +class TQCString; class KURL; @@ -79,9 +79,9 @@ class KURL; class LocateItem; class LocateDirectory; -typedef QValueList<LocateItem> LocateItems; -typedef QDict<LocateDirectory> LocateDirectories; -typedef QDictIterator<LocateDirectory> LocateDirectoriesIterator; +typedef TQValueList<LocateItem> LocateItems; +typedef TQDict<LocateDirectory> LocateDirectories; +typedef TQDictIterator<LocateDirectory> LocateDirectoriesIterator; enum LocateCaseSensitivity { caseAuto, caseSensitive, caseInsensitive }; enum LocateCollapsedIcon { iconBlue, iconGreen, iconGrey, iconOrange, iconRed, iconViolet, iconYellow }; @@ -93,14 +93,15 @@ enum LocateCollapsedIcon { iconBlue, iconGreen, iconGrey, iconOrange, iconRed, i * Enables you to enter "locate:pattern" wherever an URL can be used * in KDE. */ -class LocateProtocol : public QObject, public KIO::SlaveBase +class LocateProtocol : public TQObject, public KIO::SlaveBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - LocateProtocol(const QCString &pool_socket, const QCString &app_socket); + LocateProtocol(const TQCString &pool_socket, const TQCString &app_socket); virtual ~LocateProtocol(); @@ -137,13 +138,13 @@ class LocateProtocol : public QObject, public KIO::SlaveBase * @param subItems the number of hits beneath this one * (or 0 for a regular hit) */ - virtual void addHit(const QString& path, int subItems = 0); + virtual void addHit(const TQString& path, int subItems = 0); const LocateRegExp& getRegExp() const; int getCollapseDirectoryThreshold() const; private slots: - void processLocateOutput(const QStringList& items); + void processLocateOutput(const TQStringList& items); void locateFinished(); void configFinished(); void updateConfig(); @@ -152,9 +153,9 @@ class LocateProtocol : public QObject, public KIO::SlaveBase Locater m_locater; KURL m_url; - QString m_locatePattern; + TQString m_locatePattern; LocateRegExp m_locateRegExp; // Equals m_locatePattern, but regexp. - QString m_locateDirectory; // Includes a trailing slash. + TQString m_locateDirectory; // Includes a trailing slash. LocateRegExpList m_regExps; // List of extra filtering regexps. LocateCaseSensitivity m_caseSensitivity; // For current search. @@ -166,25 +167,25 @@ class LocateProtocol : public QObject, public KIO::SlaveBase LocateCaseSensitivity m_caseSensitivity; // Default case sensitivity. int m_collapseDirectoryThreshold; // Maximum number of hits in a directory // before a directory search is created - QString m_collapsedDisplay; // Format string used for collapsed directories. + TQString m_collapsedDisplay; // Format string used for collapsed directories. LocateCollapsedIcon m_collapsedIcon; // Icon used for collapsed directories. LocateRegExpList m_whiteList; // Path must match at least one regexp in this list. LocateRegExpList m_blackList; // Path may not match any regexp in this list. } m_config; bool m_configUpdated; // Used in config methods to check if config was cancelled or okay'ed. - QString m_pendingPath; // Must be processed as soon as new output becomes available. + TQString m_pendingPath; // Must be processed as soon as new output becomes available. LocateDirectory *m_baseDir; // The toplevel directory, e.g. "/usr/". LocateDirectory *m_curDir; // The current directory (while locating). KIO::UDSEntryList m_entries; // Used to cache a lot of hits and list them all at once. - QString partToPattern(const QString& part, bool forLocate); - bool isMatching(const QString& file); - QString pathToDisplay(const QString& path, int subItems = 0); + TQString partToPattern(const TQString& part, bool forLocate); + bool isMatching(const TQString& file); + TQString pathToDisplay(const TQString& path, int subItems = 0); void addPreviousLocateOutput(); - void processPath(const QString &path, const QString &nextPath); + void processPath(const TQString &path, const TQString &nextPath); bool isSearchRequest(); bool isConfigRequest(); @@ -194,7 +195,7 @@ class LocateProtocol : public QObject, public KIO::SlaveBase void configRequest(); void helpRequest(); - bool isCaseSensitive(const QString& text); + bool isCaseSensitive(const TQString& text); /** * Composes a locater:... url for the current search parameters @@ -202,7 +203,7 @@ class LocateProtocol : public QObject, public KIO::SlaveBase * @param directory the directory in which we should be searched * @return the url that envokes the specified search */ - QString makeLocaterUrl(const QString& dir); + TQString makeLocaterUrl(const TQString& dir); /** * This function has to check whether we are accessed via the standard @@ -217,7 +218,7 @@ class LocateProtocol : public QObject, public KIO::SlaveBase */ void setUrl(const KURL& url); - void outputHtml(const QString& body); + void outputHtml(const TQString& body); }; @@ -232,10 +233,10 @@ class LocateItem { public: LocateItem(); - LocateItem(const QString& path, int subItems); + LocateItem(const TQString& path, int subItems); public: - QString m_path; + TQString m_path; int m_subItems; }; @@ -250,23 +251,23 @@ class LocateItem class LocateDirectory { public: - LocateDirectory(LocateDirectory *parent, const QString& path); + LocateDirectory(LocateDirectory *tqparent, const TQString& path); - LocateDirectory *addPath(const QString& path); + LocateDirectory *addPath(const TQString& path); void prepareListing(const LocateProtocol* protocol, int skip); void listItems(LocateProtocol *protocol); void debugTrace(int level = 0); public: - QString m_path; // Including trailing slash. + TQString m_path; // Including trailing slash. LocateDirectory *m_parent; LocateDirectories m_childs; LocateItems m_items; int m_itemsCount; int m_fullCount; - LocateDirectory *getSubDirectory(const QString& relPath); - void addItem(const QString& path); + LocateDirectory *getSubDirectory(const TQString& relPath); + void addItem(const TQString& path); int countMatchingItems(const LocateProtocol *protocol, int skip); }; diff --git a/src/klocateconfigfilterwidget.ui b/src/klocateconfigfilterwidget.ui index 523e5c9..8044b7d 100644 --- a/src/klocateconfigfilterwidget.ui +++ b/src/klocateconfigfilterwidget.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KLocateConfigFilterWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>KLocateConfigFilterWidget</cstring> </property> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox6</cstring> </property> @@ -30,7 +30,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -69,7 +69,7 @@ <string>A path may not match any of these regular expressions.</string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -80,7 +80,7 @@ <enum>RichText</enum> </property> </widget> - <widget class="QLabel" row="2" column="1"> + <widget class="TQLabel" row="2" column="1"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -95,7 +95,7 @@ </widget> </vbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>keditlistbox.h</includehint> <includehint>klineedit.h</includehint> diff --git a/src/klocateconfiglocatewidget.ui b/src/klocateconfiglocatewidget.ui index e1fb7a8..5fa062d 100644 --- a/src/klocateconfiglocatewidget.ui +++ b/src/klocateconfiglocatewidget.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KLocateConfigLocateWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>KLocateConfigLocateWidget</cstring> </property> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox4</cstring> </property> @@ -30,7 +30,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -44,7 +44,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -58,7 +58,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_2_2</cstring> </property> @@ -66,22 +66,22 @@ <string>Use these settings only if you really know what you do. Otherwise the default should be ok.</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> <property name="text"> <string>Locate &binary:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter</set> </property> <property name="buddy" stdset="0"> @@ -98,7 +98,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>81</width> <height>20</height> @@ -117,7 +117,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>200</width> <height>0</height> @@ -126,7 +126,7 @@ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_2</cstring> </property> @@ -134,15 +134,15 @@ <string><i>Hint:</i> If you don't specify a value here (which is the default), kio-locate will automatically pick slocate, rlocate or locate (in that order).</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout12</cstring> + <cstring>tqlayout12</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4_2</cstring> </property> @@ -163,7 +163,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>51</width> <height>20</height> @@ -182,7 +182,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>200</width> <height>0</height> @@ -191,7 +191,7 @@ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -203,7 +203,7 @@ </widget> </vbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>klineedit.h</includehint> diff --git a/src/klocateconfigwidget.ui b/src/klocateconfigwidget.ui index 2e1d946..3a9eee1 100644 --- a/src/klocateconfigwidget.ui +++ b/src/klocateconfigwidget.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KLocateConfigWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>KLocateConfigWidget</cstring> </property> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -30,15 +30,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -59,14 +59,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>284</width> <height>20</height> </size> </property> </spacer> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Auto</string> @@ -85,7 +85,7 @@ <property name="name"> <cstring>kcfg_caseSensitivity</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>150</width> <height>0</height> @@ -94,7 +94,7 @@ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -104,7 +104,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -118,15 +118,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -141,7 +141,7 @@ <property name="text"> <string>&Collapse a directory with more hits:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter</set> </property> <property name="buddy" stdset="0"> @@ -158,7 +158,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>141</width> <height>20</height> @@ -175,15 +175,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -198,7 +198,7 @@ <property name="text"> <string>Text of a collapsed &directory:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter</set> </property> <property name="buddy" stdset="0"> @@ -215,7 +215,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>100</width> <height>20</height> @@ -234,7 +234,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>200</width> <height>0</height> @@ -243,7 +243,7 @@ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_2</cstring> </property> @@ -251,15 +251,15 @@ <string><i>Hint:</i> %1 is substituted by the number of hits and %2 by the name of the directory.</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -280,14 +280,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>161</width> <height>20</height> </size> </property> </spacer> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Blue</string> @@ -347,7 +347,7 @@ <property name="name"> <cstring>kcfg_collapsedIcon</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>150</width> <height>0</height> @@ -383,7 +383,7 @@ <data format="PNG" length="1211">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000048249444154388d95944f6c54551487bf695ff53e9cea0c69c94c6cb02fb4d84682b601a30425d3c4a8c0c63646a9ff426b62005920246aaa0b52c584d2850b1660d005200b086cccc0a653443b1a10c604e96b80f40db6ce1b6bed7bb193be0b73e5ba98a1b4091238c9c9c9bdb9f73b27e777cf0d69adb96f0b82d0f0a96f9ff42fa6b67b8aacf5f2963e5379b5b1156dd74cd35400a1fb0217c11d49d7c98ba9b7a976375acfc41bd2075357e5a47916e5c6bda6ee773bbab68c0218f7caf41c67a17df24087552b375989c872c2540623195a9aad25b26057b8e7ec69fbeaf0a3c01dc0c5a032c866164b4988bae66c341abde98d390bfc5f922fa29cf75b5e88ac3663de038c3b042311ccb0807006dfb19529657550c8d605d30166b5590617c11b492d259bee8ed6d02efd8cb607c57e8475296e78efc45646d7994d224c3e03bf4540c430635990c320cc9010625144492dff722c29c1ac0623980e2afd9ff7be2ef07ba2abad26a24e284a8c96a6ec2e0a6ed16c889b4827c4af1284053117940d05ff9692448578385014a3ca5bea8cdb46b4b65519fe48ea0921646ff439cb82f46c574cabbe0a64156336e463506f020e4817a40443800c4a8727658529446544e597f879f711e0ef0a6fd2d7200cb0a128e7b85f8a79010d71306c501ec87266e5956256c2a40443565882c5f6b9c13a800a39966915029322a54ad49c98f7c1b0c0704b6b55a62a0998909730564e2444c8aaa656f8de72800a0ace5ab3deaca160972e48bf14b32e8cc7202640e54105b7e10a18f74a5059eeb521427259bbe9e5f36b5cc7312adf7bad3d1479c878a92a9c7f901bd3505090ad02e369585a050b1c9005b8a9402a985130aec0036e144019040b1ab9d2b883f1c73af1738ee94979ca88af5c3b98bf78fc82158badc17760b2191a2c88b8805f6a0b4041420198e476e54604b7ae0d37de8d4f0414881acb4a1d3d9ca88837ac9a747d8ee15bff520062cd10714a5005204a82493147b800a2ad388d9fe1357f82147104e06406d58593c7cf66b2cee50a4c88b7ac4dba23f92b080b7c67be805296804a9645130475dd380dbd04b1b6524edf257da4ffcfe4377bfacc952d6f1e4ea64f1b00d653cf8e0e1f499d882beb630a0ea848a9d232a8f4b404849b09eadec0375a1040e04bdc4cba983cd8ff435e89dd9dbbf6a43a5ee928defe2b4c13bfda3ae25cb5375811ea29081065a8f4c088424d1b41b813a9040270b30e3f1dfdda4d9e3cfc959568dfb767db8e9c6559b30336fb6d069e17b28f7efe456ba3f8908807f5f9f284b540b81d8c560205c800fbc764f1f8fefed3b62f77777dd0fbfdbaf5eb8a5431dfb4d6b33e9a1e78fcd2decdf6cc991ead27bab4fee790d67a4adfb2a9df73fad8ceed639d2bea7bb66fea8ae54673f3eecff5f91b33330c7dd9b3357760f3753d715ecfb55c7ae07aefab8964d7fab56b86524386be7167e09dc15a93bb7c69e1775b13c9a93387b4d65acf4ce4f4407fcfb5aed5cd1ff5edec5d3435317557e0ff82b5d60ceceb7dfefca7ed7f8ca68e057d1b1227bad627560d9d19aabc17e05dc133135395bd6f2536b62f8b6cebd9b6f99eab9cebff01a7a517d9791775a00000000049454e44ae426082</data> </image> </images> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>klineedit.h</includehint> diff --git a/src/locater.cpp b/src/locater.cpp index 4072209..f221a6e 100644 --- a/src/locater.cpp +++ b/src/locater.cpp @@ -23,7 +23,7 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <kdebug.h> #include <kstandarddirs.h> @@ -31,15 +31,15 @@ #include "locater.h" -Locater::Locater(QObject *parent, const char *name) - : QObject(parent, name), m_process(QTextCodec::codecForLocale()) +Locater::Locater(TQObject *tqparent, const char *name) + : TQObject(tqparent, name), m_process(TQTextCodec::codecForLocale()) { DEBUGSTR << "Locater::Locater" << endl; - connect(&m_process, SIGNAL(processExited(KProcess*)), - this, SLOT(finished(KProcess*))); - connect(&m_process, SIGNAL(readReady(KProcIO*)), - this, SLOT(gotOutput(KProcIO*))); + connect(&m_process, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(finished(KProcess*))); + connect(&m_process, TQT_SIGNAL(readReady(KProcIO*)), + this, TQT_SLOT(gotOutput(KProcIO*))); setupLocate(); } @@ -51,7 +51,7 @@ Locater::~Locater() } -void Locater::setupLocate(const QString& binary, const QString& additionalArguments) +void Locater::setupLocate(const TQString& binary, const TQString& additionalArguments) { DEBUGSTR << "Locater::setupLocate(" << binary << ", " << additionalArguments << ")" << endl; @@ -69,11 +69,11 @@ void Locater::setupLocate(const QString& binary, const QString& additionalArgume m_binary = binary; } m_additionalArguments = additionalArguments; - m_binaryExists = KStandardDirs::findExe(m_binary) != QString::null; + m_binaryExists = KStandardDirs::findExe(m_binary) != TQString(); } -bool Locater::locate(const QString& pattern, bool ignoreCase, bool regExp) +bool Locater::locate(const TQString& pattern, bool ignoreCase, bool regExp) { DEBUGSTR << "Locater::locate(" << pattern << "," << ignoreCase << "," << regExp << ")" << endl; @@ -107,8 +107,8 @@ void Locater::gotOutput(KProcIO* /*proc*/) { //DEBUGSTR << "Locater::gotOutput" << endl; - QStringList items; - QString line; + TQStringList items; + TQString line; while (m_process.readln(line) != -1) { //DEBUGSTR << "OUTPUT>> '" << line << "'" << endl; diff --git a/src/locater.h b/src/locater.h index e083d2a..7674838 100644 --- a/src/locater.h +++ b/src/locater.h @@ -26,8 +26,8 @@ #ifndef LOCATER_H #define LOCATER_H -#include <qobject.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqstringlist.h> #include <kprocio.h> @@ -44,14 +44,15 @@ * found. * - When finished the signal finished is emitted. */ -class Locater : public QObject +class Locater : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - Locater(QObject *parent = 0, const char *name = 0); + Locater(TQObject *tqparent = 0, const char *name = 0); virtual ~Locater(); @@ -62,7 +63,7 @@ class Locater : public QObject * @param regExp whether to treat pattern as a regular expression or not * @return true if locate could be started */ - bool locate(const QString& pattern, bool ignoreCase = false, bool regExp = false); + bool locate(const TQString& pattern, bool ignoreCase = false, bool regExp = false); /** * Set parameters for using locate. @@ -70,11 +71,11 @@ class Locater : public QObject * slocate, rlocate and locate) * @param additionalArguments additional arguments to use */ - void setupLocate(const QString& binary = "", const QString& additionalArguments = ""); + void setupLocate(const TQString& binary = "", const TQString& additionalArguments = ""); void stop(); - QString binary() { return m_binary; } + TQString binary() { return m_binary; } bool binaryExists() { return m_binaryExists; } signals: @@ -82,7 +83,7 @@ class Locater : public QObject * Emitted whenever some new files are found. * @param items a list of the new filenames */ - void found(const QStringList& items); + void found(const TQStringList& items); /** * Emitted when the search is finished. @@ -95,8 +96,8 @@ class Locater : public QObject private: KProcIO m_process; - QString m_binary; - QString m_additionalArguments; + TQString m_binary; + TQString m_additionalArguments; bool m_binaryExists; }; diff --git a/src/pattern.cpp b/src/pattern.cpp index 14c74e3..52ade3c 100644 --- a/src/pattern.cpp +++ b/src/pattern.cpp @@ -28,7 +28,7 @@ #include "pattern.h" -LocateRegExp::LocateRegExp(const QString& pattern, bool ignoreCase) +LocateRegExp::LocateRegExp(const TQString& pattern, bool ignoreCase) { m_ignoreCase = ignoreCase; setPattern(pattern); @@ -45,7 +45,7 @@ LocateRegExp::~LocateRegExp() } -bool LocateRegExp::isMatching(const QString& file) const +bool LocateRegExp::isMatching(const TQString& file) const { bool matching = m_regExp.search(file) >= 0; if (m_negated) { @@ -57,7 +57,7 @@ bool LocateRegExp::isMatching(const QString& file) const int LocateRegExp::getMatchPosition() const { - // Why is QRegExp::pos() non const? + // Why is TQRegExp::pos() non const? return const_cast<LocateRegExp*>(this)->m_regExp.pos(); } @@ -68,7 +68,7 @@ int LocateRegExp::getMatchedLength() const } -void LocateRegExp::setPattern(const QString& pattern) +void LocateRegExp::setPattern(const TQString& pattern) { m_negated = false; m_pattern = pattern; @@ -76,11 +76,11 @@ void LocateRegExp::setPattern(const QString& pattern) m_negated = true; m_pattern = m_pattern.mid(1, m_pattern.length()-1); } - m_regExp = QRegExp(m_pattern, !m_ignoreCase); + m_regExp = TQRegExp(m_pattern, !m_ignoreCase); } -QString LocateRegExp::getPattern() const +TQString LocateRegExp::getPattern() const { return m_pattern; } @@ -91,10 +91,10 @@ LocateRegExpList::~LocateRegExpList() } -LocateRegExpList& LocateRegExpList::operator = (const QStringList& list) +LocateRegExpList& LocateRegExpList::operator = (const TQStringList& list) { clear(); - QStringList::ConstIterator it = list.begin(); + TQStringList::ConstIterator it = list.begin(); for (; it != list.end(); ++it) { append(LocateRegExp((*it), (*it) == (*it).lower())); } @@ -102,7 +102,7 @@ LocateRegExpList& LocateRegExpList::operator = (const QStringList& list) } -bool LocateRegExpList::isMatchingOne(const QString& file) const +bool LocateRegExpList::isMatchingOne(const TQString& file) const { bool matches = false; LocateRegExpList::ConstIterator it = begin(); @@ -113,7 +113,7 @@ bool LocateRegExpList::isMatchingOne(const QString& file) const } -bool LocateRegExpList::isMatchingAll(const QString& file) const +bool LocateRegExpList::isMatchingAll(const TQString& file) const { bool matches = true; LocateRegExpList::ConstIterator it = begin(); diff --git a/src/pattern.h b/src/pattern.h index 8e17a69..fb4651f 100644 --- a/src/pattern.h +++ b/src/pattern.h @@ -26,9 +26,9 @@ #ifndef PATTERN_H #define PATTERN_H -#include <qregexp.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqvaluelist.h> /** * Regular Expression adapted to the needs of kio-locate. @@ -41,7 +41,7 @@ public: * @param pattern the pattern to start with * @param ignoreCase specifies, if the search should be case sensitive */ - LocateRegExp(const QString& pattern, bool ignoreCase = false); + LocateRegExp(const TQString& pattern, bool ignoreCase = false); LocateRegExp(); virtual ~LocateRegExp(); @@ -50,7 +50,7 @@ public: * Determines whether a file name is matching this regular expression. * @param file the filename to match */ - virtual bool isMatching(const QString& file) const; + virtual bool isMatching(const TQString& file) const; /** * @return The position of the last match. @@ -67,25 +67,25 @@ public: * @param pattern the pattern to search for. It may be prepended by an * exclamation mark, to invert its meaning. */ - virtual void setPattern(const QString& pattern); + virtual void setPattern(const TQString& pattern); /** * Get the pattern. * @return search pattern */ - virtual QString getPattern() const; + virtual TQString getPattern() const; private: bool m_negated; bool m_ignoreCase; - QRegExp m_regExp; - QString m_pattern; + TQRegExp m_regExp; + TQString m_pattern; }; /** * List of regular expressions */ -class LocateRegExpList: public QValueList<LocateRegExp> +class LocateRegExpList: public TQValueList<LocateRegExp> { public: virtual ~LocateRegExpList(); @@ -94,21 +94,21 @@ class LocateRegExpList: public QValueList<LocateRegExp> * Converts a stringlist into a regexplist. * @param list the stringlist to convert */ - LocateRegExpList& operator = (const QStringList& list); + LocateRegExpList& operator = (const TQStringList& list); /** * Determines whether a file name is matching at least one regular * expression in the list. * @param file the filename to match */ - virtual bool isMatchingOne(const QString& file) const; + virtual bool isMatchingOne(const TQString& file) const; /** * Determines whether a file name is matching all regular expressions * in the list. * @param file the filename to match */ - virtual bool isMatchingAll(const QString& file) const; + virtual bool isMatchingAll(const TQString& file) const; }; #endif |