[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kate/script
From: Christoph Cullmann <cullmann () kde ! org>
Date: 2010-06-13 17:40:04
Message-ID: 20100613174004.E836EAC8CF () svn ! kde ! org
[Download RAW message or body]
SVN commit 1137600 by cullmann:
dhaumann:
fix coding style.
@jowenn:
- what is a "token" (I don't get this)
- why do we need the "owners" (I don't get this)
- please use the standard coding style, as everyone else (I especially don't get \
this...)
CCMAIL: jowenn@kde.org
M +10 -12 katescriptmanager.cpp
M +4 -3 katescriptmanager.h
--- trunk/KDE/kdelibs/kate/script/katescriptmanager.cpp #1137599:1137600
@@ -361,7 +361,8 @@
-const QString KateScriptManager::registerTemplateScript (QObject* owner, const \
QString& script) { +const QString KateScriptManager::registerTemplateScript (QObject* \
owner, const QString& script) +{
static uint counter=0;
QUuid tokenId=QUuid::createUuid();
++counter;
@@ -369,26 +370,22 @@
m_tokenTemplateScript.insert(token, new KateTemplateScript(script));
- connect (owner,SIGNAL(destroyed(QObject*)),this,SLOT(slotTemplateScriptOwnerDestroyed(QObject*)));
+ connect(owner, SIGNAL(destroyed(QObject*)),
+ this, SLOT(slotTemplateScriptOwnerDestroyed(QObject*)));
m_ownerScriptTokens.insertMulti(owner,token);
return token;
}
-void KateScriptManager::unregisterTemplateScript(const QString& scriptToken) {
+void KateScriptManager::unregisterTemplateScript(const QString& scriptToken)
+{
QObject* k=m_ownerScriptTokens.key(scriptToken);
if (!k) return;
m_ownerScriptTokens.remove(k,scriptToken);
delete m_tokenTemplateScript.take(scriptToken);
}
-void KateScriptManager::callTestIt(KateView* view, const QString & token) {
- kDebug()<<"Invoking testit";
- KateTemplateScript *script=m_tokenTemplateScript[token];
- script->invoke(view,"testit","BLAH");
- kDebug()<<"Testit has been invoked";
-}
-
-void KateScriptManager::slotTemplateScriptOwnerDestroyed(QObject* owner) {
+void KateScriptManager::slotTemplateScriptOwnerDestroyed(QObject* owner)
+{
while(m_ownerScriptTokens.contains(owner)) {
QString token=m_ownerScriptTokens.take(owner);
kDebug()<<"Destroying template script"<<token;
@@ -396,7 +393,8 @@
}
}
-KateTemplateScript* KateScriptManager::templateScript(const QString& scriptToken) {
+KateTemplateScript* KateScriptManager::templateScript(const QString& scriptToken)
+{
return m_tokenTemplateScript[scriptToken];
}
--- trunk/KDE/kdelibs/kate/script/katescriptmanager.h #1137599:1137600
@@ -126,7 +126,7 @@
/** List of all command line scripts */
QVector<KateCommandLineScript*> m_commandLineScripts;
- /** * list of all indentation scripts */
+ /** list of all indentation scripts */
QList<KateIndentScript*> m_indentationScripts;
/** hash of all existing indenter scripts, hashes basename -> script */
@@ -136,16 +136,17 @@
QHash<QString, QVector<KateIndentScript*> > m_languageToIndenters;
+ //
+ // Template handling
+ //
public:
/** managing of scripts for the template handler. The scripts are given as \
string content, not as files*/
const QString registerTemplateScript (QObject* owner, const QString& script);
/** unregister a given script */
void unregisterTemplateScript(const QString& scriptToken);
-
KateTemplateScript* templateScript(const QString& scriptToken);
- void callTestIt(KateView* view, const QString & token);
public Q_SLOTS:
void slotTemplateScriptOwnerDestroyed(QObject* owner);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic