[texworks] Scripts: Hooks

Paul A Norman paul.a.norman at gmail.com
Tue Nov 2 10:16:08 CET 2010


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