summaryrefslogtreecommitdiffstats
path: root/src/apt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/apt.cpp')
-rw-r--r--src/apt.cpp290
1 files changed, 145 insertions, 145 deletions
diff --git a/src/apt.cpp b/src/apt.cpp
index 9a68991..04d126a 100644
--- a/src/apt.cpp
+++ b/src/apt.cpp
@@ -16,7 +16,7 @@
#include "parsers/parsers.h"
-#include <qcstring.h>
+#include <tqcstring.h>
#include <kapplication.h>
#include <kinstance.h>
@@ -30,7 +30,7 @@
#include <kdebug.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <stdlib.h>
@@ -42,33 +42,33 @@ using namespace KIO;
* Common definitions of HTML fragments
*/
-static const QString
+static const TQString
html_preamble("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Strict//EN\"\n"
"\t\"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<html>\n");
-static const QString
+static const TQString
html_redirect(html_preamble +
- QString("<head>\n"
+ TQString("<head>\n"
"\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"
"\t<meta http-equiv=\"Refresh\" content=\"0 ; URL=%1\">\n"
"</head>\n"
"\n<body></body>\n"
"</html>"));
-static const QString
+static const TQString
html_head(html_preamble +
- QString("<head>\n"
+ TQString("<head>\n"
"\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n"
"\t<link rel=\"stylesheet\" href=\"file:%1\">\n"
"\t<title>%2</title>\n"
"</head>\n\n"
"<body>\n"));
-static QString close_html_head();
-static QString open_html_head(const QString& title, bool links, AptProtocol const& config)
+static TQString close_html_head();
+static TQString open_html_head(const TQString& title, bool links, AptProtocol const& config)
{
- static const QString
+ static const TQString
html_head_table(
"<table class=\"header\" style=\"background-image: url(file:%1);\"\n"
"\t\tcellspacing=\"0\" cellpadding=\"0\">\n"
@@ -76,18 +76,18 @@ static QString open_html_head(const QString& title, bool links, AptProtocol cons
"\t<td class=\"logo\" %2><img src=\"file:%3\" alt=\"%4\" style=\"border: 0px\" /></td>\n"
"\t<td class=\"header-title\">%4</td>\n");
- QString rowspan;
+ TQString rowspan;
if (links) rowspan = "rowspan=\"2\"";
- QString ret =
+ TQString ret =
html_head
- .arg(config.stylesheet())
- .arg(title)
+ .tqarg(config.stylesheet())
+ .tqarg(title)
+ html_head_table
- .arg(config.header_background())
- .arg(rowspan)
- .arg(config.logo())
- .arg(config.logo_alt())
- .arg(title);
+ .tqarg(config.header_background())
+ .tqarg(rowspan)
+ .tqarg(config.logo())
+ .tqarg(config.logo_alt())
+ .tqarg(title);
if (links)
{
@@ -103,12 +103,12 @@ static QString open_html_head(const QString& title, bool links, AptProtocol cons
return ret + "</tr>\n</table>\n\n";
}
}
-static QString add_html_head_link(const QString& url, const QString& name, const QString& long_desc)
+static TQString add_html_head_link(const TQString& url, const TQString& name, const TQString& long_desc)
{
- static const QString format("\t\t<td><a href=\"%1\" title=\"%2\">%3</a></td>\n");
- return format.arg(url).arg(long_desc).arg(name);
+ static const TQString format("\t\t<td><a href=\"%1\" title=\"%2\">%3</a></td>\n");
+ return format.tqarg(url).tqarg(long_desc).tqarg(name);
}
-static QString close_html_head()
+static TQString close_html_head()
{
return "\t</tr>\n"
"\t</table>\n"
@@ -117,23 +117,23 @@ static QString close_html_head()
"</table>";
}
-static const QString
+static const TQString
html_tail("<div class=\"footer\">%1</div>\n"
"</body>\n"
"</html>");
-QString AptProtocol::make_html_tail(const QString& note, bool with_form)
+TQString AptProtocol::make_html_tail(const TQString& note, bool with_form)
{
with_form = m_search && with_form;
- QString ret;
+ TQString ret;
if (with_form)
ret = "<hr>\n" + make_html_form();
if (!note.isEmpty())
- ret += html_tail.arg(note + ". " + i18n("Page generated by kio_apt."));
- else ret += html_tail.arg(i18n("Page generated by kio_apt."));
+ ret += html_tail.tqarg(note + ". " + i18n("Page generated by kio_apt."));
+ else ret += html_tail.tqarg(i18n("Page generated by kio_apt."));
return ret;
}
@@ -142,30 +142,30 @@ QString AptProtocol::make_html_tail(const QString& note, bool with_form)
* Search form
*/
-static const QString
+static const TQString
html_form_begin("\n<form action=\"apt:/\" method=\"GET\">\n"
"<table class=\"query\">\n");
-static const QString
+static const TQString
html_form_end("<tr>\n"
"\t<td class=\"button\" colspan=\"2\"><input type=\"submit\" value=\"%1\"></td>\n"
"</tr>\n"
"</table>\n"
"</form>\n");
-static const QString
+static const TQString
html_form_line("<tr>\n"
"\t<td><label for=\"%1\">%2</label></td>\n"
"\t<td><input type=\"text\" name=\"%3\" id=\"%4\"></td>\n"
"</tr>\n");
-static QString make_html_form_line(const QString& type, const QString& label)
-{ return html_form_line.arg(type).arg(label).arg(type).arg(type); }
+static TQString make_html_form_line(const TQString& type, const TQString& label)
+{ return html_form_line.tqarg(type).tqarg(label).tqarg(type).tqarg(type); }
-static QString make_extform_cmd(bool ext_form, const KURL& query)
+static TQString make_extform_cmd(bool ext_form, const KURL& query)
{
- QString cmd = ext_form ? "0" : "1";
- QString msg = ext_form ? i18n("Hide extended form") : i18n("Show extended form");
+ TQString cmd = ext_form ? "0" : "1";
+ TQString msg = ext_form ? i18n("Hide extended form") : i18n("Show extended form");
KURL url(query);
url.addQueryItem("extended_form", cmd);
@@ -178,7 +178,7 @@ static QString make_extform_cmd(bool ext_form, const KURL& query)
}
/** Prints the HTML code for the query form */
-QString AptProtocol::make_html_form() const
+TQString AptProtocol::make_html_form() const
{
bool can_fsearch = false;
bool ext_form = KGlobal::config() -> readBoolEntry("extended_form", true);
@@ -190,8 +190,8 @@ QString AptProtocol::make_html_form() const
if (m_adept_batch)
online = online_form && (!m_internal) && ext_form && m_adept_batch -> capabilities(PackageManager::ONLINE);
- QString ret;
- QTextOStream stream(&ret);
+ TQString ret;
+ TQTextOStream stream(&ret);
stream << make_extform_cmd(ext_form, m_query);
if (online)
@@ -206,7 +206,7 @@ QString AptProtocol::make_html_form() const
stream << make_html_form_line("fsearch", i18n("File search"));
stream << make_html_form_line("show", i18n("Package info"));
}
- stream << html_form_end.arg( i18n("Search") );
+ stream << html_form_end.tqarg( i18n("Search") );
if (online)
{
@@ -220,7 +220,7 @@ QString AptProtocol::make_html_form() const
/****************************************************************************************/
-AptProtocol::AptProtocol( const QCString &pool_socket, const QCString &app_socket )
+AptProtocol::AptProtocol( const TQCString &pool_socket, const TQCString &app_socket )
: SlaveBase( "kio_apt", pool_socket, app_socket ),
m_adept_batch(0), m_parser(0)
@@ -236,38 +236,38 @@ AptProtocol::AptProtocol( const QCString &pool_socket, const QCString &app_socke
m_logo_alt = KGlobal::config() -> readEntryUntranslated("alt_tag", i18n("KDE on Debian") );
- connect(&m_process, SIGNAL(token(const QString&, const QString&)),
- this, SLOT(token_dispatch(const QString&, const QString&)));
+ connect(&m_process, TQT_SIGNAL(token(const TQString&, const TQString&)),
+ this, TQT_SLOT(token_dispatch(const TQString&, const TQString&)));
m_adept_batch = new Dpkg(this);
if (m_adept_batch)
{
- connect(m_adept_batch, SIGNAL(token(const QString&, const QString&)),
- this, SLOT(token_dispatch(const QString&, const QString&)));
+ connect(m_adept_batch, TQT_SIGNAL(token(const TQString&, const TQString&)),
+ this, TQT_SLOT(token_dispatch(const TQString&, const TQString&)));
}
}
AptProtocol::~AptProtocol() {}
-QString AptProtocol::stylesheet() const { return m_stylesheet; }
-QString AptProtocol::logo() const { return m_logo; }
-QString AptProtocol::logo_alt() const { return m_logo_alt; }
-QString AptProtocol::header_background() const { return m_header_background; }
+TQString AptProtocol::stylesheet() const { return m_stylesheet; }
+TQString AptProtocol::logo() const { return m_logo; }
+TQString AptProtocol::logo_alt() const { return m_logo_alt; }
+TQString AptProtocol::header_background() const { return m_header_background; }
-void AptProtocol::token_dispatch(const QString& name, const QString& val)
+void AptProtocol::token_dispatch(const TQString& name, const TQString& val)
{
if (m_parser.get())
(*m_parser)(this, name, val);
}
-void AptProtocol::data(const QCString& string)
+void AptProtocol::data(const TQCString& string)
{
using namespace Parsers;
(*this) << string;
}
-void AptProtocol::data(const QString& string)
+void AptProtocol::data(const TQString& string)
{
using namespace Parsers;
(*this) << string;
@@ -279,7 +279,7 @@ void AptProtocol::data(const char* string)
(*this) << string;
}
-void AptProtocol::data(const QByteArray& array)
+void AptProtocol::data(const TQByteArray& array)
{ SlaveBase::data(array); }
void AptProtocol::mimetype( const KURL & /*url*/ )
@@ -288,12 +288,12 @@ void AptProtocol::mimetype( const KURL & /*url*/ )
finished();
}
-bool AptProtocol::check_validpackage(const QString& query)
+bool AptProtocol::check_validpackage(const TQString& query)
{
- static QRegExp rx_pkgname(rxs_pkgname);
+ static TQRegExp rx_pkgname(rxs_pkgname);
if (!rx_pkgname.exactMatch(query))
{
- error( ERR_SLAVE_DEFINED, i18n("\"%1\" is not a valid package name").arg(query) );
+ error( ERR_SLAVE_DEFINED, i18n("\"%1\" is not a valid package name").tqarg(query) );
return false;
}
return true;
@@ -304,10 +304,10 @@ bool AptProtocol::check_validpackage(const QString& query)
* Main entry point
*/
-static QString read_option(QMap<QString, QString>& map, const QString& name, const QString& def)
+static TQString read_option(TQMap<TQString, TQString>& map, const TQString& name, const TQString& def)
{
- if (!map.contains(name)) return def;
- QString ret = map[name];
+ if (!map.tqcontains(name)) return def;
+ TQString ret = map[name];
map.remove(name);
return ret;
}
@@ -324,23 +324,23 @@ void AptProtocol::get ( const KURL& url )
apt:/
*/
- typedef void (AptProtocol::*Command)(const QString&, const QueryOptions&);
- static const QString commands[] =
+ typedef void (AptProtocol::*Command)(const TQString&, const QueryOptions&);
+ static const TQString commands[] =
{ "search", "show", "policy",
"fsearch", "list", "online",
- "get", QString::null };
+ "get", TQString() };
static const Command methods[] =
{ &AptProtocol::search, &AptProtocol::show, &AptProtocol::policy,
&AptProtocol::searchfile, &AptProtocol::listfiles, &AptProtocol::online,
&AptProtocol::adept_batch };
- QString command, query;
+ TQString command, query;
Command method = 0;
QueryOptions options = url.queryItems(KURL::CaseInsensitiveKeys);
// canonize the part before ? : remove the first /
- QString path = url.path();
- QString host = url.host();
+ TQString path = url.path();
+ TQString host = url.host();
if ( path.isEmpty() && !host.isEmpty() )
{
@@ -352,7 +352,7 @@ void AptProtocol::get ( const KURL& url )
for (int cmd_idx = 0; !commands[cmd_idx].isNull(); ++cmd_idx)
{
- const QString cmd_it = commands[cmd_idx];
+ const TQString cmd_it = commands[cmd_idx];
// Look if the command is in the path part
if (command.isEmpty() && cmd_it == path)
@@ -360,7 +360,7 @@ void AptProtocol::get ( const KURL& url )
command = cmd_it;
method = methods[cmd_idx];
}
- if (options.contains(cmd_it))
+ if (options.tqcontains(cmd_it))
{
if (options[cmd_it].isEmpty() && !options[cmd_it].isNull())
@@ -393,7 +393,7 @@ void AptProtocol::get ( const KURL& url )
// Interpret the ioslave config options
// and remove them from the options map
- QString opt = read_option(options, "extended_form", QString::null);
+ TQString opt = read_option(options, "extended_form", TQString());
if (!opt.isNull())
{
bool ext_form = (opt != "0");
@@ -442,7 +442,7 @@ void AptProtocol::get ( const KURL& url )
if (m_query != url)
{
redirection(m_query);
- data(QByteArray());
+ data(TQByteArray());
finished();
return;
}
@@ -462,14 +462,14 @@ void AptProtocol::help()
{
mimeType("text/html");
- QString buffer;
- QTextOStream stream(&buffer);
+ TQString buffer;
+ TQTextOStream stream(&buffer);
stream
<< open_html_head(i18n("Search Form"), false, *this)
<< make_html_form()
- << make_html_tail(QString::null, false);
+ << make_html_tail(TQString(), false);
data(buffer);
- data(QByteArray());
+ data(TQByteArray());
finished();
}
@@ -483,23 +483,23 @@ void AptProtocol::help()
* apt-cache search
*/
-void AptProtocol::search( const QString& query, const QueryOptions& /*options*/ )
+void AptProtocol::search( const TQString& query, const QueryOptions& /*options*/ )
{
mimeType("text/html");
- data(open_html_head(i18n("Package search result for \"%1\"").arg(query), false, *this));
+ data(open_html_head(i18n("Package search result for \"%1\"").tqarg(query), false, *this));
m_parser.reset(new Parsers::Search);
(*m_parser)(this, "begin", query);
if (!m_process.search( query ))
{
- error(ERR_SLAVE_DEFINED, i18n("Error launching the search").arg(query));
+ error(ERR_SLAVE_DEFINED, i18n("Error launching the search").tqarg(query));
return;
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
- data(make_html_tail( i18n("%1 results").arg(m_parser -> result_count())) );
- data(QByteArray());
+ data(make_html_tail( i18n("%1 results").tqarg(m_parser -> result_count())) );
+ data(TQByteArray());
finished();
}
@@ -512,10 +512,10 @@ void AptProtocol::search( const QString& query, const QueryOptions& /*options*/
* apt-cache show
*/
-static QString filelist_cmd(bool show_filelist, const KURL& query)
+static TQString filelist_cmd(bool show_filelist, const KURL& query)
{
- QString value = show_filelist ? "0" : "1";
- QString msg = show_filelist ? i18n("Hide file list") : i18n("Show file list");
+ TQString value = show_filelist ? "0" : "1";
+ TQString msg = show_filelist ? i18n("Hide file list") : i18n("Show file list");
KURL url(query);
url.addQueryItem("show_filelist", value);
@@ -529,11 +529,11 @@ static QString filelist_cmd(bool show_filelist, const KURL& query)
"</div>";
}
-void AptProtocol::show(const QString& package, const QueryOptions& options)
+void AptProtocol::show(const TQString& package, const QueryOptions& options)
{
if (!check_validpackage(package)) return;
- if (options.contains("show_filelist"))
+ if (options.tqcontains("show_filelist"))
{
KGlobal::config() -> writeEntry("show_filelist", options["show_filelist"] != "0");
KGlobal::config() -> sync();
@@ -541,7 +541,7 @@ void AptProtocol::show(const QString& package, const QueryOptions& options)
mimeType("text/html");
- QString installed_version;
+ TQString installed_version;
/** First, we parse policy
* We use here the fact that HTML is generated
@@ -550,53 +550,53 @@ void AptProtocol::show(const QString& package, const QueryOptions& options)
* is installed or not */
Parsers::Policy* policy = new Parsers::Policy(package, m_act);
m_parser.reset(policy);
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
{
if (!m_process.policy( package ))
{
- error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").arg(package));
+ error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").tqarg(package));
return;
}
installed_version = policy->getInstalled();
bool can_list = can_listfiles(!installed_version.isEmpty());
- QString buffer;
- QTextOStream s(&buffer);
+ TQString buffer;
+ TQTextOStream s(&buffer);
if (can_list)
{
KURL url = buildURL("list", package);
- s << open_html_head(i18n("Package description for \"%1\"").arg(package), true, *this)
+ s << open_html_head(i18n("Package description for \"%1\"").tqarg(package), true, *this)
<< add_html_head_link(url.htmlURL(), i18n("List package files"), "")
<< close_html_head();
}
else
{
- s << open_html_head(i18n("Package description for \"%1\"").arg(package), false, *this);
+ s << open_html_head(i18n("Package description for \"%1\"").tqarg(package), false, *this);
}
data(buffer);
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
/** Add package description section */
m_parser.reset(new Parsers::Show(package, installed_version, m_act));
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
{
if (!m_process.show(package))
{
- error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache show %1\"").arg(package));
+ error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache show %1\"").tqarg(package));
return;
}
if (!m_parser -> result_count())
{
- data("<div class=\"error\">" + i18n("No package found named \"%1\"").arg(package) + "</div>\n");
+ data("<div class=\"error\">" + i18n("No package found named \"%1\"").tqarg(package) + "</div>\n");
data(make_html_tail());
- data(QByteArray());
+ data(TQByteArray());
finished();
return;
}
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
@@ -612,13 +612,13 @@ void AptProtocol::show(const QString& package, const QueryOptions& options)
+ "<div class=\"filelist\">\n");
m_parser.reset(new Parsers::List(!m_internal));
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
if (!m_adept_batch -> list(package))
{
- error(ERR_SLAVE_DEFINED, i18n("Error listing files of %1").arg(package));
+ error(ERR_SLAVE_DEFINED, i18n("Error listing files of %1").tqarg(package));
return;
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
data("\n</div>\n");
}
@@ -637,7 +637,7 @@ void AptProtocol::show(const QString& package, const QueryOptions& options)
data(make_html_tail());
- data(QByteArray());
+ data(TQByteArray());
finished();
}
@@ -648,25 +648,25 @@ void AptProtocol::show(const QString& package, const QueryOptions& options)
* apt-cache policy
*/
-void AptProtocol::policy( const QString& query, const QueryOptions& /*options*/ )
+void AptProtocol::policy( const TQString& query, const QueryOptions& /*options*/ )
{
if (!check_validpackage(query)) return;
mimeType("text/html");
- data( open_html_head(i18n("Apt policy for \"%1\"").arg(query), false, *this) );
+ data( open_html_head(i18n("Apt policy for \"%1\"").tqarg(query), false, *this) );
m_parser.reset(new Parsers::Policy(query, m_act));
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
if (!m_process.policy( query ))
{
- error(ERR_SLAVE_DEFINED, i18n("Can't launch the policy for %1").arg(query));
+ error(ERR_SLAVE_DEFINED, i18n("Can't launch the policy for %1").tqarg(query));
return;
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
data(make_html_tail());
- data(QByteArray());
+ data(TQByteArray());
finished();
}
@@ -676,7 +676,7 @@ void AptProtocol::policy( const QString& query, const QueryOptions& /*options*/
* Search the package which contains a specific file
*/
-static const QString
+static const TQString
html_dpkgs_begin("\n\n<table>\n"),
html_dpkgs_end("\n\n</table>\n");
@@ -688,24 +688,24 @@ bool AptProtocol::can_searchfile(bool is_installed) const
if (!caps) return false;
return is_installed || !(caps & PackageManager::INSTALLED_ONLY);
}
-void AptProtocol::searchfile(const QString& query, const QueryOptions& /*options*/)
+void AptProtocol::searchfile(const TQString& query, const QueryOptions& /*options*/)
{
if (!can_searchfile(true)) return;
mimeType("text/html");
- data( open_html_head(i18n("File search for \"%1\"").arg(query), false, *this) + html_dpkgs_begin );
+ data( open_html_head(i18n("File search for \"%1\"").tqarg(query), false, *this) + html_dpkgs_begin );
m_parser.reset(new Parsers::FileSearch);
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
if (!m_adept_batch -> search( query ))
{
- error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").arg(query));
+ error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").tqarg(query));
return;
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
- data( html_dpkgs_end + make_html_tail(i18n("%1 files found").arg(m_parser -> result_count())) );
- data(QByteArray());
+ data( html_dpkgs_end + make_html_tail(i18n("%1 files found").tqarg(m_parser -> result_count())) );
+ data(TQByteArray());
finished();
}
@@ -724,7 +724,7 @@ bool AptProtocol::can_listfiles(bool is_installed) const
return is_installed || !(caps & PackageManager::INSTALLED_ONLY);
}
-void AptProtocol::listfiles(const QString& query, const QueryOptions& /*options*/)
+void AptProtocol::listfiles(const TQString& query, const QueryOptions& /*options*/)
{
if (!can_listfiles(true)) return;
if (!check_validpackage(query)) return;
@@ -733,26 +733,26 @@ void AptProtocol::listfiles(const QString& query, const QueryOptions& /*options*
KURL ret_url = buildURL("show", query);
- QString buffer;
- QTextOStream stream(&buffer);
+ TQString buffer;
+ TQTextOStream stream(&buffer);
stream
- << open_html_head(i18n("Files in \"%1\"").arg(query), true, *this)
+ << open_html_head(i18n("Files in \"%1\"").tqarg(query), true, *this)
<< add_html_head_link(ret_url.htmlURL(), i18n("Show package info"), "")
<< close_html_head()
<< endl;
data(buffer);
m_parser.reset(new Parsers::List(!m_internal));
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
if (!m_adept_batch -> list( query ))
{
- error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").arg(query));
+ error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").tqarg(query));
return;
}
- (*m_parser)(this, "end", QString::null);
+ (*m_parser)(this, "end", TQString());
data(make_html_tail());
- data(QByteArray());
+ data(TQByteArray());
finished();
}
@@ -770,9 +770,9 @@ void AptProtocol::listfiles(const QString& query, const QueryOptions& /*options*
// return false;
//}
-void AptProtocol::online(const QString& query, const QueryOptions& options)
+void AptProtocol::online(const TQString& query, const QueryOptions& options)
{
- QString url = m_adept_batch -> getOnlineURL(query, options);
+ TQString url = m_adept_batch -> getOnlineURL(query, options);
redirection(url);
finished();
return;
@@ -781,15 +781,15 @@ void AptProtocol::online(const QString& query, const QueryOptions& options)
/***********************************************************************************
* Send commands for adept_batch
*/
-void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
+void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options)
{
p=NULL;
- QString command;
- QString url;
- QStringList plist;
- QStringList puninst;
- QStringList pinst;
+ TQString command;
+ TQString url;
+ TQStringList plist;
+ TQStringList puninst;
+ TQStringList pinst;
int pcount;
int ip;
@@ -805,29 +805,29 @@ void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
return;
}
- if (!options.contains("package"))
+ if (!options.tqcontains("package"))
{
error(ERR_SLAVE_DEFINED, i18n("No package specified"));
return;
}
- plist = QStringList::split(", ", options["package"], false);
+ plist = TQStringList::split(", ", options["package"], false);
pcount = plist.count();
command += plist.join(" ");
if (pcount == 1)
{
if (query == "install")
- ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to install %1 ?").arg(plist[0]), i18n("Package Installation"));
+ ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to install %1 ?").tqarg(plist[0]), i18n("Package Installation"));
else
- ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to remove %1 ?").arg(plist[0]), i18n("Package Removal"));
+ ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to remove %1 ?").tqarg(plist[0]), i18n("Package Removal"));
}
else
{
if (query == "install")
- ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to install the following %1 packages ?\n%2").arg(pcount).arg(options["package"]));
+ ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to install the following %1 packages ?\n%2").tqarg(pcount).tqarg(options["package"]));
else
- ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to remove the following %1 packages ?\n").arg(pcount).arg(options["package"]));
+ ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to remove the following %1 packages ?\n").tqarg(pcount).tqarg(options["package"]));
}
kdDebug(DEBUG_ZONE) << command << endl;
@@ -841,15 +841,15 @@ void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
for(int i = 0; i != pcount; ++i)
{
- QString installed_version;
+ TQString installed_version;
Parsers::Policy* policy = new Parsers::Policy(plist[i], m_act);
m_parser.reset(policy);
- (*m_parser)(this, "begin", QString::null);
+ (*m_parser)(this, "begin", TQString());
{
if (!m_process.policy( plist[i] ))
{
- error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").arg(plist[i]));
+ error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").tqarg(plist[i]));
return;
}
@@ -865,7 +865,7 @@ void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
}
}
- if (options.contains("weblinkinstall"))
+ if (options.tqcontains("weblinkinstall"))
{
if (puninst.count() == 0)
{
@@ -873,8 +873,8 @@ void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
}
else
{
- QString toto = puninst.join(" ");
- messageBox(Information,i18n("There was a problem installing %1.").arg(toto));
+ TQString toto = puninst.join(" ");
+ messageBox(Information,i18n("There was a problem installing %1.").tqarg(toto));
}
return;
}
@@ -884,7 +884,7 @@ void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
// Outside of a weblink, only one package can be installed at time
url += plist[0];
redirection(url);
- data(QByteArray());
+ data(TQByteArray());
finished();
return;
}
@@ -895,7 +895,7 @@ void AptProtocol::adept_batch(const QString& query, const QueryOptions& options)
}
}
-KURL AptProtocol::buildURL( const QString & command, const QString & query ) const
+KURL AptProtocol::buildURL( const TQString & command, const TQString & query ) const
{
KURL url;
url.setProtocol("apt");