summaryrefslogtreecommitdiffstats
path: root/kalarm/undo.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kalarm/undo.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/undo.cpp')
-rw-r--r--kalarm/undo.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kalarm/undo.cpp b/kalarm/undo.cpp
index e1998e9c..c3b56612 100644
--- a/kalarm/undo.cpp
+++ b/kalarm/undo.cpp
@@ -41,19 +41,19 @@ class UndoItem
{
public:
enum Operation { ADD, EDIT, DELETE, REACTIVATE, DEACTIVATE, MULTI };
- UndoItem(); // needed by QValueList
+ UndoItem(); // needed by TQValueList
virtual ~UndoItem();
virtual Operation operation() const = 0;
virtual TQString actionText() const = 0;
- virtual TQString description() const { return TQString::null; }
- virtual TQString eventID() const { return TQString::null; }
- virtual TQString oldEventID() const { return TQString::null; }
- virtual TQString newEventID() const { return TQString::null; }
+ virtual TQString description() const { return TQString(); }
+ virtual TQString eventID() const { return TQString(); }
+ virtual TQString oldEventID() const { return TQString(); }
+ virtual TQString newEventID() const { return TQString(); }
int id() const { return mId; }
Undo::Type type() const { return mType; }
void setType(Undo::Type t) { mType = t; }
- KAEvent::Status calendar() const { return mCalendar; }
- virtual void setCalendar(KAEvent::Status s) { mCalendar = s; }
+ KAEvent::tqStatus calendar() const { return mCalendar; }
+ virtual void setCalendar(KAEvent::tqStatus s) { mCalendar = s; }
virtual UndoItem* restore() = 0;
virtual bool deleteID(const TQString& /*id*/) { return false; }
@@ -66,13 +66,13 @@ class UndoItem
protected:
UndoItem(Undo::Type);
- static TQString addDeleteActionText(KAEvent::Status, bool add);
+ static TQString addDeleteActionText(KAEvent::tqStatus, bool add);
TQString description(const KAEvent&) const;
- void tqreplaceWith(UndoItem* item) { Undo::tqreplace(this, item); }
+ void replaceWith(UndoItem* item) { Undo::tqreplace(this, item); }
int mId; // unique identifier (only for mType = UNDO, REDO)
Undo::Type mType; // which list (if any) the object is in
- KAEvent::Status mCalendar;
+ KAEvent::tqStatus mCalendar;
};
class UndoMultiBase : public UndoItem
@@ -101,7 +101,7 @@ class UndoAdd : public UndoItem
{
public:
UndoAdd(Undo::Type, const KAEvent&);
- UndoAdd(Undo::Type, const KAEvent&, KAEvent::Status);
+ UndoAdd(Undo::Type, const KAEvent&, KAEvent::tqStatus);
virtual Operation operation() const { return ADD; }
virtual TQString actionText() const;
virtual TQString description() const { return mDescription; }
@@ -298,7 +298,7 @@ void Undo::removeRedos(const TQString& eventID)
{
if (item->deleteID(id))
{
- // The old multi-redo was tqreplaced with a new single redo
+ // The old multi-redo was replaced with a new single redo
delete item;
}
++it;
@@ -320,7 +320,7 @@ void Undo::removeRedos(const TQString& eventID)
* Undo or redo a specified item.
* Reply = true if success, or if the item no longer exists.
*/
-bool Undo::undo(Undo::Iterator it, Undo::Type type, TQWidget* parent, const TQString& action)
+bool Undo::undo(Undo::Iterator it, Undo::Type type, TQWidget* tqparent, const TQString& action)
{
UndoItem::mRestoreError = UndoItem::ERR_NONE;
UndoItem::mRestoreWarning = UndoItem::WARN_NONE;
@@ -347,7 +347,7 @@ bool Undo::undo(Undo::Iterator it, Undo::Type type, TQWidget* parent, const TQSt
default:
return true;
}
- KAlarm::displayKOrgUpdateError(parent, errcode, UndoItem::mRestoreWarningCount);
+ KAlarm::displayKOrgUpdateError(tqparent, errcode, UndoItem::mRestoreWarningCount);
return true;
}
case UndoItem::ERR_NOT_FOUND: err = i18n("Alarm not found"); break;
@@ -357,7 +357,7 @@ bool Undo::undo(Undo::Iterator it, Undo::Type type, TQWidget* parent, const TQSt
case UndoItem::ERR_PROG: err = i18n("Program error"); break;
default: err = i18n("Unknown error"); break;
}
- KMessageBox::sorry(parent, i18n("Undo-action: message", "%1: %2").arg(action).arg(err));
+ KMessageBox::sorry(tqparent, i18n("Undo-action: message", "%1: %2").arg(action).arg(err));
return false;
}
@@ -404,7 +404,7 @@ void Undo::tqreplace(UndoItem* old, UndoItem* New)
List* list = (type == UNDO) ? &mUndoList : (type == REDO) ? &mRedoList : 0;
if (!list)
return;
- Iterator it = list->find(old);
+ Iterator it = list->tqfind(old);
if (it != list->end())
{
New->setType(type); // ensure the item points to the correct list
@@ -419,7 +419,7 @@ void Undo::tqreplace(UndoItem* old, UndoItem* New)
TQString Undo::actionText(Undo::Type type)
{
List* list = (type == UNDO) ? &mUndoList : (type == REDO) ? &mRedoList : 0;
- return (list && !list->isEmpty()) ? list->first()->actionText() : TQString::null;
+ return (list && !list->isEmpty()) ? list->first()->actionText() : TQString();
}
/******************************************************************************
@@ -428,7 +428,7 @@ TQString Undo::actionText(Undo::Type type)
TQString Undo::actionText(Undo::Type type, int id)
{
UndoItem* undo = getItem(id, type);
- return undo ? undo->actionText() : TQString::null;
+ return undo ? undo->actionText() : TQString();
}
/******************************************************************************
@@ -437,7 +437,7 @@ TQString Undo::actionText(Undo::Type type, int id)
TQString Undo::description(Undo::Type type, int id)
{
UndoItem* undo = getItem(id, type);
- return undo ? undo->description() : TQString::null;
+ return undo ? undo->description() : TQString();
}
/******************************************************************************
@@ -468,7 +468,7 @@ TQValueList<int> Undo::ids(Undo::Type type)
for (Undo::List::ConstIterator u = undos.begin(); u != undos.end(); ++u)
{
TQString evid = (*u)->eventID();
- if (ignoreIDs.find(evid) != ignoreIDs.end())
+ if (ignoreIDs.tqfind(evid) != ignoreIDs.end())
omit = true;
else if (omit)
ignoreIDs.append(evid);
@@ -483,7 +483,7 @@ TQValueList<int> Undo::ids(Undo::Type type)
}
else
{
- omit = (ignoreIDs.find(item->eventID()) != ignoreIDs.end());
+ omit = (ignoreIDs.tqfind(item->eventID()) != ignoreIDs.end());
if (!omit)
ignoreIDs.append(item->eventID());
if (item->operation() == UndoItem::EDIT)
@@ -586,7 +586,7 @@ TQString UndoItem::description(const KAEvent& event) const
/******************************************************************************
* Return the action description of an add or delete Undo/Redo item for displaying.
*/
-TQString UndoItem::addDeleteActionText(KAEvent::Status calendar, bool add)
+TQString UndoItem::addDeleteActionText(KAEvent::tqStatus calendar, bool add)
{
switch (calendar)
{
@@ -605,7 +605,7 @@ TQString UndoItem::addDeleteActionText(KAEvent::Status calendar, bool add)
default:
break;
}
- return TQString::null;
+ return TQString();
}
@@ -654,8 +654,8 @@ UndoItem* UndoMulti<T>::restore()
/******************************************************************************
* If one of the multiple items has the specified ID, delete it.
* If an item is deleted and there is only one item left, the UndoMulti
-* instance is removed from its list and tqreplaced by the remaining UndoItem instead.
-* Reply = true if this instance was tqreplaced. The caller must delete it.
+* instance is removed from its list and replaced by the remaining UndoItem instead.
+* Reply = true if this instance was replaced. The caller must delete it.
* = false otherwise.
*/
template <class T>
@@ -672,7 +672,7 @@ bool UndoMulti<T>::deleteID(const TQString& id)
{
// There is only one entry left after removal.
// Replace 'this' multi instance with the remaining single entry.
- tqreplaceWith(item);
+ replaceWith(item);
return true;
}
else
@@ -695,11 +695,11 @@ UndoAdd::UndoAdd(Undo::Type type, const KAEvent& event)
: UndoItem(type),
mEventID(event.id())
{
- setCalendar(KAEvent::uidStatus(mEventID));
+ setCalendar(KAEvent::uidtqStatus(mEventID));
mDescription = UndoItem::description(event); // calendar must be set before calling this
}
-UndoAdd::UndoAdd(Undo::Type type, const KAEvent& event, KAEvent::Status cal)
+UndoAdd::UndoAdd(Undo::Type type, const KAEvent& event, KAEvent::tqStatus cal)
: UndoItem(type),
mEventID(KAEvent::uid(event.id(), cal))
{
@@ -793,7 +793,7 @@ UndoEdit::UndoEdit(Undo::Type type, const KAEvent& oldEvent, const TQString& new
mNewEventID(newEventID),
mDescription(description)
{
- setCalendar(KAEvent::uidStatus(mNewEventID));
+ setCalendar(KAEvent::uidtqStatus(mNewEventID));
}
UndoEdit::~UndoEdit()
@@ -867,7 +867,7 @@ TQString UndoEdit::actionText() const
default:
break;
}
- return TQString::null;
+ return TQString();
}
@@ -880,7 +880,7 @@ UndoDelete::UndoDelete(Undo::Type type, const KAEvent& event)
: UndoItem(type),
mEvent(new KAEvent(event))
{
- setCalendar(KAEvent::uidStatus(mEvent->id()));
+ setCalendar(KAEvent::uidtqStatus(mEvent->id()));
}
UndoDelete::~UndoDelete()
@@ -998,7 +998,7 @@ UndoItem* UndoDeletes::createRedo(Undo::List& undos)
TQString UndoDeletes::actionText() const
{
if (mUndos.isEmpty())
- return TQString::null;
+ return TQString();
for (Undo::List::ConstIterator it = mUndos.begin(); it != mUndos.end(); ++it)
{
switch ((*it)->calendar())
@@ -1010,7 +1010,7 @@ TQString UndoDeletes::actionText() const
case KAEvent::EXPIRED:
break; // check if they are ALL expired
default:
- return TQString::null;
+ return TQString();
}
}
return i18n("Delete multiple expired alarms");