[texworks] readFile() ... retVal["message"] = QVariant();

Paul A Norman paul.a.norman at gmail.com
Wed Dec 15 10:38:04 CET 2010

Yes thank you,  just wanting to establish default settings, or what
should  happen if some one does 'read' it.


On 15 December 2010 19:36, Stefan Löffler <st.loeffler at gmail.com> wrote:
> On 2010-12-15 01:54, Paul A Norman wrote:
>> QMap<QString, QVariant> TWScriptAPI::readFile(const QString& filename) const
>> {
>>        // relative paths are taken to be relative to the folder containing the
>>        // executing script's file
>>        QMap<QString, QVariant> retVal;
>>     retVal["message"]   = QVariant();
>> does this initially set   retVal["message"] to
>>     undefined
>> if not changed otherwise / assigned again later?
> Yes, I guess so. Might also come out as empty string, if forced to be
> converted to a string. As you can see from the code, though, it's only
> valid/useful for certain status values, and for them it gives a
> (translated) indication what happened. So normally, you should check the
> status value, and in case of problems display the "message" string to
> the user.
> Stefan

More information about the texworks mailing list