summaryrefslogtreecommitdiffstats
path: root/plugins/webinterface
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-19 11:39:49 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-19 11:39:49 -0600
commitbb37c4052a9edfff2196984cef241b1ce2df7bb3 (patch)
tree20f184005dcb8d5315aec18cb3253c7ff452c8ca /plugins/webinterface
parenta90eb215f53c95d81f95b32255098066d90556d9 (diff)
downloadktorrent-bb37c4052a9edfff2196984cef241b1ce2df7bb3.tar.gz
ktorrent-bb37c4052a9edfff2196984cef241b1ce2df7bb3.zip
Remove additional unneeded tq method conversions
Diffstat (limited to 'plugins/webinterface')
-rw-r--r--plugins/webinterface/httpclienthandler.cpp4
-rw-r--r--plugins/webinterface/httpresponseheader.cpp4
-rw-r--r--plugins/webinterface/httpserver.cpp12
-rw-r--r--plugins/webinterface/php_handler.cpp2
-rw-r--r--plugins/webinterface/php_interface.cpp110
-rw-r--r--plugins/webinterface/webinterfaceprefwidget.cpp10
-rw-r--r--plugins/webinterface/www/default/wz_tooltip.js2
7 files changed, 72 insertions, 72 deletions
diff --git a/plugins/webinterface/httpclienthandler.cpp b/plugins/webinterface/httpclienthandler.cpp
index 1ad2d8d..cba0372 100644
--- a/plugins/webinterface/httpclienthandler.cpp
+++ b/plugins/webinterface/httpclienthandler.cpp
@@ -171,7 +171,7 @@ namespace kt
void HttpClientHandler::send500(HttpResponseHeader & hdr)
{
// Out(SYS_WEB|LOG_DEBUG) << "Sending 500 " << endl;
- TQString data = TQString(HTTP_500_ERROR).tqarg("An internal server error occured !");
+ TQString data = TQString(HTTP_500_ERROR).arg("An internal server error occured !");
hdr.setValue("Content-Length",TQString::number(data.length()));
TQTextStream os(client);
@@ -199,7 +199,7 @@ namespace kt
php = new PhpHandler(php_exe,php_iface);
if (!php->executeScript(php_file,args))
{
- TQString data = TQString(HTTP_500_ERROR).tqarg("Failed to launch PHP executable !");
+ TQString data = TQString(HTTP_500_ERROR).arg("Failed to launch PHP executable !");
hdr.setResponseCode(500);
hdr.setValue("Content-Length",TQString::number(data.utf8().length()));
diff --git a/plugins/webinterface/httpresponseheader.cpp b/plugins/webinterface/httpresponseheader.cpp
index 7b87892..3056f79 100644
--- a/plugins/webinterface/httpresponseheader.cpp
+++ b/plugins/webinterface/httpresponseheader.cpp
@@ -61,12 +61,12 @@ namespace kt
TQString HttpResponseHeader::toString() const
{
TQString str;
- str += TQString("HTTP/1.1 %1 %2\r\n").tqarg(response_code).tqarg(ResponseCodeToString(response_code));
+ str += TQString("HTTP/1.1 %1 %2\r\n").arg(response_code).arg(ResponseCodeToString(response_code));
TQMap<TQString,TQString>::const_iterator itr = fields.begin();
while (itr != fields.end())
{
- str += TQString("%1: %2\r\n").tqarg(itr.key()).tqarg(itr.data());
+ str += TQString("%1: %2\r\n").arg(itr.key()).arg(itr.data());
itr++;
}
str += "\r\n";
diff --git a/plugins/webinterface/httpserver.cpp b/plugins/webinterface/httpserver.cpp
index 915e28f..4d582a7 100644
--- a/plugins/webinterface/httpserver.cpp
+++ b/plugins/webinterface/httpserver.cpp
@@ -237,12 +237,12 @@ namespace kt
{
if (!cookie)
return now.toString("%1, dd %2 yyyy hh:mm:ss UTC")
- .tqarg(days[now.date().dayOfWeek() - 1])
- .tqarg(months[now.date().month() - 1]);
+ .arg(days[now.date().dayOfWeek() - 1])
+ .arg(months[now.date().month() - 1]);
else
return now.toString("%1, dd-%2-yyyy hh:mm:ss GMT")
- .tqarg(days[now.date().dayOfWeek() - 1])
- .tqarg(months[now.date().month() - 1]);
+ .arg(days[now.date().dayOfWeek() - 1])
+ .arg(months[now.date().month() - 1]);
}
void HttpServer::setDefaultResponseHeaders(HttpResponseHeader & hdr,const TQString & content_type,bool with_session_info)
@@ -253,7 +253,7 @@ namespace kt
hdr.setValue("Connection","keep-alive");
if (with_session_info && session.sessionId && session.logged_in)
{
- hdr.setValue("Set-Cookie",TQString("KT_SESSID=%1").tqarg(session.sessionId));
+ hdr.setValue("Set-Cookie",TQString("KT_SESSID=%1").arg(session.sessionId));
}
}
@@ -329,7 +329,7 @@ namespace kt
{
// clear cookie in case of login page
TQDateTime dt = TQDateTime::currentDateTime().addDays(-1);
- TQString cookie = TQString("KT_SESSID=666; expires=%1 +0000").tqarg(DateTimeToString(dt,true));
+ TQString cookie = TQString("KT_SESSID=666; expires=%1 +0000").arg(DateTimeToString(dt,true));
rhdr.setValue("Set-Cookie",cookie);
}
diff --git a/plugins/webinterface/php_handler.cpp b/plugins/webinterface/php_handler.cpp
index 9b5ac85..d2c2f55 100644
--- a/plugins/webinterface/php_handler.cpp
+++ b/plugins/webinterface/php_handler.cpp
@@ -82,7 +82,7 @@ namespace kt
for ( it = args.begin(); it != args.end(); ++it )
{
- ts << TQString("$_REQUEST['%1']=\"%2\";\n").tqarg(it.key()).tqarg(it.data());
+ ts << TQString("$_REQUEST['%1']=\"%2\";\n").arg(it.key()).arg(it.data());
}
ts.writeRawBytes(php_s.data() + off,php_s.size() - off); // the rest of the script
ts << flush;
diff --git a/plugins/webinterface/php_interface.cpp b/plugins/webinterface/php_interface.cpp
index e98a309..048310d 100644
--- a/plugins/webinterface/php_interface.cpp
+++ b/plugins/webinterface/php_interface.cpp
@@ -48,19 +48,19 @@ namespace kt
{
KLocale* loc = KGlobal::locale();
if (bytes >= 1024 * 1024 * 1024)
- return TQString("%1 GB").tqarg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
+ return TQString("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
else if (bytes >= 1024*1024)
- return TQString("%1 MB").tqarg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision));
+ return TQString("%1 MB").arg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision));
else if (bytes >= 1024)
- return TQString("%1 KB").tqarg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision));
+ return TQString("%1 KB").arg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision));
else
- return TQString("%1 B").tqarg(bytes);
+ return TQString("%1 B").arg(bytes);
}
TQString KBytesPerSecToString2(double speed,int precision = 2)
{
KLocale* loc = KGlobal::locale();
- return TQString("%1 KB/s").tqarg(loc->formatNumber(speed,precision));
+ return TQString("%1 KB/s").arg(loc->formatNumber(speed,precision));
}
/************************
@@ -91,42 +91,42 @@ namespace kt
out << ",\n";
stats=(*i)->getStats();
- out << TQString("\n%1 => array(").tqarg(k);
+ out << TQString("\n%1 => array(").arg(k);
- out << TQString("\"imported_bytes\" => %1,\n").tqarg(stats.imported_bytes);
- out << TQString("\"bytes_downloaded\" => \"%1\",\n").tqarg(BytesToString2(stats.bytes_downloaded));
- out << TQString("\"bytes_uploaded\" => \"%1\",\n").tqarg(BytesToString2(stats.bytes_uploaded));
- out << TQString("\"bytes_left\" => %1,\n").tqarg(stats.bytes_left);
- out << TQString("\"bytes_left_to_download\" => %1,\n").tqarg(stats.bytes_left_to_download);
- out << TQString("\"total_bytes\" => \"%1\",\n").tqarg(BytesToString2(stats.total_bytes));
- out << TQString("\"total_bytes_to_download\" => %1,\n").tqarg(stats.total_bytes_to_download);
- out << TQString("\"download_rate\" => \"%1\",\n").tqarg(KBytesPerSecToString2(stats.download_rate / 1024.0));
- out << TQString("\"upload_rate\" => \"%1\",\n").tqarg(KBytesPerSecToString2(stats.upload_rate / 1024.0));
- out << TQString("\"num_peers\" => %1,\n").tqarg(stats.num_peers);
- out << TQString("\"num_chunks_downloading\" => %1,\n").tqarg(stats.num_chunks_downloading);
- out << TQString("\"total_chunks\" => %1,\n").tqarg(stats.total_chunks);
- out << TQString("\"num_chunks_downloaded\" => %1,\n").tqarg(stats.num_chunks_downloaded);
- out << TQString("\"num_chunks_excluded\" => %1,\n").tqarg(stats.num_chunks_excluded);
- out << TQString("\"chunk_size\" => %1,\n").tqarg(stats.chunk_size);
- out << TQString("\"seeders_total\" => %1,\n").tqarg(stats.seeders_total);
- out << TQString("\"seeders_connected_to\" => %1,\n").tqarg(stats.seeders_connected_to);
- out << TQString("\"leechers_total\" => %1,\n").tqarg(stats.leechers_total);
- out << TQString("\"leechers_connected_to\" => %1,\n").tqarg(stats.leechers_connected_to);
- out << TQString("\"status\" => %1,\n").tqarg(stats.status);
- out << TQString("\"running\" => %1,\n").tqarg(stats.running);
- out << TQString("\"trackerstatus\" => \"%1\",\n").tqarg(stats.trackerstatus.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
- out << TQString("\"session_bytes_downloaded\" => %1,\n").tqarg(stats.session_bytes_downloaded);
- out << TQString("\"session_bytes_uploaded\" => %1,\n").tqarg(stats.session_bytes_uploaded);
- out << TQString("\"trk_bytes_downloaded\" => %1,\n").tqarg(stats.trk_bytes_downloaded);
- out << TQString("\"trk_bytes_uploaded\" => %1,\n").tqarg(stats.trk_bytes_uploaded);
- out << TQString("\"torrent_name\" => \"%1\",\n").tqarg(stats.torrent_name.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
- out << TQString("\"output_path\" => \"%1\",\n").tqarg(stats.output_path.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
- out << TQString("\"stopped_by_error\" => \"%1\",\n").tqarg(stats.stopped_by_error);
- out << TQString("\"completed\" => \"%1\",\n").tqarg(stats.completed);
- out << TQString("\"user_controlled\" => \"%1\",\n").tqarg(stats.user_controlled);
- out << TQString("\"max_share_ratio\" => %1,\n").tqarg(stats.max_share_ratio);
- out << TQString("\"priv_torrent\" => \"%1\",\n").tqarg(stats.priv_torrent);
- out << TQString("\"num_files\" => \"%1\",\n").tqarg((*i)->getNumFiles());
+ out << TQString("\"imported_bytes\" => %1,\n").arg(stats.imported_bytes);
+ out << TQString("\"bytes_downloaded\" => \"%1\",\n").arg(BytesToString2(stats.bytes_downloaded));
+ out << TQString("\"bytes_uploaded\" => \"%1\",\n").arg(BytesToString2(stats.bytes_uploaded));
+ out << TQString("\"bytes_left\" => %1,\n").arg(stats.bytes_left);
+ out << TQString("\"bytes_left_to_download\" => %1,\n").arg(stats.bytes_left_to_download);
+ out << TQString("\"total_bytes\" => \"%1\",\n").arg(BytesToString2(stats.total_bytes));
+ out << TQString("\"total_bytes_to_download\" => %1,\n").arg(stats.total_bytes_to_download);
+ out << TQString("\"download_rate\" => \"%1\",\n").arg(KBytesPerSecToString2(stats.download_rate / 1024.0));
+ out << TQString("\"upload_rate\" => \"%1\",\n").arg(KBytesPerSecToString2(stats.upload_rate / 1024.0));
+ out << TQString("\"num_peers\" => %1,\n").arg(stats.num_peers);
+ out << TQString("\"num_chunks_downloading\" => %1,\n").arg(stats.num_chunks_downloading);
+ out << TQString("\"total_chunks\" => %1,\n").arg(stats.total_chunks);
+ out << TQString("\"num_chunks_downloaded\" => %1,\n").arg(stats.num_chunks_downloaded);
+ out << TQString("\"num_chunks_excluded\" => %1,\n").arg(stats.num_chunks_excluded);
+ out << TQString("\"chunk_size\" => %1,\n").arg(stats.chunk_size);
+ out << TQString("\"seeders_total\" => %1,\n").arg(stats.seeders_total);
+ out << TQString("\"seeders_connected_to\" => %1,\n").arg(stats.seeders_connected_to);
+ out << TQString("\"leechers_total\" => %1,\n").arg(stats.leechers_total);
+ out << TQString("\"leechers_connected_to\" => %1,\n").arg(stats.leechers_connected_to);
+ out << TQString("\"status\" => %1,\n").arg(stats.status);
+ out << TQString("\"running\" => %1,\n").arg(stats.running);
+ out << TQString("\"trackerstatus\" => \"%1\",\n").arg(stats.trackerstatus.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
+ out << TQString("\"session_bytes_downloaded\" => %1,\n").arg(stats.session_bytes_downloaded);
+ out << TQString("\"session_bytes_uploaded\" => %1,\n").arg(stats.session_bytes_uploaded);
+ out << TQString("\"trk_bytes_downloaded\" => %1,\n").arg(stats.trk_bytes_downloaded);
+ out << TQString("\"trk_bytes_uploaded\" => %1,\n").arg(stats.trk_bytes_uploaded);
+ out << TQString("\"torrent_name\" => \"%1\",\n").arg(stats.torrent_name.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
+ out << TQString("\"output_path\" => \"%1\",\n").arg(stats.output_path.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
+ out << TQString("\"stopped_by_error\" => \"%1\",\n").arg(stats.stopped_by_error);
+ out << TQString("\"completed\" => \"%1\",\n").arg(stats.completed);
+ out << TQString("\"user_controlled\" => \"%1\",\n").arg(stats.user_controlled);
+ out << TQString("\"max_share_ratio\" => %1,\n").arg(stats.max_share_ratio);
+ out << TQString("\"priv_torrent\" => \"%1\",\n").arg(stats.priv_torrent);
+ out << TQString("\"num_files\" => \"%1\",\n").arg((*i)->getNumFiles());
out << TQString("\"files\" => array(");
out << flush;
if (stats.multi_file_torrent)
@@ -138,11 +138,11 @@ namespace kt
out << ",\n";
TorrentFileInterface & file = (*i)->getTorrentFile(j);
- out << TQString("\"%1\" => array(\n").tqarg(j);
- out << TQString("\"name\" => \"%1\",\n").tqarg(file.getPath());
- out << TQString("\"size\" => \"%1\",\n").tqarg(KIO::convertSize(file.getSize()));
- out << TQString("\"perc_done\" => \"%1\",\n").tqarg(file.getDownloadPercentage());
- out << TQString("\"status\" => \"%1\"\n").tqarg(file.getPriority());
+ out << TQString("\"%1\" => array(\n").arg(j);
+ out << TQString("\"name\" => \"%1\",\n").arg(file.getPath());
+ out << TQString("\"size\" => \"%1\",\n").arg(KIO::convertSize(file.getSize()));
+ out << TQString("\"perc_done\" => \"%1\",\n").arg(file.getDownloadPercentage());
+ out << TQString("\"status\" => \"%1\"\n").arg(file.getPriority());
out << TQString(")\n");
out << flush;
}
@@ -166,16 +166,16 @@ namespace kt
out << "function globalInfo()\n{\nreturn array(";
CurrentStats stats=core->getStats();
- out << TQString("\"download_speed\" => \"%1\",").tqarg(KBytesPerSecToString2(stats.download_speed / 1024.0));
- out << TQString("\"upload_speed\" => \"%1\",").tqarg(KBytesPerSecToString2(stats.upload_speed / 1024.0));
- out << TQString("\"bytes_downloaded\" => \"%1\",").tqarg(stats.bytes_downloaded);
- out << TQString("\"bytes_uploaded\" => \"%1\",").tqarg(stats.bytes_uploaded);
- out << TQString("\"max_download_speed\" => \"%1\",").tqarg(core->getMaxDownloadSpeed());
- out << TQString("\"max_upload_speed\" => \"%1\",").tqarg(core->getMaxUploadSpeed());
- out << TQString("\"max_downloads\" => \"%1\",").tqarg(Settings::maxDownloads());
- out << TQString("\"max_seeds\"=> \"%1\",").tqarg(Settings::maxSeeds());
- out << TQString("\"dht_support\" => \"%1\",").tqarg(Settings::dhtSupport());
- out << TQString("\"use_encryption\" => \"%1\"").tqarg(Settings::useEncryption());
+ out << TQString("\"download_speed\" => \"%1\",").arg(KBytesPerSecToString2(stats.download_speed / 1024.0));
+ out << TQString("\"upload_speed\" => \"%1\",").arg(KBytesPerSecToString2(stats.upload_speed / 1024.0));
+ out << TQString("\"bytes_downloaded\" => \"%1\",").arg(stats.bytes_downloaded);
+ out << TQString("\"bytes_uploaded\" => \"%1\",").arg(stats.bytes_uploaded);
+ out << TQString("\"max_download_speed\" => \"%1\",").arg(core->getMaxDownloadSpeed());
+ out << TQString("\"max_upload_speed\" => \"%1\",").arg(core->getMaxUploadSpeed());
+ out << TQString("\"max_downloads\" => \"%1\",").arg(Settings::maxDownloads());
+ out << TQString("\"max_seeds\"=> \"%1\",").arg(Settings::maxSeeds());
+ out << TQString("\"dht_support\" => \"%1\",").arg(Settings::dhtSupport());
+ out << TQString("\"use_encryption\" => \"%1\"").arg(Settings::useEncryption());
out << ");\n}\n";
}
diff --git a/plugins/webinterface/webinterfaceprefwidget.cpp b/plugins/webinterface/webinterfaceprefwidget.cpp
index 6f4baed..48ab0c7 100644
--- a/plugins/webinterface/webinterfaceprefwidget.cpp
+++ b/plugins/webinterface/webinterfaceprefwidget.cpp
@@ -113,23 +113,23 @@ void WebInterfacePrefWidget::changeLedState()
{
TQFileInfo fi(phpExecutablePath->url());
if(fi.isExecutable() && (fi.isFile() || fi.isSymLink())){
- TQToolTip::add( kled, i18n("%1 exists and it is executable").tqarg(phpExecutablePath->url()));
+ TQToolTip::add( kled, i18n("%1 exists and it is executable").arg(phpExecutablePath->url()));
kled->setColor(green);
}
else if (!fi.exists()){
- TQToolTip::add( kled, i18n("%1 does not exist").tqarg(phpExecutablePath->url()) );
+ TQToolTip::add( kled, i18n("%1 does not exist").arg(phpExecutablePath->url()) );
kled->setColor(red);
}
else if (!fi.isExecutable()){
- TQToolTip::add( kled, i18n("%1 is not executable").tqarg(phpExecutablePath->url()) );
+ TQToolTip::add( kled, i18n("%1 is not executable").arg(phpExecutablePath->url()) );
kled->setColor(red);
}
else if (fi.isDir()){
- TQToolTip::add( kled, i18n("%1 is a directory").tqarg(phpExecutablePath->url()) );
+ TQToolTip::add( kled, i18n("%1 is a directory").arg(phpExecutablePath->url()) );
kled->setColor(red);
}
else{
- TQToolTip::add( kled, i18n("%1 is not php executable path").tqarg(phpExecutablePath->url()) );
+ TQToolTip::add( kled, i18n("%1 is not php executable path").arg(phpExecutablePath->url()) );
kled->setColor(red);
}
}
diff --git a/plugins/webinterface/www/default/wz_tooltip.js b/plugins/webinterface/www/default/wz_tooltip.js
index 0405498..1329a1b 100644
--- a/plugins/webinterface/www/default/wz_tooltip.js
+++ b/plugins/webinterface/www/default/wz_tooltip.js
@@ -300,7 +300,7 @@ function tt_DeAlt(t_tag)
{
if(t_tag.alt) t_tag.alt = "";
if(t_tag.title) t_tag.title = "";
- var t_c = t_tag.tqchildren || t_tag.childNodes || null;
+ var t_c = t_tag.children || t_tag.childNodes || null;
if(t_c)
{
for(var t_i = t_c.length; t_i; )