diff options
Diffstat (limited to 'src/option.h')
-rw-r--r-- | src/option.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/option.h b/src/option.h index 2c146ba..9728270 100644 --- a/src/option.h +++ b/src/option.h @@ -26,16 +26,16 @@ #include <kconfig.h> -#include <qstring.h> -#include <qmap.h> +#include <ntqstring.h> +#include <ntqmap.h> namespace KioSword { class OptionBase { public: - virtual void readFromQueryString(QMap<QString, QString> params, bool allowPropagating) = 0; - virtual void getQueryStringPair(QString& name, QString& val) = 0; + virtual void readFromQueryString(TQMap<TQString, TQString> params, bool allowPropagating) = 0; + virtual void getQueryStringPair(TQString& name, TQString& val) = 0; virtual void readFromConfig(const KConfig* config) = 0; virtual void saveToConfig(KConfig* config) = 0; virtual void copy(const OptionBase* other) = 0; @@ -58,7 +58,7 @@ namespace KioSword T m_config_value; // User's default /** 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 // to work correctly @@ -67,10 +67,10 @@ namespace KioSword } /** Convert the option to a string for use in query strings */ - QString toString(T val) + TQString toString(T val) { // Will specialise this later - QString result; + TQString result; return result; } @@ -83,10 +83,10 @@ namespace KioSword } public: - QString m_qsShortName; // short name in querystring - QString m_qsLongName; // long name in querystring + TQString m_qsShortName; // short name in querystring + TQString m_qsLongName; // long name in querystring 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() { @@ -109,7 +109,7 @@ namespace KioSword * @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 */ - 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_default_value = default_value; @@ -135,7 +135,7 @@ namespace KioSword } /** 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; bool found = false; @@ -146,7 +146,7 @@ namespace KioSword m_propagate_value = m_config_value;*/ // 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()) { newval = fromString(it.data()); @@ -170,7 +170,7 @@ namespace KioSword } /** 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 // query string values that wouldn't make a difference @@ -238,7 +238,7 @@ namespace KioSword // fromString specialisations template<> - inline const bool Option<bool>::fromString(const QString& val) + inline const bool Option<bool>::fromString(const TQString& val) { if (val == "0") return false; @@ -247,34 +247,34 @@ namespace KioSword } template<> - inline const QString Option<QString>::fromString(const QString& val) + inline const TQString Option<TQString>::fromString(const TQString& val) { return val; } template<> - inline const int Option<int>::fromString(const QString& val) + inline const int Option<int>::fromString(const TQString& val) { return val.toInt(); } // toString specialisations 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<> - inline QString Option<QString>::toString(QString val) + inline TQString Option<TQString>::toString(TQString val) { return val; } 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 @@ -285,7 +285,7 @@ namespace KioSword } 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); } |