diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /karm/task.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'karm/task.cpp')
-rw-r--r-- | karm/task.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/karm/task.cpp b/karm/task.cpp index 07e934e53..5ade426f0 100644 --- a/karm/task.cpp +++ b/karm/task.cpp @@ -1,7 +1,7 @@ -#include <qcstring.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qtimer.h> +#include <tqcstring.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqtimer.h> #include <kiconloader.h> @@ -19,27 +19,27 @@ const int gSecondsPerMinute = 60; -QPtrVector<QPixmap> *Task::icons = 0; +TQPtrVector<TQPixmap> *Task::icons = 0; -Task::Task( const QString& taskName, long minutes, long sessionTime, +Task::Task( const TQString& taskName, long minutes, long sessionTime, DesktopList desktops, TaskView *parent) - : QObject(), QListViewItem(parent) + : TQObject(), TQListViewItem(parent) { init(taskName, minutes, sessionTime, desktops, 0); } -Task::Task( const QString& taskName, long minutes, long sessionTime, +Task::Task( const TQString& taskName, long minutes, long sessionTime, DesktopList desktops, Task *parent) - : QObject(), QListViewItem(parent) + : TQObject(), TQListViewItem(parent) { init(taskName, minutes, sessionTime, desktops, 0); } Task::Task( KCal::Todo* todo, TaskView* parent ) - : QObject(), QListViewItem( parent ) + : TQObject(), TQListViewItem( parent ) { long minutes = 0; - QString name; + TQString name; long sessionTime = 0; int percent_complete = 0; DesktopList desktops; @@ -48,25 +48,25 @@ Task::Task( KCal::Todo* todo, TaskView* parent ) init(name, minutes, sessionTime, desktops, percent_complete); } -void Task::init( const QString& taskName, long minutes, long sessionTime, +void Task::init( const TQString& taskName, long minutes, long sessionTime, DesktopList desktops, int percent_complete) { // If our parent is the taskview then connect our totalTimesChanged // signal to its receiver if ( ! parent() ) - connect( this, SIGNAL( totalTimesChanged ( long, long ) ), - listView(), SLOT( taskTotalTimesChanged( long, long) )); + connect( this, TQT_SIGNAL( totalTimesChanged ( long, long ) ), + listView(), TQT_SLOT( taskTotalTimesChanged( long, long) )); - connect( this, SIGNAL( deletingTask( Task* ) ), - listView(), SLOT( deletingTask( Task* ) )); + connect( this, TQT_SIGNAL( deletingTask( Task* ) ), + listView(), TQT_SLOT( deletingTask( Task* ) )); if (icons == 0) { - icons = new QPtrVector<QPixmap>(8); + icons = new TQPtrVector<TQPixmap>(8); KIconLoader kil("karm"); // always load icons from the KArm application for (int i=0; i<8; i++) { - QPixmap *icon = new QPixmap(); - QString name; + TQPixmap *icon = new TQPixmap(); + TQString name; name.sprintf("watch-%d.xpm",i); *icon = kil.loadIcon( name, KIcon::User ); icons->insert(i,icon); @@ -75,13 +75,13 @@ void Task::init( const QString& taskName, long minutes, long sessionTime, _removing = false; _name = taskName.stripWhiteSpace(); - _lastStart = QDateTime::currentDateTime(); + _lastStart = TQDateTime::currentDateTime(); _totalTime = _time = minutes; _totalSessionTime = _sessionTime = sessionTime; - _timer = new QTimer(this); + _timer = new TQTimer(this); _desktops = desktops; - connect(_timer, SIGNAL(timeout()), this, SLOT(updateActiveIcon())); - setPixmap(1, UserIcon(QString::fromLatin1("empty-watch.xpm"))); + connect(_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateActiveIcon())); + setPixmap(1, UserIcon(TQString::fromLatin1("empty-watch.xpm"))); _currentPic = 0; _percentcomplete = percent_complete; @@ -94,7 +94,7 @@ Task::~Task() { delete _timer; } -void Task::setRunning( bool on, KarmStorage* storage, QDateTime whenStarted, QDateTime whenStopped ) +void Task::setRunning( bool on, KarmStorage* storage, TQDateTime whenStarted, TQDateTime whenStopped ) // Sets a task running or stopped. If the task is to be stopped, whenStarted is not evaluated. // on=true if the task shall be started on=false if the task shall be stopped // This is the back-end, the front-end is StartTimerFor() @@ -119,13 +119,13 @@ void Task::setRunning( bool on, KarmStorage* storage, QDateTime whenStarted, QDa if ( ! _removing ) { storage->stopTimer(this, whenStopped); - setPixmap(1, UserIcon(QString::fromLatin1("empty-watch.xpm"))); + setPixmap(1, UserIcon(TQString::fromLatin1("empty-watch.xpm"))); } } } } -void Task::setUid(QString uid) { +void Task::setUid(TQString uid) { _uid = uid; } @@ -134,11 +134,11 @@ bool Task::isRunning() const return _timer->isActive(); } -void Task::setName( const QString& name, KarmStorage* storage ) +void Task::setName( const TQString& name, KarmStorage* storage ) { kdDebug(5970) << "Task:setName: " << name << endl; - QString oldname = _name; + TQString oldname = _name; if ( oldname != name ) { _name = name; storage->setName(this, oldname); @@ -183,7 +183,7 @@ void Task::setPercentComplete(const int percent, KarmStorage *storage) void Task::setPixmapProgress() { - QPixmap* icon = new QPixmap(); + TQPixmap* icon = new TQPixmap(); if (_percentcomplete >= 100) *icon = UserIcon("task-complete.xpm"); else @@ -255,7 +255,7 @@ void Task::changeParentTotalTimes( long minutesSession, long minutes ) parent()->changeTotalTimes( minutesSession, minutes ); } -bool Task::remove( QPtrList<Task>& activeTasks, KarmStorage* storage) +bool Task::remove( TQPtrList<Task>& activeTasks, KarmStorage* storage) { kdDebug(5970) << "Task::remove: " << _name << endl; @@ -285,12 +285,12 @@ void Task::updateActiveIcon() setPixmap(1, *(*icons)[_currentPic]); } -QString Task::fullName() const +TQString Task::fullName() const { if (isRoot()) return name(); else - return parent()->fullName() + QString::fromLatin1("/") + name(); + return parent()->fullName() + TQString::fromLatin1("/") + name(); } KCal::Todo* Task::asTodo(KCal::Todo* todo) const @@ -307,15 +307,15 @@ KCal::Todo* Task::asTodo(KCal::Todo* todo) const // todo->setDtStart( current ); todo->setCustomProperty( kapp->instanceName(), - QCString( "totalTaskTime" ), QString::number( _time ) ); + TQCString( "totalTaskTime" ), TQString::number( _time ) ); todo->setCustomProperty( kapp->instanceName(), - QCString( "totalSessionTime" ), QString::number( _sessionTime) ); + TQCString( "totalSessionTime" ), TQString::number( _sessionTime) ); if (getDesktopStr().isEmpty()) - todo->removeCustomProperty(kapp->instanceName(), QCString("desktopList")); + todo->removeCustomProperty(kapp->instanceName(), TQCString("desktopList")); else todo->setCustomProperty( kapp->instanceName(), - QCString( "desktopList" ), getDesktopStr() ); + TQCString( "desktopList" ), getDesktopStr() ); todo->setOrganizer( Preferences::instance()->userRealName() ); @@ -325,7 +325,7 @@ KCal::Todo* Task::asTodo(KCal::Todo* todo) const } bool Task::parseIncidence( KCal::Incidence* incident, long& minutes, - long& sessionMinutes, QString& name, DesktopList& desktops, + long& sessionMinutes, TQString& name, DesktopList& desktops, int& percent_complete ) { bool ok; @@ -337,23 +337,23 @@ bool Task::parseIncidence( KCal::Incidence* incident, long& minutes, ok = false; minutes = incident->customProperty( kapp->instanceName(), - QCString( "totalTaskTime" )).toInt( &ok ); + TQCString( "totalTaskTime" )).toInt( &ok ); if ( !ok ) minutes = 0; ok = false; sessionMinutes = incident->customProperty( kapp->instanceName(), - QCString( "totalSessionTime" )).toInt( &ok ); + TQCString( "totalSessionTime" )).toInt( &ok ); if ( !ok ) sessionMinutes = 0; - QString desktopList = incident->customProperty( kapp->instanceName(), - QCString( "desktopList" ) ); - QStringList desktopStrList = QStringList::split( QString::fromLatin1(","), + TQString desktopList = incident->customProperty( kapp->instanceName(), + TQCString( "desktopList" ) ); + TQStringList desktopStrList = TQStringList::split( TQString::fromLatin1(","), desktopList ); desktops.clear(); - for ( QStringList::iterator iter = desktopStrList.begin(); + for ( TQStringList::iterator iter = desktopStrList.begin(); iter != desktopStrList.end(); ++iter ) { int desktopInt = (*iter).toInt( &ok ); @@ -371,16 +371,16 @@ bool Task::parseIncidence( KCal::Incidence* incident, long& minutes, return true; } -QString Task::getDesktopStr() const +TQString Task::getDesktopStr() const { if ( _desktops.empty() ) - return QString(); + return TQString(); - QString desktopstr; + TQString desktopstr; for ( DesktopList::const_iterator iter = _desktops.begin(); iter != _desktops.end(); ++iter ) { - desktopstr += QString::number( *iter ) + QString::fromLatin1( "," ); + desktopstr += TQString::number( *iter ) + TQString::fromLatin1( "," ); } desktopstr.remove( desktopstr.length() - 1, 1 ); return desktopstr; @@ -417,18 +417,18 @@ void Task::update() setText(4, formatTime(_totalTime)); } -void Task::addComment( QString comment, KarmStorage* storage ) +void Task::addComment( TQString comment, KarmStorage* storage ) { - _comment = _comment + QString::fromLatin1("\n") + comment; + _comment = _comment + TQString::fromLatin1("\n") + comment; storage->addComment(this, comment); } -QString Task::comment() const +TQString Task::comment() const { return _comment; } -int Task::compare ( QListViewItem * i, int col, bool ascending ) const +int Task::compare ( TQListViewItem * i, int col, bool ascending ) const { long thistime = 0; long thattime = 0; |