From e03da7a558d79e399e3704a5b2f35646e92dacb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 23 Sep 2013 00:43:43 +0200 Subject: [PATCH] Initial TQt conversion --- acinclude.m4 | 48 ++++----- aclocal.m4 | 48 ++++----- src/kio_sword.cpp | 126 ++++++++++++------------ src/kio_sword.h | 32 +++--- src/ks_osishtml.cpp | 12 +-- src/ks_thmlhtml.cpp | 6 +- src/option.h | 46 ++++----- src/renderer.cpp | 226 +++++++++++++++++++++---------------------- src/renderer.h | 54 +++++------ src/swordoptions.cpp | 14 +-- src/swordoptions.h | 22 ++--- src/template.cpp | 20 ++-- src/template.h | 22 ++--- src/utils.cpp | 50 +++++----- src/utils.h | 18 ++-- 15 files changed, 372 insertions(+), 372 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index cf00223..9247236 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then x_includes="" x_libraries="" 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 CXXFLAGS="$CXXFLAGS -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]) cat > conftest.$ac_ext < -#include +#include +#include EOF if test "$kde_qtver" = "2"; then cat >> conftest.$ac_ext < -#include -#include +#include +#include +#include EOF if test $kde_qtsubver -gt 0; then cat >> conftest.$ac_ext <> conftest.$ac_ext < -#include +#include +#include #include EOF fi @@ -1201,22 +1201,22 @@ fi if test -z "$3"; then if test $kde_qtver = 3; 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,'` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` else - kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" + kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000" fi fi if test $kde_qtver = 2; then if test $kde_qtsubver -gt 0; then - kde_qt_verstring="QT_VERSION >= 222" + kde_qt_verstring="TQT_VERSION >= 222" else - kde_qt_verstring="QT_VERSION >= 200" + kde_qt_verstring="TQT_VERSION >= 200" fi fi 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 else kde_qt_verstring="$3" @@ -1325,7 +1325,7 @@ AC_ARG_ENABLE( USING_QT_MT="" 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 ------------------------------------------------------------------------ KDE_MT_LDFLAGS= @@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------ fi 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 ------------------------------------------------------------------------ if test "x$kde_use_qt_mt" = "xyes"; then @@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then fi if test "$kde_qtver" != "1"; then - kde_qt_header=qstyle.h + kde_qt_header=ntqstyle.h else - kde_qt_header=qglobal.h + kde_qt_header=ntqglobal.h fi 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" AC_TRY_LINK([ - #include + #include ], [ QDomDocument doc; @@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" AC_TRY_LINK( -[#include ], +[#include ], [ int argc; char** argv; @@ -3397,7 +3397,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY], AC_TRY_COMPILE( [ -#include +#include #if Q_EXPORT - 0 != 0 /* if this compiles, then Q_EXPORT is undefined */ /* if Q_EXPORT is nonempty, this will break compilation */ @@ -4635,7 +4635,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" AC_TRY_RUN(dnl [ #include -#include +#include int main() { QString t = "hallo"; t.fill('t'); @@ -5480,7 +5480,7 @@ if test "${with_qt_dir+set}" = set; then kde_qtdir="$with_qt_dir" 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_SUBST(QTDOCDIR) @@ -5501,7 +5501,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME) AC_SUBST(DOXYGEN_PROJECT_NUMBER) 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 fi AC_SUBST(KDE_HAS_DOXYGEN) diff --git a/aclocal.m4 b/aclocal.m4 index e1395ba..49b75d4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1072,7 +1072,7 @@ elif test "$kde_use_qt_emb" = "yes"; then x_includes="" x_libraries="" 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 CXXFLAGS="$CXXFLAGS -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]) cat > conftest.$ac_ext < -#include +#include +#include EOF if test "$kde_qtver" = "2"; then cat >> conftest.$ac_ext < -#include -#include +#include +#include +#include EOF if test $kde_qtsubver -gt 0; then cat >> conftest.$ac_ext <> conftest.$ac_ext < -#include +#include +#include #include EOF fi @@ -1213,22 +1213,22 @@ fi if test -z "$3"; then if test $kde_qtver = 3; 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,'` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` else - kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" + kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000" fi fi if test $kde_qtver = 2; then if test $kde_qtsubver -gt 0; then - kde_qt_verstring="QT_VERSION >= 222" + kde_qt_verstring="TQT_VERSION >= 222" else - kde_qt_verstring="QT_VERSION >= 200" + kde_qt_verstring="TQT_VERSION >= 200" fi fi 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 else kde_qt_verstring="$3" @@ -1337,7 +1337,7 @@ AC_ARG_ENABLE( USING_QT_MT="" 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 ------------------------------------------------------------------------ KDE_MT_LDFLAGS= @@ -1395,7 +1395,7 @@ dnl ------------------------------------------------------------ fi 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 ------------------------------------------------------------------------ if test "x$kde_use_qt_mt" = "xyes"; then @@ -1461,9 +1461,9 @@ if test ! "$ac_qt_includes" = "NO"; then fi if test "$kde_qtver" != "1"; then - kde_qt_header=qstyle.h + kde_qt_header=ntqstyle.h else - kde_qt_header=qglobal.h + kde_qt_header=ntqglobal.h fi 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" AC_TRY_LINK([ - #include + #include ], [ QDomDocument doc; @@ -2607,7 +2607,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" AC_TRY_LINK( -[#include ], +[#include ], [ int argc; char** argv; @@ -3409,7 +3409,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY], AC_TRY_COMPILE( [ -#include +#include #if Q_EXPORT - 0 != 0 /* if this compiles, then Q_EXPORT is undefined */ /* if Q_EXPORT is nonempty, this will break compilation */ @@ -4647,7 +4647,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" AC_TRY_RUN(dnl [ #include -#include +#include int main() { QString t = "hallo"; t.fill('t'); @@ -5492,7 +5492,7 @@ if test "${with_qt_dir+set}" = set; then kde_qtdir="$with_qt_dir" 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_SUBST(QTDOCDIR) @@ -5513,7 +5513,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME) AC_SUBST(DOXYGEN_PROJECT_NUMBER) 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 fi AC_SUBST(KDE_HAS_DOXYGEN) diff --git a/src/kio_sword.cpp b/src/kio_sword.cpp index b0db5bc..ddb4afa 100644 --- a/src/kio_sword.cpp +++ b/src/kio_sword.cpp @@ -37,9 +37,9 @@ #include #include -// Qt -#include -#include +// TQt +#include +#include // Standard C++ /C #include @@ -77,13 +77,13 @@ namespace KioSword class SwordOptions; // HTML fragments that will be initialised at run time ------------------------------------------------------------------------- - static QString search_form; - static QString help_page; + static TQString search_form; + static TQString help_page; - SwordProtocol::SwordProtocol(const QCString & pool_socket, - const QCString & app_socket) + SwordProtocol::SwordProtocol(const TQCString & pool_socket, + const TQCString & app_socket) : SlaveBase("kio_sword", pool_socket, app_socket) { kdDebug() << "SwordProtocol::SwordProtocol()" << endl; @@ -98,14 +98,14 @@ namespace KioSword void SwordProtocol::get(const KURL & url) { - QString modname; - QString query; - QString error; + TQString modname; + TQString query; + TQString error; kdDebug() << "SwordProtocol::get(const KURL& url)" << endl; /* kdDebug() << "Seconds: " << url.query() << endl; - QString remoteServer = url.host(); + TQString remoteServer = url.host(); int remotePort = url.port(); kdDebug() << "myURL: " << url.prettyURL() << endl; */ @@ -141,8 +141,8 @@ namespace KioSword } else { - modname = m_path.section('/', 0, 0, QString::SectionSkipEmpty); - query = m_path.section('/', 1, -1, QString::SectionSkipEmpty); + modname = m_path.section('/', 0, 0, TQString::SectionSkipEmpty); + query = m_path.section('/', 1, -1, TQString::SectionSkipEmpty); } } @@ -206,7 +206,7 @@ namespace KioSword if (!modname.isEmpty()) { m_renderer.moduleQuery(modname, query, m_options, tmplt); } else { - QString body; + TQString body; tmplt->setTitle(i18n("Modules - Kio-Sword")); if (!error.isEmpty()) { body = error; @@ -255,16 +255,16 @@ namespace KioSword finished(); } - /* redefine data for QCStrings so we don't send the trailing + /* redefine data for TQCStrings so we don't send the trailing null */ - void SwordProtocol::data(const QCString& text) { - QByteArray nonull; + void SwordProtocol::data(const TQCString& text) { + TQByteArray nonull; nonull.setRawData(text.data(), text.size()-1); SlaveBase::data(nonull); nonull.resetRawData(text.data(), text.size()-1); } - void SwordProtocol::data(const QByteArray& array) { + void SwordProtocol::data(const TQByteArray& array) { SlaveBase::data(array); } @@ -273,9 +273,9 @@ namespace KioSword m_options.readFromConfig(m_config); } - QString SwordProtocol::saveUserConfig() + TQString SwordProtocol::saveUserConfig() { - QString message; + TQString message; m_options.saveToConfig(m_config); m_config->sync(); // search form depends on settings, so force it to be recreated @@ -295,11 +295,11 @@ namespace KioSword // Reset data members that should always be // retrieved from URL m_action = QUERY; - m_path = QString::null; - m_redirect.module = QString::null; - m_redirect.query = QString::null; - m_previous.module = QString::null; - m_previous.query = QString::null; + m_path = TQString::null; + m_redirect.module = TQString::null; + m_redirect.query = TQString::null; + m_previous.module = TQString::null; + m_previous.query = TQString::null; m_moduletype = DEFMODULETYPE_NONE; if (url.hasPath()) @@ -310,10 +310,10 @@ namespace KioSword // URLs will be encoded in UTF-8 since they are sometimes // generated from the search form, and the browser will // encode in UTF-8 since the whole page has UTF-8 charset - QMap items = url.queryItems(KURL::CaseInsensitiveKeys, 106); - QMap::const_iterator it; - QMap::const_iterator it_end = items.end(); - QString val; + TQMap items = url.queryItems(KURL::CaseInsensitiveKeys, 106); + TQMap::const_iterator it; + TQMap::const_iterator it_end = items.end(); + TQString val; const char *key; for(it = items.begin(); it != it_end; it++) { @@ -366,8 +366,8 @@ namespace KioSword else ENUM_OPTION(m_action, "testsettings", REDIRECT_QUERY) else if (!strcasecmp(key, "previouspath")) { - m_previous.module = val.section('/', 0, 0, QString::SectionSkipEmpty); - m_previous.query = val.section('/', 1, -1, QString::SectionSkipEmpty); + m_previous.module = val.section('/', 0, 0, TQString::SectionSkipEmpty); + m_previous.query = val.section('/', 1, -1, TQString::SectionSkipEmpty); } } @@ -382,16 +382,16 @@ namespace KioSword void SwordProtocol::sendPage(const Template* tplt) { 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(); } /** Returns a string representing notes about an option for the settings page */ template - QString optionNotes(const Option& option) + TQString optionNotes(const Option& option) { - QString output; + TQString output; if (!option.m_propagate) { output += "1"; @@ -409,8 +409,8 @@ namespace KioSword /** HTML for a boolean option */ - QString settingsBooleanOptionRow(const QString& description, const Option& option) { - static const QString boolean_option_row( + TQString settingsBooleanOptionRow(const TQString& description, const Option& option) { + static const TQString boolean_option_row( "%1%4   %6%2, %7"); return boolean_option_row .arg(description + optionNotes(option)) @@ -432,10 +432,10 @@ namespace KioSword * @param optionList HTML containing the