[texworks] Scripts: Hooks

Paul A Norman paul.a.norman at gmail.com
Wed Nov 3 00:11:14 CET 2010


Yep, apologies I was looking through our network to the machine that
we compile TexWorkks on and I had been looking at the first tree we
ever downloaded for inspection (2009)

Mapped the correct tree as a drive now to avoid that happening again.

Just to confirm, SVN reports Tw as: At revision: 671 last commit in
July 2010? That is the latest.correct one?

All the hooks in the up to date TeXDocument.cpp are capitalized for
leading character as well as next word(s) as you recalled.

>line 381 TWScriptable.cpp
if (script->getHook().compare(hook, Qt::CaseInsensitive) == 0)

Paul


On 2 November 2010 22:16, Paul A Norman <paul.a.norman at gmail.com> wrote:
> On 2 November 2010 22:12, Stefan Löffler <st.loeffler at gmail.com> wrote:
>> Hi,
>>
>> Am 2010-11-02 10:09, schrieb Paul A Norman:
>>> P.S. or ...
>>>
>>> And in  TWScriptable.cpp
>>> TWScriptManager::getHookScripts(const QString& hook) const
>>>
>>> getHook() == hook
>>>
>>> could change both sides of boolean test all to lowercase() and avoid
>>> any such issues in ...
>>>
>>> if (script->getHook() == hook) {
>>>                       result.append(script);
>>>               }
>>
>> I just realized that it says in getHookScripts():
>>        if (script->getHook().compare(hook, Qt::CaseInsensitive) == 0)
>>
>> So the comparison *is* deliberately case insensitive. So there shouldn't
>> be a problem.
>>
>> HTH
>> Stefan
>>
>
> Ok I must be on an old revision
>
> QList<TWScript*> TWScriptManager::getHookScripts(const QString& hook) const
> {
>        QList<TWScript*> result;
>
>        foreach (TWScript *script, m_Hooks) {
>                if (script->getHook() == hook) {
>                        result.append(script);
>                }
>        }
>        return result;
> }
>
> Will check version number thanks Stefan.
>
> Paul
>



More information about the texworks mailing list