Initial TQt conversion

pull/1/head
Slávek Banko 11 years ago
parent b9d8d75902
commit e03da7a558

@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes="" x_includes=""
x_libraries="" x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@ -1092,19 +1092,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT]) AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
#include <qglobal.h> #include <ntqglobal.h>
#include <qapplication.h> #include <ntqapplication.h>
EOF EOF
if test "$kde_qtver" = "2"; then if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qevent.h> #include <ntqevent.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstyle.h> #include <ntqstyle.h>
EOF EOF
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210 #if TQT_VERSION < 210
#error 1 #error 1
#endif #endif
EOF EOF
@ -1113,8 +1113,8 @@ fi
if test "$kde_qtver" = "3"; then if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qcursor.h> #include <ntqcursor.h>
#include <qstylefactory.h> #include <ntqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -1201,22 +1201,22 @@ fi
if test -z "$3"; then if test -z "$3"; then
if test $kde_qtver = 3; then if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'` qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else else
kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
fi fi
fi fi
if test $kde_qtver = 2; then if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222" kde_qt_verstring="TQT_VERSION >= 222"
else else
kde_qt_verstring="QT_VERSION >= 200" kde_qt_verstring="TQT_VERSION >= 200"
fi fi
fi fi
if test $kde_qtver = 1; then if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi fi
else else
kde_qt_verstring="$3" kde_qt_verstring="$3"
@ -1325,7 +1325,7 @@ AC_ARG_ENABLE(
USING_QT_MT="" USING_QT_MT=""
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host. dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
KDE_MT_LDFLAGS= KDE_MT_LDFLAGS=
@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------
fi fi
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host. dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then if test "x$kde_use_qt_mt" = "xyes"; then
@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi fi
if test "$kde_qtver" != "1"; then if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h kde_qt_header=ntqstyle.h
else else
kde_qt_header=qglobal.h kde_qt_header=ntqglobal.h
fi fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@ -2034,7 +2034,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
AC_TRY_LINK([ AC_TRY_LINK([
#include <qdom.h> #include <ntqdom.h>
], ],
[ [
QDomDocument doc; QDomDocument doc;
@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS" ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK( AC_TRY_LINK(
[#include <qapplication.h>], [#include <ntqapplication.h>],
[ [
int argc; int argc;
char** argv; char** argv;
@ -3397,7 +3397,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <qglobal.h> #include <ntqglobal.h>
#if Q_EXPORT - 0 != 0 #if Q_EXPORT - 0 != 0
/* if this compiles, then Q_EXPORT is undefined */ /* if this compiles, then Q_EXPORT is undefined */
/* if Q_EXPORT is nonempty, this will break compilation */ /* if Q_EXPORT is nonempty, this will break compilation */
@ -4635,7 +4635,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl AC_TRY_RUN(dnl
[ [
#include <qimageio.h> #include <qimageio.h>
#include <qstring.h> #include <ntqstring.h>
int main() { int main() {
QString t = "hallo"; QString t = "hallo";
t.fill('t'); t.fill('t');
@ -5480,7 +5480,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir" kde_qtdir="$with_qt_dir"
fi fi
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR) AC_MSG_RESULT($QTDOCDIR)
AC_SUBST(QTDOCDIR) AC_SUBST(QTDOCDIR)
@ -5501,7 +5501,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER) AC_SUBST(DOXYGEN_PROJECT_NUMBER)
KDE_HAS_DOXYGEN=no KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes KDE_HAS_DOXYGEN=yes
fi fi
AC_SUBST(KDE_HAS_DOXYGEN) AC_SUBST(KDE_HAS_DOXYGEN)

48
aclocal.m4 vendored

@ -1072,7 +1072,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes="" x_includes=""
x_libraries="" x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@ -1104,19 +1104,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT]) AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
#include <qglobal.h> #include <ntqglobal.h>
#include <qapplication.h> #include <ntqapplication.h>
EOF EOF
if test "$kde_qtver" = "2"; then if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qevent.h> #include <ntqevent.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstyle.h> #include <ntqstyle.h>
EOF EOF
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210 #if TQT_VERSION < 210
#error 1 #error 1
#endif #endif
EOF EOF
@ -1125,8 +1125,8 @@ fi
if test "$kde_qtver" = "3"; then if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qcursor.h> #include <ntqcursor.h>
#include <qstylefactory.h> #include <ntqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -1213,22 +1213,22 @@ fi
if test -z "$3"; then if test -z "$3"; then
if test $kde_qtver = 3; then if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'` qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else else
kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
fi fi
fi fi
if test $kde_qtver = 2; then if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222" kde_qt_verstring="TQT_VERSION >= 222"
else else
kde_qt_verstring="QT_VERSION >= 200" kde_qt_verstring="TQT_VERSION >= 200"
fi fi
fi fi
if test $kde_qtver = 1; then if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi fi
else else
kde_qt_verstring="$3" kde_qt_verstring="$3"
@ -1337,7 +1337,7 @@ AC_ARG_ENABLE(
USING_QT_MT="" USING_QT_MT=""
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host. dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
KDE_MT_LDFLAGS= KDE_MT_LDFLAGS=
@ -1395,7 +1395,7 @@ dnl ------------------------------------------------------------
fi fi
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host. dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then if test "x$kde_use_qt_mt" = "xyes"; then
@ -1461,9 +1461,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi fi
if test "$kde_qtver" != "1"; then if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h kde_qt_header=ntqstyle.h
else else
kde_qt_header=qglobal.h kde_qt_header=ntqglobal.h
fi fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@ -2046,7 +2046,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
AC_TRY_LINK([ AC_TRY_LINK([
#include <qdom.h> #include <ntqdom.h>
], ],
[ [
QDomDocument doc; QDomDocument doc;
@ -2607,7 +2607,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS" ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK( AC_TRY_LINK(
[#include <qapplication.h>], [#include <ntqapplication.h>],
[ [
int argc; int argc;
char** argv; char** argv;
@ -3409,7 +3409,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <qglobal.h> #include <ntqglobal.h>
#if Q_EXPORT - 0 != 0 #if Q_EXPORT - 0 != 0
/* if this compiles, then Q_EXPORT is undefined */ /* if this compiles, then Q_EXPORT is undefined */
/* if Q_EXPORT is nonempty, this will break compilation */ /* if Q_EXPORT is nonempty, this will break compilation */
@ -4647,7 +4647,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl AC_TRY_RUN(dnl
[ [
#include <qimageio.h> #include <qimageio.h>
#include <qstring.h> #include <ntqstring.h>
int main() { int main() {
QString t = "hallo"; QString t = "hallo";
t.fill('t'); t.fill('t');
@ -5492,7 +5492,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir" kde_qtdir="$with_qt_dir"
fi fi
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR) AC_MSG_RESULT($QTDOCDIR)
AC_SUBST(QTDOCDIR) AC_SUBST(QTDOCDIR)
@ -5513,7 +5513,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER) AC_SUBST(DOXYGEN_PROJECT_NUMBER)
KDE_HAS_DOXYGEN=no KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes KDE_HAS_DOXYGEN=yes
fi fi
AC_SUBST(KDE_HAS_DOXYGEN) AC_SUBST(KDE_HAS_DOXYGEN)

@ -37,9 +37,9 @@
#include <kurl.h> #include <kurl.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
// Qt // TQt
#include <qcstring.h> #include <ntqcstring.h>
#include <qmap.h> #include <ntqmap.h>
// Standard C++ /C // Standard C++ /C
#include <list> #include <list>
@ -77,13 +77,13 @@ namespace KioSword
class SwordOptions; class SwordOptions;
// HTML fragments that will be initialised at run time ------------------------------------------------------------------------- // HTML fragments that will be initialised at run time -------------------------------------------------------------------------
static QString search_form; static TQString search_form;
static QString help_page; static TQString help_page;
SwordProtocol::SwordProtocol(const QCString & pool_socket, SwordProtocol::SwordProtocol(const TQCString & pool_socket,
const QCString & app_socket) const TQCString & app_socket)
: SlaveBase("kio_sword", pool_socket, app_socket) : SlaveBase("kio_sword", pool_socket, app_socket)
{ {
kdDebug() << "SwordProtocol::SwordProtocol()" << endl; kdDebug() << "SwordProtocol::SwordProtocol()" << endl;
@ -98,14 +98,14 @@ namespace KioSword
void SwordProtocol::get(const KURL & url) void SwordProtocol::get(const KURL & url)
{ {
QString modname; TQString modname;
QString query; TQString query;
QString error; TQString error;
kdDebug() << "SwordProtocol::get(const KURL& url)" << endl; kdDebug() << "SwordProtocol::get(const KURL& url)" << endl;
/* kdDebug() << "Seconds: " << url.query() << endl; /* kdDebug() << "Seconds: " << url.query() << endl;
QString remoteServer = url.host(); TQString remoteServer = url.host();
int remotePort = url.port(); int remotePort = url.port();
kdDebug() << "myURL: " << url.prettyURL() << endl; */ kdDebug() << "myURL: " << url.prettyURL() << endl; */
@ -141,8 +141,8 @@ namespace KioSword
} }
else else
{ {
modname = m_path.section('/', 0, 0, QString::SectionSkipEmpty); modname = m_path.section('/', 0, 0, TQString::SectionSkipEmpty);
query = m_path.section('/', 1, -1, QString::SectionSkipEmpty); query = m_path.section('/', 1, -1, TQString::SectionSkipEmpty);
} }
} }
@ -206,7 +206,7 @@ namespace KioSword
if (!modname.isEmpty()) { if (!modname.isEmpty()) {
m_renderer.moduleQuery(modname, query, m_options, tmplt); m_renderer.moduleQuery(modname, query, m_options, tmplt);
} else { } else {
QString body; TQString body;
tmplt->setTitle(i18n("Modules - Kio-Sword")); tmplt->setTitle(i18n("Modules - Kio-Sword"));
if (!error.isEmpty()) { if (!error.isEmpty()) {
body = error; body = error;
@ -255,16 +255,16 @@ namespace KioSword
finished(); finished();
} }
/* redefine data for QCStrings so we don't send the trailing /* redefine data for TQCStrings so we don't send the trailing
null */ null */
void SwordProtocol::data(const QCString& text) { void SwordProtocol::data(const TQCString& text) {
QByteArray nonull; TQByteArray nonull;
nonull.setRawData(text.data(), text.size()-1); nonull.setRawData(text.data(), text.size()-1);
SlaveBase::data(nonull); SlaveBase::data(nonull);
nonull.resetRawData(text.data(), text.size()-1); nonull.resetRawData(text.data(), text.size()-1);
} }
void SwordProtocol::data(const QByteArray& array) { void SwordProtocol::data(const TQByteArray& array) {
SlaveBase::data(array); SlaveBase::data(array);
} }
@ -273,9 +273,9 @@ namespace KioSword
m_options.readFromConfig(m_config); m_options.readFromConfig(m_config);
} }
QString SwordProtocol::saveUserConfig() TQString SwordProtocol::saveUserConfig()
{ {
QString message; TQString message;
m_options.saveToConfig(m_config); m_options.saveToConfig(m_config);
m_config->sync(); m_config->sync();
// search form depends on settings, so force it to be recreated // search form depends on settings, so force it to be recreated
@ -295,11 +295,11 @@ namespace KioSword
// Reset data members that should always be // Reset data members that should always be
// retrieved from URL // retrieved from URL
m_action = QUERY; m_action = QUERY;
m_path = QString::null; m_path = TQString::null;
m_redirect.module = QString::null; m_redirect.module = TQString::null;
m_redirect.query = QString::null; m_redirect.query = TQString::null;
m_previous.module = QString::null; m_previous.module = TQString::null;
m_previous.query = QString::null; m_previous.query = TQString::null;
m_moduletype = DEFMODULETYPE_NONE; m_moduletype = DEFMODULETYPE_NONE;
if (url.hasPath()) if (url.hasPath())
@ -310,10 +310,10 @@ namespace KioSword
// URLs will be encoded in UTF-8 since they are sometimes // URLs will be encoded in UTF-8 since they are sometimes
// generated from the search form, and the browser will // generated from the search form, and the browser will
// encode in UTF-8 since the whole page has UTF-8 charset // encode in UTF-8 since the whole page has UTF-8 charset
QMap<QString, QString> items = url.queryItems(KURL::CaseInsensitiveKeys, 106); TQMap<TQString, TQString> items = url.queryItems(KURL::CaseInsensitiveKeys, 106);
QMap<QString, QString>::const_iterator it; TQMap<TQString, TQString>::const_iterator it;
QMap<QString, QString>::const_iterator it_end = items.end(); TQMap<TQString, TQString>::const_iterator it_end = items.end();
QString val; TQString val;
const char *key; const char *key;
for(it = items.begin(); it != it_end; it++) { for(it = items.begin(); it != it_end; it++) {
@ -366,8 +366,8 @@ namespace KioSword
else ENUM_OPTION(m_action, "testsettings", REDIRECT_QUERY) else ENUM_OPTION(m_action, "testsettings", REDIRECT_QUERY)
else if (!strcasecmp(key, "previouspath")) { else if (!strcasecmp(key, "previouspath")) {
m_previous.module = val.section('/', 0, 0, QString::SectionSkipEmpty); m_previous.module = val.section('/', 0, 0, TQString::SectionSkipEmpty);
m_previous.query = val.section('/', 1, -1, QString::SectionSkipEmpty); m_previous.query = val.section('/', 1, -1, TQString::SectionSkipEmpty);
} }
} }
@ -382,16 +382,16 @@ namespace KioSword
void SwordProtocol::sendPage(const Template* tplt) { void SwordProtocol::sendPage(const Template* tplt) {
data(tplt->render(m_options)); data(tplt->render(m_options));
data(QByteArray()); // empty array means we're done sending the data data(TQByteArray()); // empty array means we're done sending the data
finished(); finished();
} }
/** Returns a string representing notes about an option for the settings page /** Returns a string representing notes about an option for the settings page
*/ */
template <class T> template <class T>
QString optionNotes(const Option<T>& option) TQString optionNotes(const Option<T>& option)
{ {
QString output; TQString output;
if (!option.m_propagate) if (!option.m_propagate)
{ {
output += "<sup>1</sup>"; output += "<sup>1</sup>";
@ -409,8 +409,8 @@ namespace KioSword
/** HTML for a boolean option */ /** HTML for a boolean option */
QString settingsBooleanOptionRow(const QString& description, const Option<bool>& option) { TQString settingsBooleanOptionRow(const TQString& description, const Option<bool>& option) {
static const QString boolean_option_row( static const TQString boolean_option_row(
"<tr><td>%1</td><td><nobr><input type='radio' name='%2' value='1' %3>%4 &nbsp;&nbsp;<input type='radio' name='%2' value='0' %5>%6</nobr></td><td>%2, %7</td></tr>"); "<tr><td>%1</td><td><nobr><input type='radio' name='%2' value='1' %3>%4 &nbsp;&nbsp;<input type='radio' name='%2' value='0' %5>%6</nobr></td><td>%2, %7</td></tr>");
return boolean_option_row return boolean_option_row
.arg(description + optionNotes(option)) .arg(description + optionNotes(option))
@ -432,10 +432,10 @@ namespace KioSword
* @param optionList HTML containing the <option>s * @param optionList HTML containing the <option>s
* @return * @return
*/ */
QString settingsGeneralOptionRow(const QString& description, const Option<QString>& option, TQString settingsGeneralOptionRow(const TQString& description, const Option<TQString>& option,
const QString& optionList) const TQString& optionList)
{ {
static const QString general_option_row( static const TQString general_option_row(
"<tr><td>%1</td><td><select name='%2'>%3</select></td><td>%4, %5</td></tr>"); "<tr><td>%1</td><td><select name='%2'>%3</select></td><td>%4, %5</td></tr>");
return general_option_row return general_option_row
.arg(description + optionNotes(option)) .arg(description + optionNotes(option))
@ -445,13 +445,13 @@ namespace KioSword
.arg(option.m_qsLongName); .arg(option.m_qsLongName);
} }
QString SwordProtocol::settingsForm() { TQString SwordProtocol::settingsForm() {
QString output; TQString output;
QStringList modules; TQStringList modules;
QStringList::Iterator it; TQStringList::Iterator it;
QString temp; TQString temp;
static const QString separator_row( static const TQString separator_row(
"<tr><td class='settingscategory' colspan='3'>%1</td></tr>"); "<tr><td class='settingscategory' colspan='3'>%1</td></tr>");
@ -461,7 +461,7 @@ namespace KioSword
" save these settings to your own configuration file. 'Test settings' will return " " save these settings to your own configuration file. 'Test settings' will return "
" you to the previous page with the options you have specified. <br>"); " you to the previous page with the options you have specified. <br>");
output += QString( output += TQString(
"<form action='sword:/' method='GET'>" "<form action='sword:/' method='GET'>"
"<table class='settings' border=0 cellspacing=0>" "<table class='settings' border=0 cellspacing=0>"
" <tr><th>%1</th><th>%2</th><th>%4</th></tr>") " <tr><th>%1</th><th>%2</th><th>%4</th></tr>")
@ -480,11 +480,11 @@ namespace KioSword
output += separator_row.arg(i18n("Language")); output += separator_row.arg(i18n("Language"));
// Locale // Locale
QStringList locales = m_renderer.availableLocales(); TQStringList locales = m_renderer.availableLocales();
temp = ""; temp = "";
for (int i = 0; i < locales.size(); i++) for (int i = 0; i < locales.size(); i++)
{ {
temp += QString("<option value='%1' %3>%2</option>") temp += TQString("<option value='%1' %3>%2</option>")
.arg(locales[i]) .arg(locales[i])
.arg(locales[i]) .arg(locales[i])
.arg((m_options.locale() == locales[i]) ? "selected" : ""); .arg((m_options.locale() == locales[i]) ? "selected" : "");
@ -513,9 +513,9 @@ namespace KioSword
output += separator_row.arg(i18n("Default modules")); output += separator_row.arg(i18n("Default modules"));
modules = m_renderer.moduleList(); modules = m_renderer.moduleList();
vector<QString> dm_desc; vector<TQString> dm_desc;
vector<Option<QString> > dm_options; vector<Option<TQString> > dm_options;
vector<QString>::size_type i; vector<TQString>::size_type i;
dm_desc.push_back(i18n("Default Bible")); dm_desc.push_back(i18n("Default Bible"));
dm_options.push_back(m_options.defaultBible); dm_options.push_back(m_options.defaultBible);
@ -532,11 +532,11 @@ namespace KioSword
dm_options.push_back(m_options.defaultHebrewMorph); dm_options.push_back(m_options.defaultHebrewMorph);
for (i = 0; i < dm_options.size(); i++) { for (i = 0; i < dm_options.size(); i++) {
temp = QString("<option value='' %1> </option>") temp = TQString("<option value='' %1> </option>")
.arg(dm_options[i]().stripWhiteSpace().isEmpty() ? "selected" : ""); .arg(dm_options[i]().stripWhiteSpace().isEmpty() ? "selected" : "");
for (it = modules.begin(); it != modules.end(); ++it ) { for (it = modules.begin(); it != modules.end(); ++it ) {
temp += QString("<option value='%1' %3>%2</option>") temp += TQString("<option value='%1' %3>%2</option>")
.arg(*it) .arg(*it)
.arg(*it) .arg(*it)
.arg(((*it) == dm_options[i]() ? "selected" : "")); .arg(((*it) == dm_options[i]() ? "selected" : ""));
@ -549,13 +549,13 @@ namespace KioSword
output += settingsBooleanOptionRow(i18n("Make formatting options propagate. This makes Kio-Sword remember formatting settings that you have set, by propagating them in the links. (Some navigation options are always excluded from this behaviour)."), output += settingsBooleanOptionRow(i18n("Make formatting options propagate. This makes Kio-Sword remember formatting settings that you have set, by propagating them in the links. (Some navigation options are always excluded from this behaviour)."),
m_options.propagate); m_options.propagate);
output += QString("</table>"); output += TQString("</table>");
output += i18n("<p>Notes:<br/>" output += i18n("<p>Notes:<br/>"
"1) These options never propagate<br/>" "1) These options never propagate<br/>"
"2) These options are never saved<br/></p>"); "2) These options are never saved<br/></p>");
output += QString( output += TQString(
"<br><input type='hidden' name='module' value='%1'>" // redirection path "<br><input type='hidden' name='module' value='%1'>" // redirection path
"<input type='hidden' name='query' value='%2'>" // redirection path "<input type='hidden' name='query' value='%2'>" // redirection path
"<input type='submit' name='testsettings' value='%3'>&nbsp;" // "Test settings" "<input type='submit' name='testsettings' value='%3'>&nbsp;" // "Test settings"
@ -576,7 +576,7 @@ namespace KioSword
return output; return output;
} }
QString SwordProtocol::helpPage() { TQString SwordProtocol::helpPage() {
if (help_page.isEmpty()) { if (help_page.isEmpty()) {
help_page += i18n("<h1>Help</h1>" help_page += i18n("<h1>Help</h1>"
"<p>For full documentation, see <a href=\"help:/kio_sword\">installed help files</a>.</p>" "<p>For full documentation, see <a href=\"help:/kio_sword\">installed help files</a>.</p>"
@ -616,8 +616,8 @@ namespace KioSword
return help_page; return help_page;
} }
QString SwordProtocol::searchForm(const SwordOptions& options) { TQString SwordProtocol::searchForm(const SwordOptions& options) {
static const QString search_form_tmpl( static const TQString search_form_tmpl(
"<h1 class='searchform'>%1</h1>" // title "<h1 class='searchform'>%1</h1>" // title
"<div class='searchform'>" "<div class='searchform'>"
"<form action='sword:/' method='GET'>" "<form action='sword:/' method='GET'>"
@ -646,13 +646,13 @@ namespace KioSword
"</div>"); "</div>");
if (search_form.isEmpty()) { // avoid calculating this twice if (search_form.isEmpty()) { // avoid calculating this twice
QStringList modules = m_renderer.moduleList(); TQStringList modules = m_renderer.moduleList();
QString temp; TQString temp;
QStringList::Iterator it; TQStringList::Iterator it;
temp = "<option value=''></option>"; temp = "<option value=''></option>";
for (it = modules.begin(); it != modules.end(); ++it ) { for (it = modules.begin(); it != modules.end(); ++it ) {
temp += QString("<option value='%1' %3>%2</option>") temp += TQString("<option value='%1' %3>%2</option>")
.arg(*it) .arg(*it)
.arg(*it) .arg(*it)
.arg((*it == m_options.defaultBible()) ? "selected='selected'" : ""); .arg((*it == m_options.defaultBible()) ? "selected='selected'" : "");
@ -670,7 +670,7 @@ namespace KioSword
} }
// search_form is generated once, but we need to modify // search_form is generated once, but we need to modify
// form each time to include propagated values // form each time to include propagated values
QString output(search_form); TQString output(search_form);
return output.replace("</form>", optionsAsHiddenFields(options) + "</form>"); return output.replace("</form>", optionsAsHiddenFields(options) + "</form>");
} }
} }

@ -29,8 +29,8 @@
#include <kconfig.h> #include <kconfig.h>
#include <kio/slavebase.h> #include <kio/slavebase.h>
#include <qstring.h> #include <ntqstring.h>
#include <qcstring.h> #include <ntqcstring.h>
namespace KioSword { namespace KioSword {
class Template; class Template;
@ -38,26 +38,26 @@ namespace KioSword {
class SwordProtocol : public KIO::SlaveBase { class SwordProtocol : public KIO::SlaveBase {
public: public:
SwordProtocol(const QCString & pool_socket, SwordProtocol(const TQCString & pool_socket,
const QCString & app_socket); const TQCString & app_socket);
virtual ~SwordProtocol(); virtual ~SwordProtocol();
virtual void mimetype(const KURL & url); virtual void mimetype(const KURL & url);
virtual void get(const KURL & url); virtual void get(const KURL & url);
protected: protected:
void data(const QCString& text); void data(const TQCString& text);
void data(const QByteArray& text); void data(const TQByteArray& text);
void parseURL(const KURL & url); void parseURL(const KURL & url);
void readUserConfig(); void readUserConfig();
QString saveUserConfig(); TQString saveUserConfig();
void sendPage(const Template* tmplt); void sendPage(const Template* tmplt);
QString helpPage(); TQString helpPage();
QString pageLinks(const SwordOptions& options); TQString pageLinks(const SwordOptions& options);
QString searchForm(const SwordOptions& options); TQString searchForm(const SwordOptions& options);
QString settingsForm(); TQString settingsForm();
typedef enum { QUERY, typedef enum { QUERY,
REDIRECT_QUERY, REDIRECT_QUERY,
@ -71,18 +71,18 @@ namespace KioSword {
SwordOptions m_options; SwordOptions m_options;
ActionType m_action; ActionType m_action;
DefModuleType m_moduletype; DefModuleType m_moduletype;
QString m_path; TQString m_path;
Renderer::SearchType m_stype; Renderer::SearchType m_stype;
KURL m_baseurl; KURL m_baseurl;
struct { struct {
QString query; TQString query;
QString module; TQString module;
} m_previous; } m_previous;
struct { struct {
QString query; TQString query;
QString module; TQString module;
} m_redirect; } m_redirect;
KConfig *m_config; KConfig *m_config;

@ -30,7 +30,7 @@
#include <versekey.h> #include <versekey.h>
#include <swmodule.h> #include <swmodule.h>
#include <qstring.h> #include <ntqstring.h>
#include <stdlib.h> #include <stdlib.h>
@ -100,12 +100,12 @@ namespace KioSword {
val = strchr(attrib, ':'); val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib; val = (val) ? (val + 1) : attrib;
if (*val == 'G') { if (*val == 'G') {
buf.append(QString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span> ") buf.append(TQString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span> ")
.arg(val+1) .arg(val+1)
.arg(swordUrlForSearch(GREEKSTRONGS, val+1, m_swordoptions)) .arg(swordUrlForSearch(GREEKSTRONGS, val+1, m_swordoptions))
.utf8()); .utf8());
} else if (*val == 'H') { } else if (*val == 'H') {
buf.append(QString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span> ") buf.append(TQString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span> ")
.arg(val+1) .arg(val+1)
.arg(swordUrlForSearch(HEBREWSTRONGS, val+1, m_swordoptions)) .arg(swordUrlForSearch(HEBREWSTRONGS, val+1, m_swordoptions))
.utf8()); .utf8());
@ -121,18 +121,18 @@ namespace KioSword {
val = strchr(attrib, ':'); val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib; val = (val) ? (val + 1) : attrib;
if (!strncmp(attrib, "x-Robinson",10)) { //robinson codes if (!strncmp(attrib, "x-Robinson",10)) { //robinson codes
buf.append(QString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span> ") buf.append(TQString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span> ")
.arg(val) .arg(val)
.arg(swordUrlForSearch(GREEKMORPH, val, m_swordoptions)) .arg(swordUrlForSearch(GREEKMORPH, val, m_swordoptions))
.utf8()); .utf8());
} else if ((*val == 'T')) { } else if ((*val == 'T')) {
if (val[1] == 'G') { if (val[1] == 'G') {
buf.append(QString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span> ") buf.append(TQString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span> ")
.arg(val+1) .arg(val+1)
.arg(swordUrlForSearch(GREEKMORPH, val+1, m_swordoptions)) .arg(swordUrlForSearch(GREEKMORPH, val+1, m_swordoptions))
.utf8()); .utf8());
} else if (val[1] == 'H') { } else if (val[1] == 'H') {
buf.append(QString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span> ") buf.append(TQString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span> ")
.arg(val+1) .arg(val+1)
.arg(swordUrlForSearch(HEBREWMORPH, val+1, m_swordoptions)) .arg(swordUrlForSearch(HEBREWMORPH, val+1, m_swordoptions))
.utf8()); .utf8());

@ -74,7 +74,7 @@ namespace KioSword {
} else if (tag.getAttribute("type") && !strcasecmp(tag.getAttribute("type"), "morph")) { // Morph } else if (tag.getAttribute("type") && !strcasecmp(tag.getAttribute("type"), "morph")) { // Morph
const char *value = tag.getAttribute("value"); const char *value = tag.getAttribute("value");
if (value) { if (value) {
buf.append(QString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span>") buf.append(TQString(" <span class='morph'>(<a href=\"%2\">%1</a>)</span>")
.arg(value) .arg(value)
.arg(swordUrlForSearch(GREEKMORPH, value, m_swordoptions)) .arg(swordUrlForSearch(GREEKMORPH, value, m_swordoptions))
.utf8()); .utf8());
@ -84,13 +84,13 @@ namespace KioSword {
tag.getAttribute("value"); tag.getAttribute("value");
if (value && value[0] == 'H') { // hewbrew strongs number if (value && value[0] == 'H') { // hewbrew strongs number
// value + 1 => skip the H // value + 1 => skip the H
buf.append(QString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span>") buf.append(TQString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span>")
.arg(value + 1) .arg(value + 1)
.arg(swordUrlForSearch(HEBREWSTRONGS, value + 1, m_swordoptions)) .arg(swordUrlForSearch(HEBREWSTRONGS, value + 1, m_swordoptions))
.utf8()); .utf8());
} else if (value && value[0] == 'G') { //greek strongs number } else if (value && value[0] == 'G') { //greek strongs number
// value + 1 => skip the G // value + 1 => skip the G
buf.append(QString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span>") buf.append(TQString(" <span class='strongs'>&lt;<a href=\"%2\">%1</a>&gt;</span>")
.arg(value + 1) .arg(value + 1)
.arg(swordUrlForSearch(GREEKSTRONGS, value + 1, m_swordoptions)) .arg(swordUrlForSearch(GREEKSTRONGS, value + 1, m_swordoptions))
.utf8()); .utf8());

@ -26,16 +26,16 @@
#include <kconfig.h> #include <kconfig.h>
#include <qstring.h> #include <ntqstring.h>
#include <qmap.h> #include <ntqmap.h>
namespace KioSword namespace KioSword
{ {
class OptionBase class OptionBase
{ {
public: public:
virtual void readFromQueryString(QMap<QString, QString> params, bool allowPropagating) = 0; virtual void readFromQueryString(TQMap<TQString, TQString> params, bool allowPropagating) = 0;
virtual void getQueryStringPair(QString& name, QString& val) = 0; virtual void getQueryStringPair(TQString& name, TQString& val) = 0;
virtual void readFromConfig(const KConfig* config) = 0; virtual void readFromConfig(const KConfig* config) = 0;
virtual void saveToConfig(KConfig* config) = 0; virtual void saveToConfig(KConfig* config) = 0;
virtual void copy(const OptionBase* other) = 0; virtual void copy(const OptionBase* other) = 0;
@ -58,7 +58,7 @@ namespace KioSword
T m_config_value; // User's default T m_config_value; // User's default
/** Convert a value from a string to the option's type */ /** Convert a value from a string to the option's type */
static const T fromString(const QString& val) static const T fromString(const TQString& val)
{ {
// We will specialise this function later // We will specialise this function later
// to work correctly // to work correctly
@ -67,10 +67,10 @@ namespace KioSword
} }
/** Convert the option to a string for use in query strings */ /** Convert the option to a string for use in query strings */
QString toString(T val) TQString toString(T val)
{ {
// Will specialise this later // Will specialise this later
QString result; TQString result;
return result; return result;
} }
@ -83,10 +83,10 @@ namespace KioSword
} }
public: public:
QString m_qsShortName; // short name in querystring TQString m_qsShortName; // short name in querystring
QString m_qsLongName; // long name in querystring TQString m_qsLongName; // long name in querystring
bool m_propagate; // true if this option can be propagated bool m_propagate; // true if this option can be propagated
QString m_configName; // name of config setting in config file TQString m_configName; // name of config setting in config file
Option() Option()
{ {
@ -109,7 +109,7 @@ namespace KioSword
* @param qsLongName the long name for the option when use in a query string * @param qsLongName the long name for the option when use in a query string
* @param propagate true if this parameter can be propagated in generated query strings * @param propagate true if this parameter can be propagated in generated query strings
*/ */
void setup(const T& default_value, const QString& configName, const QString& qsShortName, const QString& qsLongName, bool propagate) void setup(const T& default_value, const TQString& configName, const TQString& qsShortName, const TQString& qsLongName, bool propagate)
{ {
m_value = default_value; m_value = default_value;
m_default_value = default_value; m_default_value = default_value;
@ -135,7 +135,7 @@ namespace KioSword
} }
/** read and set the option from the querystring */ /** read and set the option from the querystring */
virtual void readFromQueryString(QMap<QString, QString> params, bool allowPropagating) virtual void readFromQueryString(TQMap<TQString, TQString> params, bool allowPropagating)
{ {
T newval; T newval;
bool found = false; bool found = false;
@ -146,7 +146,7 @@ namespace KioSword
m_propagate_value = m_config_value;*/ m_propagate_value = m_config_value;*/
// Search for short name // Search for short name
QMap<QString, QString>::const_iterator it = params.find(m_qsShortName); TQMap<TQString, TQString>::const_iterator it = params.find(m_qsShortName);
if (it != params.end()) if (it != params.end())
{ {
newval = fromString(it.data()); newval = fromString(it.data());
@ -170,7 +170,7 @@ namespace KioSword
} }
/** set the name and value of a query string pair */ /** set the name and value of a query string pair */
virtual void getQueryStringPair(QString& name, QString& val) virtual void getQueryStringPair(TQString& name, TQString& val)
{ {
// To keep things tidy, we don't propagate in the // To keep things tidy, we don't propagate in the
// query string values that wouldn't make a difference // query string values that wouldn't make a difference
@ -238,7 +238,7 @@ namespace KioSword
// fromString specialisations // fromString specialisations
template<> template<>
inline const bool Option<bool>::fromString(const QString& val) inline const bool Option<bool>::fromString(const TQString& val)
{ {
if (val == "0") if (val == "0")
return false; return false;
@ -247,34 +247,34 @@ namespace KioSword
} }
template<> template<>
inline const QString Option<QString>::fromString(const QString& val) inline const TQString Option<TQString>::fromString(const TQString& val)
{ {
return val; return val;
} }
template<> template<>
inline const int Option<int>::fromString(const QString& val) inline const int Option<int>::fromString(const TQString& val)
{ {
return val.toInt(); return val.toInt();
} }
// toString specialisations // toString specialisations
template<> template<>
inline QString Option<bool>::toString(bool val) inline TQString Option<bool>::toString(bool val)
{ {
return val ? QString("1"): QString("0"); return val ? TQString("1"): TQString("0");
} }
template<> template<>
inline QString Option<QString>::toString(QString val) inline TQString Option<TQString>::toString(TQString val)
{ {
return val; return val;
} }
template<> template<>
inline QString Option<int>::toString(int val) inline TQString Option<int>::toString(int val)
{ {
return QString::number(val); return TQString::number(val);
} }
// readConfigSetting specialisations // readConfigSetting specialisations
@ -285,7 +285,7 @@ namespace KioSword
} }
template<> template<>
inline QString Option<QString>::readConfigSetting(const KConfig* config) inline TQString Option<TQString>::readConfigSetting(const KConfig* config)
{ {
return config->readEntry(m_configName, m_default_value); return config->readEntry(m_configName, m_default_value);
} }

@ -48,8 +48,8 @@
#include <klocale.h> #include <klocale.h>
// QT // QT
#include <qstring.h> #include <ntqstring.h>
#include <qstringlist.h> #include <ntqstringlist.h>
// Standard C/C++ // Standard C/C++
#include <vector> #include <vector>
@ -66,32 +66,32 @@ using namespace sword;
namespace KioSword namespace KioSword
{ {
static const QString prev(" <li><a href=\"%2\" accesskey=\"p\">&laquo %1</a>"); static const TQString prev(" <li><a href=\"%2\" accesskey=\"p\">&laquo %1</a>");
static QString makePrevLink(const QString& caption, const QString& url) static TQString makePrevLink(const TQString& caption, const TQString& url)
{ {
return prev.arg(caption).arg(url); return prev.arg(caption).arg(url);
} }
static const QString next(" <li><a href=\"%2\" accesskey=\"n\">%1 &raquo</a>"); static const TQString next(" <li><a href=\"%2\" accesskey=\"n\">%1 &raquo</a>");
static QString makeNextLink(const QString& caption, const QString& url) static TQString makeNextLink(const TQString& caption, const TQString& url)
{ {
return next.arg(caption).arg(url); return next.arg(caption).arg(url);
} }
static const QString treeup(" <li><a href=\"%3\" accesskey=\"u\">%1 %2</a>"); static const TQString treeup(" <li><a href=\"%3\" accesskey=\"u\">%1 %2</a>");
static QString makeTreeUpLink(const QString& caption1, const QString& caption2, const QString& url) static TQString makeTreeUpLink(const TQString& caption1, const TQString& caption2, const TQString& url)
{ {
return treeup.arg(caption1).arg(caption2).arg(url); return treeup.arg(caption1).arg(caption2).arg(url);
} }
static const QString bibleup(" <li><a href=\"%2\" accesskey=\"u\">%1</a>"); static const TQString bibleup(" <li><a href=\"%2\" accesskey=\"u\">%1</a>");
static QString makeBibleUpLink(const QString& caption, const QString& url) static TQString makeBibleUpLink(const TQString& caption, const TQString& url)
{ {
return bibleup.arg(caption).arg(url); return bibleup.arg(caption).arg(url);
} }
static const QString genlink(" <li><a href=\"%2\">%1</a>"); static const TQString genlink(" <li><a href=\"%2\">%1</a>");
static QString makeGeneralLink(const QString& caption, const QString& url) static TQString makeGeneralLink(const TQString& caption, const TQString& url)
{ {
return genlink.arg(caption).arg(url); return genlink.arg(caption).arg(url);
} }
@ -106,7 +106,7 @@ namespace KioSword
{ {
for (int i = 0; i < NUM_MODULE_TYPES; i++) { for (int i = 0; i < NUM_MODULE_TYPES; i++) {
m_moduleTypes.push_back(""); m_moduleTypes.push_back("");
m_moduleTypeNames.push_back(QString("")); m_moduleTypeNames.push_back(TQString(""));
} }
m_moduleTypes[BIBLE] = "Biblical Texts"; m_moduleTypes[BIBLE] = "Biblical Texts";
@ -156,9 +156,9 @@ namespace KioSword
/** Return an HTML hyperlinked list of all modules, /** Return an HTML hyperlinked list of all modules,
* categorised, and including descriptions * categorised, and including descriptions
*/ */
QString Renderer::listModules(const SwordOptions &options) { TQString Renderer::listModules(const SwordOptions &options) {
QString output; TQString output;
QString temp; TQString temp;
ModMap::iterator it; ModMap::iterator it;
vector<const char *>::size_type i; vector<const char *>::size_type i;
SWModule *curMod; SWModule *curMod;
@ -170,16 +170,16 @@ namespace KioSword
return output; return output;
} }
output += QString("<div class='moduleslist'><h1>%1</h1>") output += TQString("<div class='moduleslist'><h1>%1</h1>")
.arg(i18n("Modules")); .arg(i18n("Modules"));
for (i = 0; i < m_moduleTypes.size(); i++) { for (i = 0; i < m_moduleTypes.size(); i++) {
output += QString("<h2 class='moduletype'>%1</h2>\n" output += TQString("<h2 class='moduletype'>%1</h2>\n"
"<ul>\n").arg(m_moduleTypeNames[i]); "<ul>\n").arg(m_moduleTypeNames[i]);
for (it = Modules.begin(); it != Modules.end(); it++) { for (it = Modules.begin(); it != Modules.end(); it++) {
curMod = (*it).second; curMod = (*it).second;
if (!strcmp(curMod->Type(), m_moduleTypes[i])) { if (!strcmp(curMod->Type(), m_moduleTypes[i])) {
output += QString("<li class='module'><a class='module' href=\"%3\">%1</a> : %2\n") output += TQString("<li class='module'><a class='module' href=\"%3\">%1</a> : %2\n")
.arg(curMod->Name()) .arg(curMod->Name())
.arg(curMod->Description()) .arg(curMod->Description())
.arg(swordUrl(curMod->Name(), options)); .arg(swordUrl(curMod->Name(), options));
@ -194,14 +194,14 @@ namespace KioSword
/** Return a sorted list of all module names /** Return a sorted list of all module names
* *
*/ */
QStringList Renderer::moduleList() { TQStringList Renderer::moduleList() {
QStringList output; TQStringList output;
ModMap::iterator it; ModMap::iterator it;
SWModule *curMod; SWModule *curMod;
for (it = Modules.begin(); it != Modules.end(); it++) { for (it = Modules.begin(); it != Modules.end(); it++) {
curMod = (*it).second; curMod = (*it).second;
output += QString(curMod->Name()); output += TQString(curMod->Name());
} }
output.sort(); output.sort();
return output; return output;
@ -318,8 +318,8 @@ namespace KioSword
} }
void Renderer::moduleQuery(const QString &modname, const QString &ref, const SwordOptions &options, Template* tmplt) { void Renderer::moduleQuery(const TQString &modname, const TQString &ref, const SwordOptions &options, Template* tmplt) {
QString nav; TQString nav;
SWModule *module = 0; SWModule *module = 0;
SWKey *skey = 0; SWKey *skey = 0;
KeyType keyt = SWKEY; KeyType keyt = SWKEY;
@ -335,7 +335,7 @@ namespace KioSword
module = getModule(modname.latin1()); module = getModule(modname.latin1());
if (module == 0) { if (module == 0) {
QString output; TQString output;
output += "<p><span class='error'>" output += "<p><span class='error'>"
+ i18n("The module '%1' could not be found.").arg(modname) + i18n("The module '%1' could not be found.").arg(modname)
+ "</span></p><hr/>"; + "</span></p><hr/>";
@ -360,7 +360,7 @@ namespace KioSword
} }
modtype = getModuleType(module); modtype = getModuleType(module);
nav += QString("<li class='first'>%1 <a href=\"%3\">%2</a></li>") nav += TQString("<li class='first'>%1 <a href=\"%3\">%2</a></li>")
.arg(i18n("Module:")) .arg(i18n("Module:"))
.arg(modname) .arg(modname)
.arg(swordUrl(modname, options)); .arg(swordUrl(modname, options));
@ -378,12 +378,12 @@ namespace KioSword
return; return;
} }
QString Renderer::search(const QString &modname, const QString &query, const SearchType searchType, const SwordOptions &options) { TQString Renderer::search(const TQString &modname, const TQString &query, const SearchType searchType, const SwordOptions &options) {
SWModule *module = 0; SWModule *module = 0;
QString output; TQString output;
ListKey lk; ListKey lk;
int stype = SEARCH_WORDS; int stype = SEARCH_WORDS;
QString stypename; TQString stypename;
ModuleType modtype; ModuleType modtype;
setOptions(options); setOptions(options);
@ -413,7 +413,7 @@ namespace KioSword
} }
output += "<div class='searchresults'><h1>" + i18n("Search results:") + "</h1>"; output += "<div class='searchresults'><h1>" + i18n("Search results:") + "</h1>";
output += QString("<table><tr><td>%1</td><td><b>%2</b></td></tr><tr><td>%3</td><td><b>%4</b></td></tr><tr><td>%5</td><td><b>%6</b></td></tr></table>") output += TQString("<table><tr><td>%1</td><td><b>%2</b></td></tr><tr><td>%3</td><td><b>%4</b></td></tr><tr><td>%5</td><td><b>%6</b></td></tr></table>")
.arg(i18n("Module:")) .arg(i18n("Module:"))
.arg(modname) .arg(modname)
.arg(i18n("Query:")) .arg(i18n("Query:"))
@ -429,17 +429,17 @@ namespace KioSword
output += "<p>" + i18n("1 match returned:", "%1 matches returned:", lk.Count()).arg(lk.Count()); output += "<p>" + i18n("1 match returned:", "%1 matches returned:", lk.Count()).arg(lk.Count());
output += "<ul>"; output += "<ul>";
for (int i = 0; i < lk.Count(); ++i) { for (int i = 0; i < lk.Count(); ++i) {
QString ref; TQString ref;
ref = QString::fromUtf8(lk.getElement(i)->getText()); ref = TQString::fromUtf8(lk.getElement(i)->getText());
if (modtype == BIBLE) { if (modtype == BIBLE) {
module->setKey(lk.getElement(i)); module->setKey(lk.getElement(i));
output += QString("<li><a href=\"%3\">%1</a>: %2</li>") output += TQString("<li><a href=\"%3\">%1</a>: %2</li>")
.arg(ref) .arg(ref)
.arg(renderText(module)) .arg(renderText(module))
.arg(swordUrl(modname, ref, options)); .arg(swordUrl(modname, ref, options));
} else { } else {
output += QString("<li><a href=\"%2\">%1</a></li>") output += TQString("<li><a href=\"%2\">%1</a></li>")
.arg(ref) .arg(ref)
.arg(swordUrl(modname, ref, options)); .arg(swordUrl(modname, ref, options));
} }
@ -450,17 +450,17 @@ namespace KioSword
return output; return output;
} }
QString Renderer::renderText(SWModule *module) { TQString Renderer::renderText(SWModule *module) {
return QString::fromUtf8(module->RenderText()); return TQString::fromUtf8(module->RenderText());
} }
/** Fill in template with formatted text for the query of a verse based module /** Fill in template with formatted text for the query of a verse based module
* Links are appended to navlinks. * Links are appended to navlinks.
*/ */
void Renderer::verseQuery(SWModule *module, const QString &ref, const SwordOptions &options, void Renderer::verseQuery(SWModule *module, const TQString &ref, const SwordOptions &options,
ModuleType modtype, Template* tmplt, QString &navlinks) { ModuleType modtype, Template* tmplt, TQString &navlinks) {
QString modname(module->Name()); TQString modname(module->Name());
QString text; TQString text;
bool doindex = false; bool doindex = false;
const char* modtextdir; // text direction of the module const char* modtextdir; // text direction of the module
@ -505,13 +505,13 @@ namespace KioSword
// List books and link for viewing entire book // List books and link for viewing entire book
SwordOptions options_wholebook(options); SwordOptions options_wholebook(options);
options_wholebook.wholeBook.set(true); // set just for creating the URL options_wholebook.wholeBook.set(true); // set just for creating the URL
text += QString("<h2>%1</h2>" text += TQString("<h2>%1</h2>"
"<p>%2</p>" "<p>%2</p>"
"<p class='chapterlist'>%3</p>") "<p class='chapterlist'>%3</p>")
.arg(element->getBookName()) .arg(element->getBookName())
.arg(i18n("Chapters:")) .arg(i18n("Chapters:"))
.arg(chapterList(modname, element, options)) .arg(chapterList(modname, element, options))
+ QString("<p><a href=\"%2\">%1</a></p>") + TQString("<p><a href=\"%2\">%1</a></p>")
.arg(i18n("View entire book.")) .arg(i18n("View entire book."))
.arg(swordUrl(module->Name(), element->getBookName(), options_wholebook)); .arg(swordUrl(module->Name(), element->getBookName(), options_wholebook));
if (!upToBookListShown) if (!upToBookListShown)
@ -558,7 +558,7 @@ namespace KioSword
text += "</div>"; text += "</div>";
inDirectionedDiv = false; inDirectionedDiv = false;
} }
text += "<h2>" + QString(curvk->getBookName()) + "</h2>"; text += "<h2>" + TQString(curvk->getBookName()) + "</h2>";
chapter = 0; chapter = 0;
} }
if (curvk->Chapter() != chapter) { if (curvk->Chapter() != chapter) {
@ -572,12 +572,12 @@ namespace KioSword
} }
if (!inDirectionedDiv) { if (!inDirectionedDiv) {
text += QString("<div dir='%1'>").arg(modtextdir); text += TQString("<div dir='%1'>").arg(modtextdir);
inDirectionedDiv = true; inDirectionedDiv = true;
} }
if (options.verseNumbers() && modtype == BIBLE) { if (options.verseNumbers() && modtype == BIBLE) {
text += QString("<a class=\"versenumber\" href=\"%2\">%1</a> ") text += TQString("<a class=\"versenumber\" href=\"%2\">%1</a> ")
.arg(curvk->Verse()) .arg(curvk->Verse())
.arg(swordUrl(module->Name(), module->KeyText(), options)); .arg(swordUrl(module->Name(), module->KeyText(), options));
} }
@ -617,8 +617,8 @@ namespace KioSword
// Single verse // Single verse
module->Key(*lk.GetElement(i)); module->Key(*lk.GetElement(i));
element = dynamic_cast<VerseKey*>(module->getKey()); element = dynamic_cast<VerseKey*>(module->getKey());
text += QString("<h3>%1</h3>").arg(module->KeyText()); text += TQString("<h3>%1</h3>").arg(module->KeyText());
text += QString("<div dir='%1'>").arg(modtextdir); text += TQString("<div dir='%1'>").arg(modtextdir);
text += renderText(module); text += renderText(module);
text += "</div>"; text += "</div>";
if (lk.Count() == 1) if (lk.Count() == 1)
@ -631,27 +631,27 @@ namespace KioSword
} while (false); } while (false);
// Title: depends on what got printed above // Title: depends on what got printed above
QString title; TQString title;
if (doindex) { if (doindex) {
if (!text.isEmpty()) { // an error message was printed if (!text.isEmpty()) { // an error message was printed
text = QString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description()).arg(ref) text = TQString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description()).arg(ref)
+ text; + text;
title = "Error - Kio-Sword"; title = "Error - Kio-Sword";
} }
else else
{ {
title = QString("%1 - Kio-Sword").arg(module->Name()); title = TQString("%1 - Kio-Sword").arg(module->Name());
} }
} else { } else {
if (modtype == COMMENTARY) { if (modtype == COMMENTARY) {
text = QString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description()) text = TQString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description())
+ text; + text;
title = QString("%1 - %2 - Kio-Sword") title = TQString("%1 - %2 - Kio-Sword")
.arg(lk.getShortText()) .arg(lk.getShortText())
.arg(module->Name()); .arg(module->Name());
} else if (modtype == BIBLE) { } else if (modtype == BIBLE) {
text += QString("<div class=\"biblename\">(%1)</div>").arg(module->Description()); text += TQString("<div class=\"biblename\">(%1)</div>").arg(module->Description());
title = QString("%1 - %2 - Kio-Sword") title = TQString("%1 - %2 - Kio-Sword")
.arg(lk.getShortText()) .arg(lk.getShortText())
.arg(module->Name()); .arg(module->Name());
} }
@ -667,7 +667,7 @@ namespace KioSword
} else { } else {
SwordOptions options_doindex(options); SwordOptions options_doindex(options);
options_doindex.doBibleIndex.set(true); options_doindex.doBibleIndex.set(true);
text += QString("<p><a href=\"%2\">%1</a></p>") text += TQString("<p><a href=\"%2\">%1</a></p>")
.arg(i18n("Index of books")) .arg(i18n("Index of books"))
.arg(swordUrl(modname, options_doindex)); .arg(swordUrl(modname, options_doindex));
} }
@ -675,17 +675,17 @@ namespace KioSword
tmplt->setContent(text); tmplt->setContent(text);
} }
void Renderer::treeQuery(SWModule *module, const QString &ref, const SwordOptions &options, void Renderer::treeQuery(SWModule *module, const TQString &ref, const SwordOptions &options,
ModuleType modtype, Template* tmplt, QString &navlinks) { ModuleType modtype, Template* tmplt, TQString &navlinks) {
QString output; TQString output;
QString modname(module->Name()); TQString modname(module->Name());
bool doindex; bool doindex;
TreeKey *tk = dynamic_cast<TreeKey*>(module->getKey()); TreeKey *tk = dynamic_cast<TreeKey*>(module->getKey());
if (!tk) if (!tk)
return; return;
output += QString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description()); output += TQString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description());
if (ref.isEmpty()) { if (ref.isEmpty()) {
doindex = true; doindex = true;
} else { } else {
@ -697,17 +697,17 @@ namespace KioSword
output += "<hr/>"; output += "<hr/>";
doindex = true; doindex = true;
} else { } else {
QString link; TQString link;
output += renderText(module); output += renderText(module);
if (tk->previousSibling()) { if (tk->previousSibling()) {
link = QString::fromUtf8(module->KeyText()); // FIXME ? local8Bit or utf8 link = TQString::fromUtf8(module->KeyText()); // FIXME ? local8Bit or utf8
navlinks += makePrevLink(shorten(link.section('/', -1, -1), 20), navlinks += makePrevLink(shorten(link.section('/', -1, -1), 20),
swordUrl(modname, link, options)); swordUrl(modname, link, options));
tk->nextSibling(); tk->nextSibling();
} }
SWKey *saved = tk->clone(); SWKey *saved = tk->clone();
if (tk->parent()) { if (tk->parent()) {
link = QString::fromUtf8(module->KeyText()); link = TQString::fromUtf8(module->KeyText());
navlinks += makeTreeUpLink(i18n("Up:"), navlinks += makeTreeUpLink(i18n("Up:"),
shorten(link.section('/', -1, -1), 20), shorten(link.section('/', -1, -1), 20),
swordUrl(modname, link, options)); swordUrl(modname, link, options));
@ -715,7 +715,7 @@ namespace KioSword
} }
delete saved; delete saved;
if (tk->nextSibling()) { if (tk->nextSibling()) {
link = QString::fromUtf8(module->KeyText()); link = TQString::fromUtf8(module->KeyText());
navlinks += makeNextLink(shorten(link.section('/', -1, -1), 20), navlinks += makeNextLink(shorten(link.section('/', -1, -1), 20),
swordUrl(modname, link, options)); swordUrl(modname, link, options));
tk->previousSibling(); tk->previousSibling();
@ -734,35 +734,35 @@ namespace KioSword
if (options.doFullTreeIndex()) { if (options.doFullTreeIndex()) {
options_doindex.doFullTreeIndex.set(false); options_doindex.doFullTreeIndex.set(false);
output += indexTree(module, options, true, -1); output += indexTree(module, options, true, -1);
output += QString("<p><a href=\"%2\">%1</a></p>") output += TQString("<p><a href=\"%2\">%1</a></p>")
.arg(i18n("View simple index")) .arg(i18n("View simple index"))
.arg(swordUrl(modname, options_doindex)); .arg(swordUrl(modname, options_doindex));
} else { } else {
options_doindex.doFullTreeIndex.set(true); options_doindex.doFullTreeIndex.set(true);
output += indexTree(module, options, true, 1); output += indexTree(module, options, true, 1);
output += QString("<p><a href=\"%2\">%1</a></p>") output += TQString("<p><a href=\"%2\">%1</a></p>")
.arg(i18n("View full index")) .arg(i18n("View full index"))
.arg(swordUrl(modname, options_doindex)); .arg(swordUrl(modname, options_doindex));
} }
tmplt->setTitle(QString("%1 - %2 - Kio-Sword").arg(tk->getShortText()).arg(module->Name())); tmplt->setTitle(TQString("%1 - %2 - Kio-Sword").arg(tk->getShortText()).arg(module->Name()));
} }
else else
{ {
tmplt->setTitle(QString("%1 - Kio-Sword").arg(module->Name())); tmplt->setTitle(TQString("%1 - Kio-Sword").arg(module->Name()));
} }
tmplt->setContent(output); tmplt->setContent(output);
} }
void Renderer::normalQuery(SWModule *module, const QString &ref, const SwordOptions &options, void Renderer::normalQuery(SWModule *module, const TQString &ref, const SwordOptions &options,
ModuleType modtype, Template* tmplt, QString &navlinks) { ModuleType modtype, Template* tmplt, TQString &navlinks) {
QString output; TQString output;
QString modname(module->Name()); TQString modname(module->Name());
bool doindex; bool doindex;
SWKey *skey = module->getKey(); SWKey *skey = module->getKey();
output += QString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description()); output += TQString("<h1 class=\"moduletitle\">%1</h1>").arg(module->Description());
if (ref.isEmpty()) { if (ref.isEmpty()) {
doindex = true; doindex = true;
@ -771,14 +771,14 @@ namespace KioSword
skey->setText(ref.utf8()); skey->setText(ref.utf8());
doindex = false; doindex = false;
if (skey->Error()) { if (skey->Error()) {
output += "<p class=\"error\">" + QString(i18n("Couldn't find reference '%1'.")).arg(ref) + "</p>"; output += "<p class=\"error\">" + TQString(i18n("Couldn't find reference '%1'.")).arg(ref) + "</p>";
output += "<hr>"; output += "<hr>";
doindex = true; doindex = true;
} else { } else {
output += QString("<h3>%1</h3>").arg(module->KeyText()); output += TQString("<h3>%1</h3>").arg(module->KeyText());
output += renderText(module); output += renderText(module);
module->decrement(); module->decrement();
QString link; TQString link;
if (!module->Error()) { if (!module->Error()) {
link = module->KeyText(); link = module->KeyText();
navlinks += makePrevLink(link, swordUrl(modname, link, options)); navlinks += makePrevLink(link, swordUrl(modname, link, options));
@ -800,7 +800,7 @@ namespace KioSword
output += indexBook(module, options); output += indexBook(module, options);
} else { } else {
output += QString("<form action='%2' method='get'>" output += TQString("<form action='%2' method='get'>"
"%1 <input type='text' name='query'>" "%1 <input type='text' name='query'>"
"</form>") "</form>")
.arg(i18n("Enter query term: ")) .arg(i18n("Enter query term: "))
@ -809,15 +809,15 @@ namespace KioSword
SwordOptions options_doindex(options); SwordOptions options_doindex(options);
options_doindex.doDictIndex.set(true); options_doindex.doDictIndex.set(true);
options_doindex.doOtherIndex.set(true); options_doindex.doOtherIndex.set(true);
output += QString("<p><a href=\"%2\">%1</a></p>") output += TQString("<p><a href=\"%2\">%1</a></p>")
.arg(i18n("View complete index")) .arg(i18n("View complete index"))
.arg(swordUrl(modname, options_doindex)); .arg(swordUrl(modname, options_doindex));
} }
tmplt->setTitle(QString("%1 - Kio-Sword").arg(module->Name())); tmplt->setTitle(TQString("%1 - Kio-Sword").arg(module->Name()));
} }
else else
{ {
tmplt->setTitle(QString("%1 - %2 - Kio-Sword").arg(skey->getShortText()).arg(module->Name())); tmplt->setTitle(TQString("%1 - %2 - Kio-Sword").arg(skey->getShortText()).arg(module->Name()));
} }
tmplt->setContent(output); tmplt->setContent(output);
} }
@ -827,8 +827,8 @@ namespace KioSword
* @param module The module to retrieve. Must be a Bible/commentary * @param module The module to retrieve. Must be a Bible/commentary
*/ */
QString Renderer::indexBible(SWModule *module, const SwordOptions& options) { TQString Renderer::indexBible(SWModule *module, const SwordOptions& options) {
QString output; TQString output;
char book; char book;
char testament; char testament;
VerseKey *vk = dynamic_cast<VerseKey*>(module->getKey()); VerseKey *vk = dynamic_cast<VerseKey*>(module->getKey());
@ -847,7 +847,7 @@ namespace KioSword
output += "<ul>\n"; output += "<ul>\n";
while (vk->Testament() == testament) { while (vk->Testament() == testament) {
while (vk->Book() == book && !module->Error()) { while (vk->Book() == book && !module->Error()) {
output += QString("<li><a href=\"%2\">%1</a>\n") output += TQString("<li><a href=\"%2\">%1</a>\n")
.arg(vk->getBookName()) .arg(vk->getBookName())
.arg(swordUrl(module->Name(), vk->getBookName(), options)); .arg(swordUrl(module->Name(), vk->getBookName(), options));
vk->Book(++book); vk->Book(++book);
@ -869,15 +869,15 @@ namespace KioSword
* @param module The module to retrieve. Must have key type SWKey * @param module The module to retrieve. Must have key type SWKey
*/ */
QString Renderer::indexBook(SWModule *module, const SwordOptions& options) { TQString Renderer::indexBook(SWModule *module, const SwordOptions& options) {
QString output; TQString output;
QString ref; TQString ref;
module->setPosition(sword::TOP); module->setPosition(sword::TOP);
output += "<ul>\n"; output += "<ul>\n";
do { do {
ref = QString::fromUtf8(module->KeyText()); ref = TQString::fromUtf8(module->KeyText());
output += QString("<li><a href=\"%2\">%1</a></li>") output += TQString("<li><a href=\"%2\">%1</a></li>")
.arg(ref) .arg(ref)
.arg(swordUrl(module->Name(), ref, options)); .arg(swordUrl(module->Name(), ref, options));
(*module)++; (*module)++;
@ -892,9 +892,9 @@ namespace KioSword
* @param fromTop If true, get the index from the top level * @param fromTop If true, get the index from the top level
* @param depth How many levels to scan, -1 for all * @param depth How many levels to scan, -1 for all
*/ */
QString Renderer::indexTree(SWModule *module, const SwordOptions& options, bool fromTop, const int depth) { TQString Renderer::indexTree(SWModule *module, const SwordOptions& options, bool fromTop, const int depth) {
QString output; TQString output;
QString ref; TQString ref;
bool gonext; bool gonext;
bool cont; bool cont;
@ -914,8 +914,8 @@ namespace KioSword
gonext = false; gonext = false;
do { do {
if (!gonext) { if (!gonext) {
ref = QString::fromUtf8(module->KeyText()); ref = TQString::fromUtf8(module->KeyText());
output += QString("<li><a href=\"%2\">%1</a>\n") output += TQString("<li><a href=\"%2\">%1</a>\n")
.arg(ref.section('/', -1)) .arg(ref.section('/', -1))
.arg(swordUrl(module->Name(), ref, options)); .arg(swordUrl(module->Name(), ref, options));
} }
@ -951,13 +951,13 @@ namespace KioSword
} }
QString Renderer::chapterList(const QString &modname, const VerseKey *vk, const SwordOptions& options) { TQString Renderer::chapterList(const TQString &modname, const VerseKey *vk, const SwordOptions& options) {
VerseKey cp(vk->LowerBound()); VerseKey cp(vk->LowerBound());
QString output; TQString output;
do { do {
cp.Verse(0); cp.Verse(0);
if (!output.isNull()) output += " | "; if (!output.isNull()) output += " | ";
output += QString("<a href=\"%2\">%1</a>") output += TQString("<a href=\"%2\">%1</a>")
.arg(cp.Chapter()) .arg(cp.Chapter())
.arg(chapterLink(modname, &cp, options)); .arg(chapterLink(modname, &cp, options));
cp.Chapter(cp.Chapter()+1); cp.Chapter(cp.Chapter()+1);
@ -965,63 +965,63 @@ namespace KioSword
return output; return output;
} }
QString Renderer::chapterLink(const QString &modname, const VerseKey *vk, const SwordOptions& options) { TQString Renderer::chapterLink(const TQString &modname, const VerseKey *vk, const SwordOptions& options) {
return swordUrl(modname, bookChapter(vk), options); return swordUrl(modname, bookChapter(vk), options);
} }
QString Renderer::chapterLink(const QString &modname, const SWKey *sk, const SwordOptions& options) { TQString Renderer::chapterLink(const TQString &modname, const SWKey *sk, const SwordOptions& options) {
const VerseKey *vk = dynamic_cast<const VerseKey*>(sk); const VerseKey *vk = dynamic_cast<const VerseKey*>(sk);
if (vk) if (vk)
return chapterLink(modname, vk, options); return chapterLink(modname, vk, options);
else else
return QString::null; return TQString::null;
} }
QString Renderer::bookLink(const QString &modname, const VerseKey *vk, const SwordOptions& options) { TQString Renderer::bookLink(const TQString &modname, const VerseKey *vk, const SwordOptions& options) {
return swordUrl(modname, bookName(vk), options); return swordUrl(modname, bookName(vk), options);
} }
QString Renderer::bookLink(const QString &modname, const SWKey *sk, const SwordOptions& options) { TQString Renderer::bookLink(const TQString &modname, const SWKey *sk, const SwordOptions& options) {
const VerseKey *vk = dynamic_cast<const VerseKey*>(sk); const VerseKey *vk = dynamic_cast<const VerseKey*>(sk);
if (vk) if (vk)
return bookLink(modname, vk, options); return bookLink(modname, vk, options);
else else
return QString::null; return TQString::null;
} }
QString Renderer::bookChapter(const VerseKey *vk) { TQString Renderer::bookChapter(const VerseKey *vk) {
return QString("%1 %2").arg(vk->getBookName()).arg(vk->Chapter()); return TQString("%1 %2").arg(vk->getBookName()).arg(vk->Chapter());
} }
QString Renderer::bookChapter(const SWKey *sk) { TQString Renderer::bookChapter(const SWKey *sk) {
const VerseKey *vk = dynamic_cast<const VerseKey*>(sk); const VerseKey *vk = dynamic_cast<const VerseKey*>(sk);
if (vk) if (vk)
return bookChapter(vk); return bookChapter(vk);
else else
return QString::null; return TQString::null;
} }
QString Renderer::bookName(const VerseKey *vk) { TQString Renderer::bookName(const VerseKey *vk) {
return QString(vk->getBookName()); return TQString(vk->getBookName());
} }
QString Renderer::bookName(const SWKey *sk) { TQString Renderer::bookName(const SWKey *sk) {
const VerseKey *vk = dynamic_cast<const VerseKey*>(sk); const VerseKey *vk = dynamic_cast<const VerseKey*>(sk);
if (vk) if (vk)
return bookName(vk); return bookName(vk);
else else
return QString::null; return TQString::null;
} }
QStringList Renderer::availableLocales() TQStringList Renderer::availableLocales()
{ {
list<SWBuf> locales = LocaleMgr::getSystemLocaleMgr()->getAvailableLocales(); list<SWBuf> locales = LocaleMgr::getSystemLocaleMgr()->getAvailableLocales();
list<SWBuf>::const_iterator it; list<SWBuf>::const_iterator it;
list<SWBuf>::const_iterator it_end = locales.end(); list<SWBuf>::const_iterator it_end = locales.end();
QStringList output; TQStringList output;
for (it = locales.begin(); it != it_end; it++) for (it = locales.begin(); it != it_end; it++)
{ {
output.append(QString((*it).c_str())); output.append(TQString((*it).c_str()));
} }
return output; return output;
} }

@ -29,8 +29,8 @@
#include <swmodule.h> #include <swmodule.h>
#include <versekey.h> #include <versekey.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstringlist.h> #include <ntqstringlist.h>
#include <functional> #include <functional>
#include <vector> #include <vector>
@ -71,16 +71,16 @@ namespace KioSword {
* @param options Options for rendering text * @param options Options for rendering text
* @param tmplt Output parameter that should be filled with title and content * @param tmplt Output parameter that should be filled with title and content
*/ */
void moduleQuery(const QString &module, const QString &ref, const SwordOptions &options, Template* tmplt); void moduleQuery(const TQString &module, const TQString &ref, const SwordOptions &options, Template* tmplt);
QString search(const QString &module, const QString &query, SearchType stype, const SwordOptions &options); TQString search(const TQString &module, const TQString &query, SearchType stype, const SwordOptions &options);
/** Return an HTML snippet containing a hyperlinked table of modules /** Return an HTML snippet containing a hyperlinked table of modules
*/ */
QString listModules(const SwordOptions &options); TQString listModules(const SwordOptions &options);
void setOptions(const SwordOptions &options); void setOptions(const SwordOptions &options);
QStringList moduleList(); TQStringList moduleList();
QStringList availableLocales(); TQStringList availableLocales();
protected: protected:
@ -89,31 +89,31 @@ namespace KioSword {
void setModuleFilter(sword::SWModule *module, const SwordOptions* options); void setModuleFilter(sword::SWModule *module, const SwordOptions* options);
ModuleType getModuleType(sword::SWModule *module); ModuleType getModuleType(sword::SWModule *module);
QString indexBible(sword::SWModule *module, const SwordOptions& options); TQString indexBible(sword::SWModule *module, const SwordOptions& options);
QString indexBook(sword::SWModule *module, const SwordOptions& options); TQString indexBook(sword::SWModule *module, const SwordOptions& options);
QString indexTree(sword::SWModule *module, const SwordOptions& options, bool fromTop, const int depth = -1); TQString indexTree(sword::SWModule *module, const SwordOptions& options, bool fromTop, const int depth = -1);
void verseQuery(sword::SWModule *module, const QString &query, const SwordOptions &options, void verseQuery(sword::SWModule *module, const TQString &query, const SwordOptions &options,
ModuleType modtype, Template* tmplt, QString &navlinks); ModuleType modtype, Template* tmplt, TQString &navlinks);
void treeQuery(sword::SWModule *module, const QString &query, const SwordOptions &options, void treeQuery(sword::SWModule *module, const TQString &query, const SwordOptions &options,
ModuleType modtype, Template* tmplt, QString &navlinks); ModuleType modtype, Template* tmplt, TQString &navlinks);
void normalQuery(sword::SWModule *module, const QString &query, const SwordOptions &options, void normalQuery(sword::SWModule *module, const TQString &query, const SwordOptions &options,
ModuleType modtype, Template* tmplt, QString &navlinks); ModuleType modtype, Template* tmplt, TQString &navlinks);
static QString renderText(sword::SWModule *module); static TQString renderText(sword::SWModule *module);
static QString chapterList(const QString &modname, const sword::VerseKey *vk, const SwordOptions& options); static TQString chapterList(const TQString &modname, const sword::VerseKey *vk, const SwordOptions& options);
static QString chapterLink(const QString &modname, const sword::VerseKey *vk, const SwordOptions& options); static TQString chapterLink(const TQString &modname, const sword::VerseKey *vk, const SwordOptions& options);
static QString chapterLink(const QString &modname, const sword::SWKey *sk, const SwordOptions& options); static TQString chapterLink(const TQString &modname, const sword::SWKey *sk, const SwordOptions& options);
static QString bookLink(const QString &modname, const sword::VerseKey *vk, const SwordOptions& options); static TQString bookLink(const TQString &modname, const sword::VerseKey *vk, const SwordOptions& options);
static QString bookLink(const QString &modname, const sword::SWKey *sk, const SwordOptions& options); static TQString bookLink(const TQString &modname, const sword::SWKey *sk, const SwordOptions& options);
static QString bookChapter(const sword::SWKey *sk); static TQString bookChapter(const sword::SWKey *sk);
static QString bookChapter(const sword::VerseKey *vk); static TQString bookChapter(const sword::VerseKey *vk);
static QString bookName(const sword::SWKey *sk); static TQString bookName(const sword::SWKey *sk);
static QString bookName(const sword::VerseKey *vk); static TQString bookName(const sword::VerseKey *vk);
FilterBase *m_osisfilter; FilterBase *m_osisfilter;
FilterBase *m_gbffilter; FilterBase *m_gbffilter;
@ -123,7 +123,7 @@ namespace KioSword {
std::set<sword::SWModule *, std::less<sword::SWModule *> > m_modset; std::set<sword::SWModule *, std::less<sword::SWModule *> > m_modset;
std::vector<const char *> m_moduleTypes; std::vector<const char *> m_moduleTypes;
std::vector<QString> m_moduleTypeNames; std::vector<TQString> m_moduleTypeNames;
}; };
} }

@ -57,9 +57,9 @@ namespace KioSword
variants.setup (0, "Variants", "vr", "variants", true); variants.setup (0, "Variants", "vr", "variants", true);
wholeBook.setup (false, "WholeBook", "wb", "wholebook", false); wholeBook.setup (false, "WholeBook", "wb", "wholebook", false);
doBibleIndex.setup (true, "BibleIndex", "bi", "bibleindex", false); doBibleIndex.setup (true, "BibleIndex", "bi", "bibleindex", false);
doDictIndex.setup (false, QString::null, "di", "dictindex", false); doDictIndex.setup (false, TQString::null, "di", "dictindex", false);
doFullTreeIndex.setup (false, "FullTreeIndex", "fi", "fullindex", false); doFullTreeIndex.setup (false, "FullTreeIndex", "fi", "fullindex", false);
doOtherIndex.setup (false, QString::null, "oi", "otherindex", false); doOtherIndex.setup (false, TQString::null, "oi", "otherindex", false);
defaultBible.setup ("", "DefaultBible", "dfb", "defaultbible", true); defaultBible.setup ("", "DefaultBible", "dfb", "defaultbible", true);
defaultGreekStrongs.setup ("", "DefaultGreekStrongs", "dfgs", "defaultgreekstrongs", true); defaultGreekStrongs.setup ("", "DefaultGreekStrongs", "dfgs", "defaultgreekstrongs", true);
defaultHebrewStrongs.setup ("", "DefaultHebrewStrongs", "dfhs", "defaulthebrewstrongs", true); defaultHebrewStrongs.setup ("", "DefaultHebrewStrongs", "dfhs", "defaulthebrewstrongs", true);
@ -114,7 +114,7 @@ namespace KioSword
} }
/** Set all (appropriate) options from the query string */ /** Set all (appropriate) options from the query string */
void SwordOptions::readFromQueryString(QMap<QString, QString> items) void SwordOptions::readFromQueryString(TQMap<TQString, TQString> items)
{ {
vector<OptionBase*>::const_iterator it; vector<OptionBase*>::const_iterator it;
vector<OptionBase*>::const_iterator it_end = m_optionList.end(); vector<OptionBase*>::const_iterator it_end = m_optionList.end();
@ -151,9 +151,9 @@ namespace KioSword
} }
/** Get the values that should be used for building a query string */ /** Get the values that should be used for building a query string */
QMap<QString, QString> SwordOptions::getQueryStringParams() const TQMap<TQString, TQString> SwordOptions::getQueryStringParams() const
{ {
QMap<QString, QString> result; TQMap<TQString, TQString> result;
vector<OptionBase*>::const_iterator it; vector<OptionBase*>::const_iterator it;
@ -161,8 +161,8 @@ namespace KioSword
for(it = m_optionList.begin(); it != it_end; ++it) for(it = m_optionList.begin(); it != it_end; ++it)
{ {
QString name = QString::null; TQString name = TQString::null;
QString value = QString::null; TQString value = TQString::null;
(*it)->getQueryStringPair(name, value); (*it)->getQueryStringPair(name, value);
if (!name.isNull() && !name.isEmpty()) if (!name.isNull() && !name.isEmpty())
{ {

@ -30,8 +30,8 @@
// KDE // KDE
#include <kglobal.h> #include <kglobal.h>
// Qt // TQt
#include <qstring.h> #include <ntqstring.h>
// Std C/C++ // Std C/C++
@ -53,7 +53,7 @@ namespace KioSword {
Option<bool> redWords; Option<bool> redWords;
Option<bool> verseNumbers; Option<bool> verseNumbers;
Option<bool> verseLineBreaks; Option<bool> verseLineBreaks;
Option<QString> styleSheet; // FIXME IMPLEMENT Option<TQString> styleSheet; // FIXME IMPLEMENT
Option<bool> footnotes; // FIXME IMPLEMENT Option<bool> footnotes; // FIXME IMPLEMENT
Option<bool> headings; // FIXME IMPLEMENT Option<bool> headings; // FIXME IMPLEMENT
@ -72,13 +72,13 @@ namespace KioSword {
Option<bool> doDictIndex; // Create an index for all items in a Lexicon/Dictionary Option<bool> doDictIndex; // Create an index for all items in a Lexicon/Dictionary
Option<bool> doOtherIndex; // Create an index for other books Option<bool> doOtherIndex; // Create an index for other books
Option<QString> defaultBible; Option<TQString> defaultBible;
Option<QString> defaultGreekStrongs; Option<TQString> defaultGreekStrongs;
Option<QString> defaultHebrewStrongs; Option<TQString> defaultHebrewStrongs;
Option<QString> defaultGreekMorph; Option<TQString> defaultGreekMorph;
Option<QString> defaultHebrewMorph; Option<TQString> defaultHebrewMorph;
Option<QString> locale; Option<TQString> locale;
SwordOptions(); SwordOptions();
SwordOptions(const SwordOptions& copyFrom); SwordOptions(const SwordOptions& copyFrom);
@ -87,8 +87,8 @@ namespace KioSword {
void readFromConfig(const KConfig* config); void readFromConfig(const KConfig* config);
void saveToConfig(KConfig* config); void saveToConfig(KConfig* config);
QMap<QString, QString> getQueryStringParams() const; TQMap<TQString, TQString> getQueryStringParams() const;
void readFromQueryString(QMap<QString, QString> params); void readFromQueryString(TQMap<TQString, TQString> params);
private: private:
/** options that are read/saved in the config or propagated */ /** options that are read/saved in the config or propagated */

@ -29,7 +29,7 @@
#include <klocale.h> #include <klocale.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <qstring.h> #include <ntqstring.h>
namespace KioSword { namespace KioSword {
@ -51,7 +51,7 @@ namespace KioSword {
static const char* TOGGLES = "{$toggles}"; static const char* TOGGLES = "{$toggles}";
// static HTML fragments ------------------------------------------------------------------------------------------------------- // static HTML fragments -------------------------------------------------------------------------------------------------------
static const QString &html_page(QString("") + static const TQString &html_page(TQString("") +
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" " // make W3C valid "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" " // make W3C valid
"\"http://www.w3.org/TR/html4/strict.dtd\">\n" "\"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<html><head>\n" "<html><head>\n"
@ -82,12 +82,12 @@ namespace KioSword {
m_showToggles = false; m_showToggles = false;
} }
QCString Template::render(const SwordOptions& options) const TQCString Template::render(const SwordOptions& options) const
{ {
QString cssdir = KGlobal::dirs()->findResourceDir("data", "kio_sword/kio_sword.css") + "kio_sword/"; TQString cssdir = KGlobal::dirs()->findResourceDir("data", "kio_sword/kio_sword.css") + "kio_sword/";
QString output = html_page; TQString output = html_page;
output = output output = output
.replace(HOMELINK, swordUrl("", options)) .replace(HOMELINK, swordUrl("", options))
.replace(HOMELINKCAPTION, i18n("Module list")) .replace(HOMELINKCAPTION, i18n("Module list"))
@ -114,7 +114,7 @@ namespace KioSword {
} }
if (m_showToggles) if (m_showToggles)
{ {
QString toggles; TQString toggles;
SwordOptions toggledOptions(options); SwordOptions toggledOptions(options);
toggledOptions.verseNumbers.set(!toggledOptions.verseNumbers()); toggledOptions.verseNumbers.set(!toggledOptions.verseNumbers());
@ -147,22 +147,22 @@ namespace KioSword {
return output.utf8(); return output.utf8();
} }
void Template::setTitle(const QString& title) void Template::setTitle(const TQString& title)
{ {
m_title = title; m_title = title;
} }
void Template::setContent(const QString& content) void Template::setContent(const TQString& content)
{ {
m_content = content; m_content = content;
} }
void Template::setNav(const QString& nav) void Template::setNav(const TQString& nav)
{ {
m_nav = nav; m_nav = nav;
} }
void Template::setCurrentPath(const QString& currentPath) void Template::setCurrentPath(const TQString& currentPath)
{ {
m_currentPath = currentPath; m_currentPath = currentPath;
} }

@ -24,8 +24,8 @@
#ifndef KS_TEMPLATE_H #ifndef KS_TEMPLATE_H
#define KS_TEMPLATE_H #define KS_TEMPLATE_H
#include <qstring.h> #include <ntqstring.h>
#include <qcstring.h> #include <ntqcstring.h>
namespace KioSword { namespace KioSword {
@ -35,19 +35,19 @@ namespace KioSword {
/** Template used to generate page to be returned */ /** Template used to generate page to be returned */
class Template { class Template {
private: private:
QString m_title; TQString m_title;
QString m_content; TQString m_content;
QString m_nav; TQString m_nav;
QString m_currentPath; TQString m_currentPath;
bool m_showToggles; bool m_showToggles;
public: public:
Template(); Template();
void setContent(const QString& content); void setContent(const TQString& content);
void setNav(const QString& nav); void setNav(const TQString& nav);
void setTitle(const QString& title); void setTitle(const TQString& title);
void setCurrentPath(const QString& currentPath); void setCurrentPath(const TQString& currentPath);
void setShowToggles(bool showToggles); void setShowToggles(bool showToggles);
QCString render(const SwordOptions& options) const; TQCString render(const SwordOptions& options) const;
}; };
} }

@ -26,7 +26,7 @@
#include "swordoptions.h" #include "swordoptions.h"
#include <kurl.h> #include <kurl.h>
#include <qstring.h> #include <ntqstring.h>
namespace KioSword { namespace KioSword {
@ -40,9 +40,9 @@ namespace KioSword {
static void mergeOptionsToURL(KURL& url, const SwordOptions* options) static void mergeOptionsToURL(KURL& url, const SwordOptions* options)
{ {
QMap<QString, QString> items = options->getQueryStringParams(); TQMap<TQString, TQString> items = options->getQueryStringParams();
QMap<QString, QString>::const_iterator it; TQMap<TQString, TQString>::const_iterator it;
QMap<QString, QString>::const_iterator it_end = items.end(); TQMap<TQString, TQString>::const_iterator it_end = items.end();
for(it = items.begin(); it != it_end; ++it) { for(it = items.begin(); it != it_end; ++it) {
url.addQueryItem(it.key(), it.data()); url.addQueryItem(it.key(), it.data());
} }
@ -53,9 +53,9 @@ namespace KioSword {
return mergeOptionsToURL(url, &options); return mergeOptionsToURL(url, &options);
} }
static QString htmlEncode(const QString& text) static TQString htmlEncode(const TQString& text)
{ {
QString output = text; TQString output = text;
return output return output
.replace("&", "&amp;") .replace("&", "&amp;")
.replace("<", "&lt;") .replace("<", "&lt;")
@ -64,14 +64,14 @@ namespace KioSword {
} }
/** Returns options that need to be propagated as HTML for a form */ /** Returns options that need to be propagated as HTML for a form */
QString optionsAsHiddenFields(const SwordOptions& options) TQString optionsAsHiddenFields(const SwordOptions& options)
{ {
QString output; TQString output;
QMap<QString, QString> items = options.getQueryStringParams(); TQMap<TQString, TQString> items = options.getQueryStringParams();
QMap<QString, QString>::const_iterator it; TQMap<TQString, TQString>::const_iterator it;
QMap<QString, QString>::const_iterator it_end = items.end(); TQMap<TQString, TQString>::const_iterator it_end = items.end();
for(it = items.begin(); it != it_end; ++it) { for(it = items.begin(); it != it_end; ++it) {
output += QString("<input type=\"hidden\" name=\"%1\" value=\"%2\">") output += TQString("<input type=\"hidden\" name=\"%1\" value=\"%2\">")
.arg(it.key()) .arg(it.key())
.arg(htmlEncode(it.data())); .arg(htmlEncode(it.data()));
} }
@ -87,8 +87,8 @@ namespace KioSword {
* *
* @param path path to be encode * @param path path to be encode
*/ */
QString swordUrl(const QString& path, const SwordOptions& options, bool htmlEncodeOutput) { TQString swordUrl(const TQString& path, const SwordOptions& options, bool htmlEncodeOutput) {
QString output; TQString output;
KURL url; KURL url;
url.setProtocol(SWORD_PROTOCOL); url.setProtocol(SWORD_PROTOCOL);
if (path.at(0) != '/') if (path.at(0) != '/')
@ -107,7 +107,7 @@ namespace KioSword {
* @param module name of module * @param module name of module
* @param reference within module * @param reference within module
*/ */
QString swordUrl(const QString& module, const QString& ref, const SwordOptions& options, bool htmlEncodeOutput) { TQString swordUrl(const TQString& module, const TQString& ref, const SwordOptions& options, bool htmlEncodeOutput) {
if (ref.at(0) == '/') if (ref.at(0) == '/')
return swordUrl(module + ref, options, htmlEncodeOutput); return swordUrl(module + ref, options, htmlEncodeOutput);
else else
@ -118,9 +118,9 @@ namespace KioSword {
* return a valid sword URL for 'pages' such as 'help', 'settings' etc, * return a valid sword URL for 'pages' such as 'help', 'settings' etc,
* which are defined using a query parameter * which are defined using a query parameter
*/ */
QString swordUrlForPage(const QString& page, const SwordOptions& options, bool htmlEncodeOutput) TQString swordUrlForPage(const TQString& page, const SwordOptions& options, bool htmlEncodeOutput)
{ {
QString output; TQString output;
KURL url; KURL url;
url.setProtocol(SWORD_PROTOCOL); url.setProtocol(SWORD_PROTOCOL);
url.addPath("/"); url.addPath("/");
@ -132,9 +132,9 @@ namespace KioSword {
return url.url(0, 106); // return as utf-8 return url.url(0, 106); // return as utf-8
} }
QString swordUrlForSettings(const QString& path, const SwordOptions& options, bool htmlEncodeOutput) TQString swordUrlForSettings(const TQString& path, const SwordOptions& options, bool htmlEncodeOutput)
{ {
QString output; TQString output;
KURL url; KURL url;
url.setProtocol(SWORD_PROTOCOL); url.setProtocol(SWORD_PROTOCOL);
url.addPath("/"); url.addPath("/");
@ -158,16 +158,16 @@ namespace KioSword {
} }
/** Get a URL for doing a search */ /** Get a URL for doing a search */
QString swordUrlForSearch(DefModuleType modType, const QString& searchQuery, const SwordOptions& options, bool htmlEncodeOutput) TQString swordUrlForSearch(DefModuleType modType, const TQString& searchQuery, const SwordOptions& options, bool htmlEncodeOutput)
{ {
return swordUrlForSearch(modType, searchQuery, &options, htmlEncodeOutput); return swordUrlForSearch(modType, searchQuery, &options, htmlEncodeOutput);
} }
/** Get a URL for doing a search */ /** Get a URL for doing a search */
QString swordUrlForSearch(DefModuleType modType, const QString& searchQuery, const SwordOptions* options, bool htmlEncodeOutput) TQString swordUrlForSearch(DefModuleType modType, const TQString& searchQuery, const SwordOptions* options, bool htmlEncodeOutput)
{ {
QString modTypeStr; TQString modTypeStr;
QString output; TQString output;
KURL url; KURL url;
// FIXME - make this into a dictionary or something better? // FIXME - make this into a dictionary or something better?
switch (modType) switch (modType)
@ -202,8 +202,8 @@ namespace KioSword {
} }
/** truncate a string to len chars, adding an ellipsis if necessary */ /** truncate a string to len chars, adding an ellipsis if necessary */
QString shorten(const QString &ref, uint len) { TQString shorten(const TQString &ref, uint len) {
QString output = ref.stripWhiteSpace(); TQString output = ref.stripWhiteSpace();
if (output.length() > len) if (output.length() > len)
output = output.left(len-2) + "..."; output = output.left(len-2) + "...";
return output; return output;

@ -24,7 +24,7 @@
#ifndef UTILS_H #ifndef UTILS_H
#define UTILS_H #define UTILS_H
#include <qstring.h> #include <ntqstring.h>
namespace KioSword { namespace KioSword {
class SwordOptions; class SwordOptions;
@ -42,14 +42,14 @@ namespace KioSword {
extern const char* GREEKMORPH_STR; extern const char* GREEKMORPH_STR;
extern const char* HEBREWMORPH_STR; extern const char* HEBREWMORPH_STR;
QString optionsAsHiddenFields(const SwordOptions& options); TQString optionsAsHiddenFields(const SwordOptions& options);
QString swordUrl(const QString& path, const SwordOptions& options, bool htmlEncodeOutput = true); TQString swordUrl(const TQString& path, const SwordOptions& options, bool htmlEncodeOutput = true);
QString swordUrl(const QString& module, const QString& ref, const SwordOptions& options, bool htmlEncodeOutput = true); TQString swordUrl(const TQString& module, const TQString& ref, const SwordOptions& options, bool htmlEncodeOutput = true);
QString swordUrlForPage(const QString& page, const SwordOptions& options, bool htmlEncodeOutput = true); TQString swordUrlForPage(const TQString& page, const SwordOptions& options, bool htmlEncodeOutput = true);
QString swordUrlForSettings(const QString& path, const SwordOptions& options, bool htmlEncodeOutput = true); TQString swordUrlForSettings(const TQString& path, const SwordOptions& options, bool htmlEncodeOutput = true);
QString swordUrlForSearch(DefModuleType modType, const QString& searchQuery, const SwordOptions& options, bool htmlEncodeOutput = true); TQString swordUrlForSearch(DefModuleType modType, const TQString& searchQuery, const SwordOptions& options, bool htmlEncodeOutput = true);
QString swordUrlForSearch(DefModuleType modType, const QString& searchQuery, const SwordOptions* options, bool htmlEncodeOutput = true); TQString swordUrlForSearch(DefModuleType modType, const TQString& searchQuery, const SwordOptions* options, bool htmlEncodeOutput = true);
QString shorten(const QString& ref, uint len); TQString shorten(const TQString& ref, uint len);
} }
#endif #endif

Loading…
Cancel
Save