Rename a number of old tq methods that are no longer tq specific

pull/1/head
Timothy Pearson 13 years ago
parent 0df776a58f
commit 9a210ba3a6

@ -80,14 +80,14 @@ static TQString open_html_head(const TQString& title, bool links, AptProtocol co
if (links) rowspan = "rowspan=\"2\""; if (links) rowspan = "rowspan=\"2\"";
TQString ret = TQString ret =
html_head html_head
.tqarg(config.stylesheet()) .arg(config.stylesheet())
.tqarg(title) .arg(title)
+ html_head_table + html_head_table
.tqarg(config.header_background()) .arg(config.header_background())
.tqarg(rowspan) .arg(rowspan)
.tqarg(config.logo()) .arg(config.logo())
.tqarg(config.logo_alt()) .arg(config.logo_alt())
.tqarg(title); .arg(title);
if (links) if (links)
{ {
@ -106,7 +106,7 @@ static TQString open_html_head(const TQString& title, bool links, AptProtocol co
static TQString add_html_head_link(const TQString& url, const TQString& name, const TQString& long_desc) static TQString add_html_head_link(const TQString& url, const TQString& name, const TQString& long_desc)
{ {
static const TQString format("\t\t<td><a href=\"%1\" title=\"%2\">%3</a></td>\n"); 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); return format.arg(url).arg(long_desc).arg(name);
} }
static TQString close_html_head() static TQString close_html_head()
{ {
@ -132,8 +132,8 @@ TQString AptProtocol::make_html_tail(const TQString& note, bool with_form)
ret = "<hr>\n" + make_html_form(); ret = "<hr>\n" + make_html_form();
if (!note.isEmpty()) if (!note.isEmpty())
ret += html_tail.tqarg(note + ". " + i18n("Page generated by kio_apt.")); ret += html_tail.arg(note + ". " + i18n("Page generated by kio_apt."));
else ret += html_tail.tqarg(i18n("Page generated by kio_apt.")); else ret += html_tail.arg(i18n("Page generated by kio_apt."));
return ret; return ret;
} }
@ -159,7 +159,7 @@ static const TQString
"</tr>\n"); "</tr>\n");
static TQString make_html_form_line(const TQString& type, const TQString& label) static TQString make_html_form_line(const TQString& type, const TQString& label)
{ return html_form_line.tqarg(type).tqarg(label).tqarg(type).tqarg(type); } { return html_form_line.arg(type).arg(label).arg(type).arg(type); }
static TQString make_extform_cmd(bool ext_form, const KURL& query) static TQString make_extform_cmd(bool ext_form, const KURL& query)
@ -206,7 +206,7 @@ TQString AptProtocol::make_html_form() const
stream << make_html_form_line("fsearch", i18n("File search")); stream << make_html_form_line("fsearch", i18n("File search"));
stream << make_html_form_line("show", i18n("Package info")); stream << make_html_form_line("show", i18n("Package info"));
} }
stream << html_form_end.tqarg( i18n("Search") ); stream << html_form_end.arg( i18n("Search") );
if (online) if (online)
{ {
@ -293,7 +293,7 @@ bool AptProtocol::check_validpackage(const TQString& query)
static TQRegExp rx_pkgname(rxs_pkgname); static TQRegExp rx_pkgname(rxs_pkgname);
if (!rx_pkgname.exactMatch(query)) if (!rx_pkgname.exactMatch(query))
{ {
error( ERR_SLAVE_DEFINED, i18n("\"%1\" is not a valid package name").tqarg(query) ); error( ERR_SLAVE_DEFINED, i18n("\"%1\" is not a valid package name").arg(query) );
return false; return false;
} }
return true; return true;
@ -487,18 +487,18 @@ void AptProtocol::search( const TQString& query, const QueryOptions& /*options*/
{ {
mimeType("text/html"); mimeType("text/html");
data(open_html_head(i18n("Package search result for \"%1\"").tqarg(query), false, *this)); data(open_html_head(i18n("Package search result for \"%1\"").arg(query), false, *this));
m_parser.reset(new Parsers::Search); m_parser.reset(new Parsers::Search);
(*m_parser)(this, "begin", query); (*m_parser)(this, "begin", query);
if (!m_process.search( query )) if (!m_process.search( query ))
{ {
error(ERR_SLAVE_DEFINED, i18n("Error launching the search").tqarg(query)); error(ERR_SLAVE_DEFINED, i18n("Error launching the search").arg(query));
return; return;
} }
(*m_parser)(this, "end", TQString()); (*m_parser)(this, "end", TQString());
data(make_html_tail( i18n("%1 results").tqarg(m_parser -> result_count())) ); data(make_html_tail( i18n("%1 results").arg(m_parser -> result_count())) );
data(TQByteArray()); data(TQByteArray());
finished(); finished();
} }
@ -554,7 +554,7 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
{ {
if (!m_process.policy( package )) if (!m_process.policy( package ))
{ {
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").tqarg(package)); error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").arg(package));
return; return;
} }
@ -565,13 +565,13 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
if (can_list) if (can_list)
{ {
KURL url = buildURL("list", package); KURL url = buildURL("list", package);
s << open_html_head(i18n("Package description for \"%1\"").tqarg(package), true, *this) s << open_html_head(i18n("Package description for \"%1\"").arg(package), true, *this)
<< add_html_head_link(url.htmlURL(), i18n("List package files"), "") << add_html_head_link(url.htmlURL(), i18n("List package files"), "")
<< close_html_head(); << close_html_head();
} }
else else
{ {
s << open_html_head(i18n("Package description for \"%1\"").tqarg(package), false, *this); s << open_html_head(i18n("Package description for \"%1\"").arg(package), false, *this);
} }
data(buffer); data(buffer);
} }
@ -584,12 +584,12 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
{ {
if (!m_process.show(package)) if (!m_process.show(package))
{ {
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache show %1\"").tqarg(package)); error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache show %1\"").arg(package));
return; return;
} }
if (!m_parser -> result_count()) if (!m_parser -> result_count())
{ {
data("<div class=\"error\">" + i18n("No package found named \"%1\"").tqarg(package) + "</div>\n"); data("<div class=\"error\">" + i18n("No package found named \"%1\"").arg(package) + "</div>\n");
data(make_html_tail()); data(make_html_tail());
data(TQByteArray()); data(TQByteArray());
finished(); finished();
@ -615,7 +615,7 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
(*m_parser)(this, "begin", TQString()); (*m_parser)(this, "begin", TQString());
if (!m_adept_batch -> list(package)) if (!m_adept_batch -> list(package))
{ {
error(ERR_SLAVE_DEFINED, i18n("Error listing files of %1").tqarg(package)); error(ERR_SLAVE_DEFINED, i18n("Error listing files of %1").arg(package));
return; return;
} }
(*m_parser)(this, "end", TQString()); (*m_parser)(this, "end", TQString());
@ -654,13 +654,13 @@ void AptProtocol::policy( const TQString& query, const QueryOptions& /*options*/
mimeType("text/html"); mimeType("text/html");
data( open_html_head(i18n("Apt policy for \"%1\"").tqarg(query), false, *this) ); data( open_html_head(i18n("Apt policy for \"%1\"").arg(query), false, *this) );
m_parser.reset(new Parsers::Policy(query, m_act)); m_parser.reset(new Parsers::Policy(query, m_act));
(*m_parser)(this, "begin", TQString()); (*m_parser)(this, "begin", TQString());
if (!m_process.policy( query )) if (!m_process.policy( query ))
{ {
error(ERR_SLAVE_DEFINED, i18n("Can't launch the policy for %1").tqarg(query)); error(ERR_SLAVE_DEFINED, i18n("Can't launch the policy for %1").arg(query));
return; return;
} }
(*m_parser)(this, "end", TQString()); (*m_parser)(this, "end", TQString());
@ -693,18 +693,18 @@ void AptProtocol::searchfile(const TQString& query, const QueryOptions& /*option
if (!can_searchfile(true)) return; if (!can_searchfile(true)) return;
mimeType("text/html"); mimeType("text/html");
data( open_html_head(i18n("File search for \"%1\"").tqarg(query), false, *this) + html_dpkgs_begin ); data( open_html_head(i18n("File search for \"%1\"").arg(query), false, *this) + html_dpkgs_begin );
m_parser.reset(new Parsers::FileSearch); m_parser.reset(new Parsers::FileSearch);
(*m_parser)(this, "begin", TQString()); (*m_parser)(this, "begin", TQString());
if (!m_adept_batch -> search( query )) if (!m_adept_batch -> search( query ))
{ {
error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").tqarg(query)); error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").arg(query));
return; return;
} }
(*m_parser)(this, "end", TQString()); (*m_parser)(this, "end", TQString());
data( html_dpkgs_end + make_html_tail(i18n("%1 files found").tqarg(m_parser -> result_count())) ); data( html_dpkgs_end + make_html_tail(i18n("%1 files found").arg(m_parser -> result_count())) );
data(TQByteArray()); data(TQByteArray());
finished(); finished();
} }
@ -736,7 +736,7 @@ void AptProtocol::listfiles(const TQString& query, const QueryOptions& /*options
TQString buffer; TQString buffer;
TQTextOStream stream(&buffer); TQTextOStream stream(&buffer);
stream stream
<< open_html_head(i18n("Files in \"%1\"").tqarg(query), true, *this) << open_html_head(i18n("Files in \"%1\"").arg(query), true, *this)
<< add_html_head_link(ret_url.htmlURL(), i18n("Show package info"), "") << add_html_head_link(ret_url.htmlURL(), i18n("Show package info"), "")
<< close_html_head() << close_html_head()
<< endl; << endl;
@ -746,7 +746,7 @@ void AptProtocol::listfiles(const TQString& query, const QueryOptions& /*options
(*m_parser)(this, "begin", TQString()); (*m_parser)(this, "begin", TQString());
if (!m_adept_batch -> list( query )) if (!m_adept_batch -> list( query ))
{ {
error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").tqarg(query)); error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").arg(query));
return; return;
} }
(*m_parser)(this, "end", TQString()); (*m_parser)(this, "end", TQString());
@ -818,16 +818,16 @@ void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options
if (pcount == 1) if (pcount == 1)
{ {
if (query == "install") if (query == "install")
ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to install %1 ?").tqarg(plist[0]), i18n("Package Installation")); ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to install %1 ?").arg(plist[0]), i18n("Package Installation"));
else else
ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to remove %1 ?").tqarg(plist[0]), i18n("Package Removal")); ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to remove %1 ?").arg(plist[0]), i18n("Package Removal"));
} }
else else
{ {
if (query == "install") if (query == "install")
ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to install the following %1 packages ?\n%2").tqarg(pcount).tqarg(options["package"])); ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to install the following %1 packages ?\n%2").arg(pcount).arg(options["package"]));
else else
ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to remove the following %1 packages ?\n").tqarg(pcount).tqarg(options["package"])); ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to remove the following %1 packages ?\n").arg(pcount).arg(options["package"]));
} }
kdDebug(DEBUG_ZONE) << command << endl; kdDebug(DEBUG_ZONE) << command << endl;
@ -849,7 +849,7 @@ void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options
{ {
if (!m_process.policy( plist[i] )) if (!m_process.policy( plist[i] ))
{ {
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").tqarg(plist[i])); error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").arg(plist[i]));
return; return;
} }
@ -874,7 +874,7 @@ void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options
else else
{ {
TQString toto = puninst.join(" "); TQString toto = puninst.join(" ");
messageBox(Information,i18n("There was a problem installing %1.").tqarg(toto)); messageBox(Information,i18n("There was a problem installing %1.").arg(toto));
} }
return; return;
} }

@ -37,7 +37,7 @@ AptCache::~AptCache() {}
static TQStringList received(TQString& buffer, char* input, int input_len) static TQStringList received(TQString& buffer, char* input, int input_len)
{ {
buffer += TQString::tqfromLatin1(input, input_len); buffer += TQString::fromLatin1(input, input_len);
TQStringList ret = TQStringList::split('\n', buffer, true); TQStringList ret = TQStringList::split('\n', buffer, true);
if (!buffer.endsWith("\n")) if (!buffer.endsWith("\n"))
{ {
@ -255,19 +255,19 @@ void AptCache::receivePolicy(const TQStringList& lines)
TQString data( (*l).stripWhiteSpace() ); TQString data( (*l).stripWhiteSpace() );
if (rx_pkgname.exactMatch(*l)) if (rx_pkgname.exactMatch(*l))
emit token("package", rx_pkgname.cap(1)); emit token("package", rx_pkgname.cap(1));
else if (data.tqstartsWith("Installed:", false)) else if (data.startsWith("Installed:", false))
{ {
data = data.right(data.length() - 11); data = data.right(data.length() - 11);
emit token("installed", data); emit token("installed", data);
m_installed = data; m_installed = data;
} }
else if (data.tqstartsWith("Candidate:", false)) else if (data.startsWith("Candidate:", false))
{ {
data = data.right(data.length() - 11); data = data.right(data.length() - 11);
emit token("candidate", data); emit token("candidate", data);
m_candidate = data; m_candidate = data;
} }
else if (data.tqstartsWith("Version table:", false)) else if (data.startsWith("Version table:", false))
emit token("version_table", TQString()); emit token("version_table", TQString());
else if (rx_location.search(data) > -1) else if (rx_location.search(data) > -1)
emit token("location", data); emit token("location", data);

@ -86,7 +86,7 @@ void Dpkg::receiveSearch( const TQStringList & line )
if ((*i).isEmpty()) continue; if ((*i).isEmpty()) continue;
if (rx_notfound.exactMatch(*i)) if (rx_notfound.exactMatch(*i))
{ {
emit token("error", i18n("%1 not found").tqarg(rx_notfound.cap(1))); emit token("error", i18n("%1 not found").arg(rx_notfound.cap(1)));
continue; continue;
} }
@ -123,7 +123,7 @@ void Dpkg::receiveList( const TQStringList & line )
for (TQStringList::ConstIterator i = line.begin(); i != line.end(); ++i) for (TQStringList::ConstIterator i = line.begin(); i != line.end(); ++i)
{ {
if (rx_notfound.search(*i) > -1) if (rx_notfound.search(*i) > -1)
emit token("error", i18n("Package %1 is not installed").tqarg(rx_notfound.cap(1))); emit token("error", i18n("Package %1 is not installed").arg(rx_notfound.cap(1)));
else if ((*i).startsWith("/")) else if ((*i).startsWith("/"))
emit token("file", *i); emit token("file", *i);
} }
@ -158,16 +158,16 @@ static const TQString html_form_combo("<select name=\"%1\" id=\"%2\">");
static TQString make_form_text(const TQString& type, const TQString& label) static TQString make_form_text(const TQString& type, const TQString& label)
{ {
return return
html_form_line_begin.tqarg(type).tqarg(label) html_form_line_begin.arg(type).arg(label)
+ TQString("<input type=\"text\" name=\"%1\" id=\"%2\">").tqarg(type).tqarg(type) + TQString("<input type=\"text\" name=\"%1\" id=\"%2\">").arg(type).arg(type)
+ html_form_line_end; + html_form_line_end;
} }
static TQString begin_form_combo(const TQString& type, const TQString& label) static TQString begin_form_combo(const TQString& type, const TQString& label)
{ {
return return
html_form_line_begin.tqarg(type).tqarg(label) html_form_line_begin.arg(type).arg(label)
+ TQString("\t<select name=\"%1\" id=\"%2\">\n").tqarg(type).tqarg(type); + TQString("\t<select name=\"%1\" id=\"%2\">\n").arg(type).arg(type);
} }
static TQString make_form_option(const TQString& name, const TQString& text) static TQString make_form_option(const TQString& name, const TQString& text)
{ return "\t\t<option value=" + name + ">" + text + "</option>\n"; } { return "\t\t<option value=" + name + ">" + text + "</option>\n"; }
@ -201,7 +201,7 @@ TQString Dpkg::getOnlineForm()
<< make_form_option("warty", "warty") << make_form_option("warty", "warty")
<< end_form_combo() << end_form_combo()
<< html_form_end.tqarg(i18n("Go online!")); << html_form_end.arg(i18n("Go online!"));
return buffer; return buffer;
} }

@ -33,7 +33,7 @@ void FileSearch::operator() (AptProtocol* slave, const TQString & tag, const TQS
if (m_result_count) if (m_result_count)
*slave << buffer + html_dpkgs_line_end; *slave << buffer + html_dpkgs_line_end;
*slave << html_dpkgs_line_begin.tqarg(value); *slave << html_dpkgs_line_begin.arg(value);
++m_result_count; ++m_result_count;
buffer = ""; buffer = "";
} }

@ -62,7 +62,7 @@ namespace Parsers
files.sort(); files.sort();
*slave << *slave <<
"<div class=\"filelist\">\n" + files.join("\n<br>") + "\n</div>\n" "<div class=\"filelist\">\n" + files.join("\n<br>") + "\n</div>\n"
"<div class=\"footer\">" + i18n("%1 files in the package").tqarg(result_count()) + "</div>\n"; "<div class=\"footer\">" + i18n("%1 files in the package").arg(result_count()) + "</div>\n";
files.clear(); files.clear();
} }
} }

@ -10,7 +10,7 @@
#ifndef TQHtmlStream_H #ifndef TQHtmlStream_H
#define TQHtmlStream_H #define TQHtmlStream_H
#include <tqtextstream.h> #include <textstream.h>
#include <tqstringlist.h> #include <tqstringlist.h>
class TQHtmlStream; class TQHtmlStream;

@ -101,16 +101,16 @@ void Show::operator() (AptProtocol* slave, const TQString& tag, const TQString&
{ {
close_item(indent, buffer); close_item(indent, buffer);
buffer += buffer +=
html_attribute_begin.tqarg(value) html_attribute_begin.arg(value)
+ "&nbsp;"; + "&nbsp;";
close_item(indent, buffer); close_item(indent, buffer);
buffer += html_attribute_begin.tqarg("&nbsp;"); buffer += html_attribute_begin.arg("&nbsp;");
} }
else if (value != "Version" && value != "Package") else if (value != "Version" && value != "Package")
{ {
close_item(indent, buffer); close_item(indent, buffer);
buffer += html_attribute_begin.tqarg(value); buffer += html_attribute_begin.arg(value);
} }
if (value == "Description") if (value == "Description")
@ -141,14 +141,14 @@ void Show::operator() (AptProtocol* slave, const TQString& tag, const TQString&
if (value == m_installed) if (value == m_installed)
{ {
action.setQuery("remove"); action.setQuery("remove");
version = TQString("<div class=\"version-header-installed\" id=\"%1\">").tqarg(item_id) version = TQString("<div class=\"version-header-installed\" id=\"%1\">").arg(item_id)
+ i18n("Installed version %1").tqarg(value); + i18n("Installed version %1").arg(value);
} }
else else
{ {
action.setQuery("install"); action.setQuery("install");
version = TQString("<div class=\"version-header\" id=\"%1\">").tqarg(item_id) version = TQString("<div class=\"version-header\" id=\"%1\">").arg(item_id)
+ i18n("Version %1").tqarg(value); + i18n("Version %1").arg(value);
} }
action.addQueryItem("package", m_package); action.addQueryItem("package", m_package);

Loading…
Cancel
Save