summaryrefslogtreecommitdiffstats
path: root/quanta/utility/qpevents.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/utility/qpevents.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/utility/qpevents.cpp')
-rw-r--r--quanta/utility/qpevents.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/quanta/utility/qpevents.cpp b/quanta/utility/qpevents.cpp
index 3426b83f..7be8fc66 100644
--- a/quanta/utility/qpevents.cpp
+++ b/quanta/utility/qpevents.cpp
@@ -36,8 +36,8 @@
#include "tagaction.h"
//TODO: Better create a class for each internal event action
-QPEvents::QPEvents(TQObject *parent, const char *name)
- : TQObject(parent, name)
+TQPEvents::TQPEvents(TQObject *tqparent, const char *name)
+ : TQObject(tqparent, name)
{
m_eventNames["before_save"] = i18n("Before Document Save");
m_eventNames["after_save"] = i18n("After Document Save");
@@ -66,17 +66,17 @@ QPEvents::QPEvents(TQObject *parent, const char *name)
}
-QPEvents::~QPEvents()
+TQPEvents::~TQPEvents()
{
}
-void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1, const TQString& argument2)
+void TQPEvents::slotEventHappened(const TQString& name, const TQString& argument1, const TQString& argument2)
{
if (!quantaApp || !Project::ref()->eventsEnabled())
return;
EventActions *events = Project::ref()->events();
if (!events) return;
- if (events->contains(name))
+ if (events->tqcontains(name))
{
m_eventName = name;
TQValueList<EventAction> evList = (*events)[name];
@@ -85,18 +85,18 @@ void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1
EventAction ev = *it;
if (ev.type == EventAction::Internal)
{
- if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An internal action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").arg(ev.action).arg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about internal actions") == KMessageBox::Cancel)
+ if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An internal action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").tqarg(ev.action).tqarg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about internal actions") == KMessageBox::Cancel)
return;
} else
{
- if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An external action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").arg(ev.action).arg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about external actions") == KMessageBox::Cancel)
+ if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An external action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").tqarg(ev.action).tqarg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about external actions") == KMessageBox::Cancel)
return;
}
KURL url = KURL::fromPathOrURL(argument1);
KURL url2 = KURL::fromPathOrURL(argument2);
if (url.isValid())
{
- bool inProject = Project::ref()->contains(url);
+ bool inProject = Project::ref()->tqcontains(url);
if (inProject)
{
if (name == "upload_requested")
@@ -131,7 +131,7 @@ void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1
}
} else
{
- TQString relativePath = QExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()).path();
+ TQString relativePath = TQExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()).path();
if (inProject && name == "after_save")
{
ev.arguments << i18n("Document saved");
@@ -220,11 +220,11 @@ void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1
}
}
}
- if (!m_eventNames.contains(name))
- KMessageBox::sorry(0L, i18n("<qt>Unsupported event <b>%1</b>.</qt>").arg(name), i18n("Event Handling Error"));
+ if (!m_eventNames.tqcontains(name))
+ KMessageBox::sorry(0L, i18n("<qt>Unsupported event <b>%1</b>.</qt>").tqarg(name), i18n("Event Handling Error"));
}
-bool QPEvents::handleEvent(const EventAction& ev)
+bool TQPEvents::handleEvent(const EventAction& ev)
{
if (ev.type == EventAction::Internal)
{
@@ -294,7 +294,7 @@ bool QPEvents::handleEvent(const EventAction& ev)
TQTextStream stream(&file);
stream.setEncoding(TQTextStream::UnicodeUTF8);
//Note: the log text should not be translated.
- TQString s = TQDateTime::currentDateTime().toString(Qt::ISODate) + ": ";
+ TQString s = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate) + ": ";
s.append( "Event : " + m_eventName + " : ");
s.append( "Action: " + ev.action + " : ");
if (ev.arguments[1] == "full")
@@ -309,11 +309,11 @@ bool QPEvents::handleEvent(const EventAction& ev)
}
if (!result)
{
- KMessageBox::sorry(0L, i18n("<qt>Logging failed. Check that you have write access to <i>%1</i>.").arg(url.path()));
+ KMessageBox::sorry(0L, i18n("<qt>Logging failed. Check that you have write access to <i>%1</i>.").tqarg(url.path()));
return false;
}
} else
- KMessageBox::sorry(0L, i18n("<qt>Unsupported internal event action : <b>%1</b>.</qt>").arg(ev.action));
+ KMessageBox::sorry(0L, i18n("<qt>Unsupported internal event action : <b>%1</b>.</qt>").tqarg(ev.action));
} else
if (ev.type == EventAction::External)
{
@@ -336,7 +336,7 @@ bool QPEvents::handleEvent(const EventAction& ev)
{
action->activate();
} else
- KMessageBox::sorry(0L, i18n("<qt>The <b>%1</b> script action was not found on your system.</qt>").arg(name), i18n("Action Execution Error"));
+ KMessageBox::sorry(0L, i18n("<qt>The <b>%1</b> script action was not found on your system.</qt>").tqarg(name), i18n("Action Execution Error"));
} else
KMessageBox::sorry(0L, i18n("Unsupported external event action."));
} else
@@ -344,23 +344,23 @@ bool QPEvents::handleEvent(const EventAction& ev)
return false;
}
-TQString QPEvents::fullEventName(const TQString &name)
+TQString TQPEvents::fullEventName(const TQString &name)
{
- if (m_eventNames.contains(name))
+ if (m_eventNames.tqcontains(name))
return m_eventNames[name];
else
return name;
}
-TQString QPEvents::fullActionName(const TQString& name)
+TQString TQPEvents::fullActionName(const TQString& name)
{
- if (m_actionNames.contains(name))
+ if (m_actionNames.tqcontains(name))
return m_actionNames[name];
else
return name;
}
-TQString QPEvents::eventName(const TQString &fullName)
+TQString TQPEvents::eventName(const TQString &fullName)
{
for (TQMap<TQString, TQString>::ConstIterator it = m_eventNames.constBegin(); it != m_eventNames.constEnd(); ++it)
{
@@ -370,7 +370,7 @@ TQString QPEvents::eventName(const TQString &fullName)
return fullName;
}
-TQString QPEvents::actionName(const TQString &fullName)
+TQString TQPEvents::actionName(const TQString &fullName)
{
for (TQMap<TQString, TQString>::ConstIterator it = m_actionNames.constBegin(); it != m_actionNames.constEnd(); ++it)
{
@@ -380,7 +380,7 @@ TQString QPEvents::actionName(const TQString &fullName)
return fullName;
}
-TQStringList QPEvents::eventNames()
+TQStringList TQPEvents::eventNames()
{
TQStringList names;
for (TQMap<TQString, TQString>::ConstIterator it = m_eventNames.constBegin(); it != m_eventNames.constEnd(); ++it)
@@ -390,7 +390,7 @@ TQStringList QPEvents::eventNames()
return names;
}
-TQStringList QPEvents::actionNames()
+TQStringList TQPEvents::actionNames()
{
TQStringList names;
for (TQMap<TQString, TQString>::ConstIterator it = m_actionNames.constBegin(); it != m_actionNames.constEnd(); ++it)