summaryrefslogtreecommitdiffstats
path: root/kpf/src/Response.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kpf/src/Response.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpf/src/Response.cpp')
-rw-r--r--kpf/src/Response.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/kpf/src/Response.cpp b/kpf/src/Response.cpp
index f9ce46d8..a52de893 100644
--- a/kpf/src/Response.cpp
+++ b/kpf/src/Response.cpp
@@ -21,9 +21,9 @@
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
#include <kconfig.h>
@@ -79,7 +79,7 @@ namespace KPF
QCString
Response::text(const Request & request) const
{
- QString s;
+ TQString s;
// XXX: Ensure that all codes we know about are enumerated here.
switch (code_)
@@ -89,8 +89,8 @@ namespace KPF
case 304:
if (request.protocol() >= 1.0)
{
- s = QString(request.protocolString())
- + QString(" %1 %2\r\n").arg(code_).arg(responseName(code_));
+ s = TQString(request.protocolString())
+ + TQString(" %1 %2\r\n").arg(code_).arg(responseName(code_));
}
break;
@@ -102,8 +102,8 @@ namespace KPF
case 500:
case 501:
case 505:
- s = QString(request.protocolString())
- + QString(" %1 %2\r\n").arg(code_).arg(responseName(code_))
+ s = TQString(request.protocolString())
+ + TQString(" %1 %2\r\n").arg(code_).arg(responseName(code_))
+ data(code_, request);
break;
@@ -118,13 +118,13 @@ namespace KPF
QString
Response::data(uint code, const Request & request) const
{
- QString contentType = "Content-Type: text/html; charset=utf-8\r\n";
+ TQString contentType = "Content-Type: text/html; charset=utf-8\r\n";
KConfig config(Config::name());
config.setGroup("General");
- QString html;
+ TQString html;
if
(
@@ -134,26 +134,26 @@ namespace KPF
{
config.setGroup("ErrorMessageOverrideFiles");
- QString filename = config.readPathEntry(QString::number(code));
+ TQString filename = config.readPathEntry(TQString::number(code));
if (!filename.isEmpty())
{
- QFile f(filename);
+ TQFile f(filename);
if (f.open(IO_ReadOnly))
{
- QRegExp regexpMessage ("ERROR_MESSAGE");
- QRegExp regexpCode ("ERROR_CODE");
- QRegExp regexpResource ("RESOURCE");
+ TQRegExp regexpMessage ("ERROR_MESSAGE");
+ TQRegExp regexpCode ("ERROR_CODE");
+ TQRegExp regexpResource ("RESOURCE");
- QTextStream str(&f);
+ TQTextStream str(&f);
while (!str.atEnd())
{
- QString line(str.readLine());
+ TQString line(str.readLine());
line.replace(regexpMessage, responseName(code));
- line.replace(regexpCode, QString::number(code));
+ line.replace(regexpCode, TQString::number(code));
line.replace(regexpResource, request.path());
html = line + "\r\n";
@@ -177,8 +177,8 @@ namespace KPF
html += "</body>\r\n</html>\r\n";
}
- QString contentLength =
- QString("Content-Length: %1\r\n").arg(html.length());
+ TQString contentLength =
+ TQString("Content-Length: %1\r\n").arg(html.length());
return (contentType + contentLength + "\r\n" + html);
}