diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 20:34:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 20:34:15 +0000 |
commit | 1c1403293485f35fd53db45aaa77a01cdd9627e7 (patch) | |
tree | 38559cd68cd4f63023fb5f6375def9db3b8b491e /plugins/search/searchenginelist.cpp | |
parent | 894f94545727610df22c4f73911d62d58266f695 (diff) | |
download | ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.tar.gz ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.zip |
TQt4 port ktorrent
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'plugins/search/searchenginelist.cpp')
-rw-r--r-- | plugins/search/searchenginelist.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/plugins/search/searchenginelist.cpp b/plugins/search/searchenginelist.cpp index cf7a11b..9e22990 100644 --- a/plugins/search/searchenginelist.cpp +++ b/plugins/search/searchenginelist.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstringlist.h> #include "searchenginelist.h" using namespace bt; @@ -34,36 +34,36 @@ namespace kt SearchEngineList::~SearchEngineList() {} - void SearchEngineList::save(const QString& file) + void SearchEngineList::save(const TQString& file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << "# PLEASE DO NOT MODIFY THIS FILE. Use KTorrent configuration dialog for adding new search engines." << ::endl; out << "# SEARCH ENGINES list" << ::endl; - QValueList<SearchEngine>::iterator i = m_search_engines.begin(); + TQValueList<SearchEngine>::iterator i = m_search_engines.begin(); while (i != m_search_engines.end()) { SearchEngine & e = *i; // replace spaces by %20 - QString name = e.name; - name = name.replace(" ","%20"); - QString u = e.url.prettyURL(); - u = u.replace(" ","%20"); + TQString name = e.name; + name = name.tqreplace(" ","%20"); + TQString u = e.url.prettyURL(); + u = u.tqreplace(" ","%20"); out << name << " " << u << ::endl; i++; } } - void SearchEngineList::load(const QString& file) + void SearchEngineList::load(const TQString& file) { m_search_engines.clear(); - QFile fptr(file); + TQFile fptr(file); if(!fptr.exists()) makeDefaultFile(file); @@ -71,21 +71,21 @@ namespace kt if (!fptr.open(IO_ReadOnly)) return; - QTextStream in(&fptr); + TQTextStream in(&fptr); int id = 0; while (!in.atEnd()) { - QString line = in.readLine(); + TQString line = in.readLine(); if(line.startsWith("#") || line.startsWith(" ") || line.isEmpty() ) continue; - QStringList tokens = QStringList::split(" ", line); + TQStringList tokens = TQStringList::split(" ", line); SearchEngine se; se.name = tokens[0]; - se.name = se.name.replace("%20"," "); + se.name = se.name.tqreplace("%20"," "); se.url = KURL::fromPathOrURL(tokens[1]); for(Uint32 i=2; i<tokens.count(); ++i) @@ -95,13 +95,13 @@ namespace kt } } - void SearchEngineList::makeDefaultFile(const QString& file) + void SearchEngineList::makeDefaultFile(const TQString& file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << "# PLEASE DO NOT MODIFY THIS FILE. Use KTorrent configuration dialog for adding new search engines." << ::endl; out << "# SEARCH ENGINES list" << ::endl; out << "KTorrents http://www.ktorrents.com/search.php?lg=0&sourceid=ktorrent&q=FOOBAR&f=0" << ::endl; @@ -123,10 +123,10 @@ namespace kt return m_search_engines[engine].url; } - QString SearchEngineList::getEngineName(bt::Uint32 engine) const + TQString SearchEngineList::getEngineName(bt::Uint32 engine) const { if (engine >= m_search_engines.count()) - return QString::null; + return TQString(); else return m_search_engines[engine].name; } |