summaryrefslogtreecommitdiffstats
path: root/src/kile/editorkeysequencemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kile/editorkeysequencemanager.cpp')
-rw-r--r--src/kile/editorkeysequencemanager.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/kile/editorkeysequencemanager.cpp b/src/kile/editorkeysequencemanager.cpp
index 9d6ab40..213b959 100644
--- a/src/kile/editorkeysequencemanager.cpp
+++ b/src/kile/editorkeysequencemanager.cpp
@@ -23,17 +23,17 @@
namespace KileEditorKeySequence {
- Manager::Manager(KileInfo* kileInfo, QObject *parent, const char *name) : QObject(parent, name), m_kileInfo(kileInfo) {
+ Manager::Manager(KileInfo* kileInfo, TQObject *tqparent, const char *name) : TQObject(tqparent, name), m_kileInfo(kileInfo) {
}
Manager::~Manager() {
}
- void Manager::addAction(const QString& seq, Action *action) {
+ void Manager::addAction(const TQString& seq, Action *action) {
if(seq.isEmpty()) {
return;
}
- if(m_actionMap.find(seq) == m_actionMap.end()) {
+ if(m_actionMap.tqfind(seq) == m_actionMap.end()) {
m_actionMap[seq] = action;
m_watchedKeySequencesList.push_back(seq);
emit watchedKeySequencesChanged();
@@ -41,11 +41,11 @@ namespace KileEditorKeySequence {
}
- void Manager::removeKeySequence(const QString& seq) {
+ void Manager::removeKeySequence(const TQString& seq) {
if(seq.isEmpty()) {
return;
}
- QMap<QString, Action*>::iterator it = m_actionMap.find(seq);
+ TQMap<TQString, Action*>::iterator it = m_actionMap.tqfind(seq);
if(it != m_actionMap.end()) {
delete (it.data());
m_actionMap.remove(it);
@@ -54,13 +54,13 @@ namespace KileEditorKeySequence {
}
}
- void Manager::removeKeySequence(const QStringList& l) {
+ void Manager::removeKeySequence(const TQStringList& l) {
bool changed = false;
- for(QStringList::const_iterator i = l.begin(); i != l.end(); ++i) {
+ for(TQStringList::const_iterator i = l.begin(); i != l.end(); ++i) {
if((*i).isEmpty()) {
continue;
}
- QMap<QString, Action*>::iterator it = m_actionMap.find(*i);
+ TQMap<TQString, Action*>::iterator it = m_actionMap.tqfind(*i);
if(it != m_actionMap.end()) {
delete (it.data());
m_actionMap.remove(it);
@@ -73,9 +73,9 @@ namespace KileEditorKeySequence {
}
}
- void Manager::addActionMap(const QMap<QString, Action*>& map) {
+ void Manager::addActionMap(const TQMap<TQString, Action*>& map) {
bool changed = false;
- for(QMap<QString, Action*>::const_iterator i = map.begin(); i != map.end(); ++i) {
+ for(TQMap<TQString, Action*>::const_iterator i = map.begin(); i != map.end(); ++i) {
if(i.key().isEmpty()) {
continue;
}
@@ -89,24 +89,24 @@ namespace KileEditorKeySequence {
}
}
- QString Manager::getKeySequence(const Action* a) {
- for(QMap<QString, Action*>::const_iterator i = m_actionMap.begin(); i != m_actionMap.end(); ++i) {
+ TQString Manager::getKeySequence(const Action* a) {
+ for(TQMap<TQString, Action*>::const_iterator i = m_actionMap.begin(); i != m_actionMap.end(); ++i) {
if(i.data() == a) {
return i.key();
}
}
- return QString();
+ return TQString();
}
- Action* Manager::getAction(const QString& seq) {
- QMap<QString, Action*>::iterator i = m_actionMap.find(seq);
+ Action* Manager::getAction(const TQString& seq) {
+ TQMap<TQString, Action*>::iterator i = m_actionMap.tqfind(seq);
return (i == m_actionMap.end()) ? 0L : (*i);
}
- void Manager::setEditorKeySequence(const QString& /* seq */, Action* /* action */) {
+ void Manager::setEditorKeySequence(const TQString& /* seq */, Action* /* action */) {
}
- void Manager::keySequenceTyped(const QString& seq) {
+ void Manager::keySequenceTyped(const TQString& seq) {
m_actionMap[seq]->execute();
}
@@ -117,12 +117,12 @@ namespace KileEditorKeySequence {
}
- const QStringList& Manager::getWatchedKeySequences() {
+ const TQStringList& Manager::getWatchedKeySequences() {
return m_watchedKeySequencesList;
}
- bool Manager::isSequenceAssigned(const QString& seq) const {
- for(QValueList<QString>::const_iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
+ bool Manager::isSequenceAssigned(const TQString& seq) const {
+ for(TQValueList<TQString>::const_iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
if((*i).startsWith(seq)) {
return true;
}
@@ -130,24 +130,24 @@ namespace KileEditorKeySequence {
return false;
}
- QPair<int, QString> Manager::checkSequence(const QString& seq, const QString& skip) {
- for(QValueList<QString>::iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
+ TQPair<int, TQString> Manager::checkSequence(const TQString& seq, const TQString& skip) {
+ for(TQValueList<TQString>::iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
if((*i) == skip) {
continue;
}
if((*i).startsWith(seq)) {
- return (*i == seq) ? qMakePair<int, QString>(1, seq) : qMakePair<int, QString>(2, *i);
+ return (*i == seq) ? tqMakePair<int, TQString>(1, seq) : tqMakePair<int, TQString>(2, *i);
}
if(!(*i).isEmpty() && seq.startsWith(*i)) {
- return qMakePair<int, QString>(3, *i);
+ return tqMakePair<int, TQString>(3, *i);
}
}
- return qMakePair<int, QString>(0, QString());
+ return tqMakePair<int, TQString>(0, TQString());
}
-Recorder::Recorder(Kate::View *view, Manager *manager) : QObject(view), m_manager(manager), m_view(view) {
- connect(m_manager, SIGNAL(watchedKeySequencesChanged()), this, SLOT(reloadWatchedKeySequences()));
- connect(this, SIGNAL(detectedTypedKeySequence(const QString&)), m_manager, SLOT(keySequenceTyped(const QString&)));
+Recorder::Recorder(Kate::View *view, Manager *manager) : TQObject(view), m_manager(manager), m_view(view) {
+ connect(m_manager, TQT_SIGNAL(watchedKeySequencesChanged()), this, TQT_SLOT(reloadWatchedKeySequences()));
+ connect(this, TQT_SIGNAL(detectedTypedKeySequence(const TQString&)), m_manager, TQT_SLOT(keySequenceTyped(const TQString&)));
m_view->cursorPositionReal(&m_oldLine, &m_oldCol);
reloadWatchedKeySequences();
}
@@ -155,13 +155,13 @@ Recorder::Recorder(Kate::View *view, Manager *manager) : QObject(view), m_manage
Recorder::~Recorder() {
}
-bool Recorder::eventFilter(QObject* /* o */, QEvent *e) {
- if (e->type() == QEvent::KeyPress) {
- QKeyEvent *keyEvent = (QKeyEvent*)(e);
+bool Recorder::eventFilter(TQObject* /* o */, TQEvent *e) {
+ if (e->type() == TQEvent::KeyPress) {
+ TQKeyEvent *keyEvent = (TQKeyEvent*)(e);
uint curLine, curCol;
m_view->cursorPositionReal(&curLine, &curCol);
if(curLine != m_oldLine || m_oldCol+1 != curCol) {
- m_typedSequence = QString();
+ m_typedSequence = TQString();
m_oldLine = curLine;
m_oldCol = curCol;
}
@@ -177,12 +177,12 @@ bool Recorder::eventFilter(QObject* /* o */, QEvent *e) {
return false;
}
- bool Recorder::seekForKeySequence(const QString& s) {
+ bool Recorder::seekForKeySequence(const TQString& s) {
for(uint i = 0; i < s.length(); ++i) {
- QString toCheck = s.right(s.length() - i);
- if(m_watchedKeySequencesList.contains(toCheck) > 0) {
+ TQString toCheck = s.right(s.length() - i);
+ if(m_watchedKeySequencesList.tqcontains(toCheck) > 0) {
m_view->getDoc()->removeText(m_oldLine, m_oldCol-(s.length() - i - 1), m_oldLine, m_oldCol);
- m_typedSequence = QString::null; // clean m_typedSequence to avoid wrong action triggering if one presses keys without printable character
+ m_typedSequence = TQString(); // clean m_typedSequence to avoid wrong action triggering if one presses keys without printable character
emit detectedTypedKeySequence(toCheck);
return true;
}
@@ -193,7 +193,7 @@ bool Recorder::eventFilter(QObject* /* o */, QEvent *e) {
void Recorder::reloadWatchedKeySequences() {
m_watchedKeySequencesList = m_manager->getWatchedKeySequences();
m_maxSequenceLength = 0;
- for(QStringList::iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
+ for(TQStringList::iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
m_maxSequenceLength = MAX(m_maxSequenceLength, (*i).length());
}
if(m_maxSequenceLength < m_typedSequence.length()) {
@@ -207,8 +207,8 @@ bool Recorder::eventFilter(QObject* /* o */, QEvent *e) {
Action::~Action() {
}
- QString Action::getDescription() const {
- return QString();
+ TQString Action::getDescription() const {
+ return TQString();
}
ExecuteJScriptAction::ExecuteJScriptAction(KileJScript::JScript *jScript, KileJScript::Manager *jScriptManager) : m_jScript(jScript), m_jScriptManager(jScriptManager){
@@ -221,8 +221,8 @@ bool Recorder::eventFilter(QObject* /* o */, QEvent *e) {
m_jScriptManager->executeJScript(m_jScript);
}
- QString ExecuteJScriptAction::getDescription() const {
- return i18n("Script execution of %1").arg(m_jScript->getFileName());
+ TQString ExecuteJScriptAction::getDescription() const {
+ return i18n("Script execution of %1").tqarg(m_jScript->getFileName());
}