diff options
Diffstat (limited to 'kplato/kptmap.h')
-rw-r--r-- | kplato/kptmap.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kplato/kptmap.h b/kplato/kptmap.h index 9edae25f..f21612c3 100644 --- a/kplato/kptmap.h +++ b/kplato/kptmap.h @@ -21,11 +21,11 @@ #define KPTMAP_H -#include <qmap.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qpair.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqpair.h> +#include <tqvaluelist.h> #include <kdebug.h> @@ -36,35 +36,35 @@ namespace Map { enum State { None=0, NonWorking=1, Working=2 }; } // Map namespace -typedef QMap<QString, int> DateMapType; +typedef TQMap<TQString, int> DateMapType; class DateMap : public DateMapType { public: DateMap() {} virtual ~DateMap() {} - virtual bool contains(QDate date) const { return DateMapType::contains(date.toString(Qt::ISODate)); } + virtual bool tqcontains(TQDate date) const { return DateMapType::tqcontains(date.toString(Qt::ISODate)); } - void insert(QString date, int state=Map::NonWorking) { + void insert(TQString date, int state=Map::NonWorking) { //kdDebug()<<k_funcinfo<<date<<"="<<state<<endl; if (state == Map::None) DateMapType::remove(date); else DateMapType::insert(date, state); } - void insert(QDate date, int state=Map::NonWorking) { insert(date.toString(Qt::ISODate), state); } + void insert(TQDate date, int state=Map::NonWorking) { insert(date.toString(Qt::ISODate), state); } - void remove(QDate date) { + void remove(TQDate date) { //kdDebug()<<k_funcinfo<<date.toString(Qt::ISODate)<<endl; DateMapType::remove(date.toString(Qt::ISODate)); } - int state(QString date) { - DateMapType::iterator it = find(date); + int state(TQString date) { + DateMapType::iterator it = tqfind(date); if (it == end()) return 0; else return it.data(); } - int state(QDate date) { return state(date.toString(Qt::ISODate)); } + int state(TQDate date) { return state(date.toString(Qt::ISODate)); } bool operator==(const DateMap &m) const { return keys() == m.keys() && values() == m.values(); @@ -74,24 +74,24 @@ public: } // boolean use - void toggle(QString date, int state=Map::NonWorking) { + void toggle(TQString date, int state=Map::NonWorking) { //kdDebug()<<k_funcinfo<<date<<"="<<state<<endl; - if (DateMapType::contains(date)) + if (DateMapType::tqcontains(date)) DateMapType::remove(date); else DateMapType::insert(date, state); } - void toggle(QDate date, int state=Map::NonWorking) { return toggle(date.toString(Qt::ISODate)); } - void toggleClear(QString date, int state=Map::NonWorking) { + void toggle(TQDate date, int state=Map::NonWorking) { return toggle(date.toString(Qt::ISODate)); } + void toggleClear(TQString date, int state=Map::NonWorking) { //kdDebug()<<k_funcinfo<<date<<"="<<state<<endl; - bool s = DateMapType::contains(date); + bool s = DateMapType::tqcontains(date); clear(); if (!s) insert(date, state); } - void toggleClear(QDate date, int state=Map::NonWorking) { toggleClear(date.toString(Qt::ISODate)); } + void toggleClear(TQDate date, int state=Map::NonWorking) { toggleClear(date.toString(Qt::ISODate)); } }; -typedef QMap<int, int> IntMapType; +typedef TQMap<int, int> IntMapType; class IntMap : public IntMapType { public: @@ -105,7 +105,7 @@ public: IntMapType::insert(key, state); } virtual int state(int key) { - IntMapType::iterator it = IntMapType::find(key); + IntMapType::iterator it = IntMapType::tqfind(key); if (it == IntMapType::end()) return 0; else return it.data(); } @@ -118,9 +118,9 @@ public: } // boolean use - void toggle(int key, int state=Map::NonWorking) { IntMapType::contains(key) ? remove(key) : insert(key, state); } + void toggle(int key, int state=Map::NonWorking) { IntMapType::tqcontains(key) ? remove(key) : insert(key, state); } void toggleClear(int key, int state=Map::NonWorking) { - bool s =contains(key); + bool s =tqcontains(key); clear(); if (!s) insert(key, state); } @@ -129,29 +129,29 @@ public: class WeekMap : public IntMap { public: - bool contains(int week, int year) { return IntMap::contains(week*10000 + year); } - bool contains(QPair<int,int> week) { return contains(week.first, week.second); } + bool tqcontains(int week, int year) { return IntMap::tqcontains(week*10000 + year); } + bool tqcontains(TQPair<int,int> week) { return tqcontains(week.first, week.second); } void insert(int week, int year, int state=Map::NonWorking) { if (week < 1 || week > 53) { kdError()<<k_funcinfo<<"Illegal week number: "<<week<<endl; return; } IntMap::insert(week*10000 + year, state); } - void insert(QPair<int,int> week, int state=Map::NonWorking) { insert(week.first, week.second, state); } + void insert(TQPair<int,int> week, int state=Map::NonWorking) { insert(week.first, week.second, state); } void insert(WeekMap::iterator it, int state) { insert(week(it.key()), state); } - void remove(QPair<int,int> week) { IntMap::remove(week.first*10000 + week.second); } + void remove(TQPair<int,int> week) { IntMap::remove(week.first*10000 + week.second); } - static QPair<int, int> week(int key) { return QPair<int, int>(key/10000, key%10000); } + static TQPair<int, int> week(int key) { return TQPair<int, int>(key/10000, key%10000); } - int state(QPair<int, int> week) { return IntMap::state(week.first*10000 + week.second); } - int state(int week, int year) { return state(QPair<int, int>(week, year)); } + int state(TQPair<int, int> week) { return IntMap::state(week.first*10000 + week.second); } + int state(int week, int year) { return state(TQPair<int, int>(week, year)); } - void toggle(QPair<int,int> week, int state=Map::NonWorking) { + void toggle(TQPair<int,int> week, int state=Map::NonWorking) { if (week.first < 1 || week.first > 53) { kdError()<<k_funcinfo<<"Illegal week number: "<<week.first<<endl; return; } IntMap::toggle(week.first*10000 + week.second, state); } - void toggleClear(QPair<int,int> week, int state=Map::NonWorking) { + void toggleClear(TQPair<int,int> week, int state=Map::NonWorking) { if (week.first < 1 || week.first > 53) { kdError()<<k_funcinfo<<"Illegal week number: "<<week.first<<endl; return; } IntMap::toggleClear(week.first*10000 + week.second, state); } |