summaryrefslogtreecommitdiffstats
path: root/kpf/src/Response.cpp
diff options
context:
space:
mode:
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);
}