Georg Baum wrote:
> Here you are basically reintroducing the static app variable, and therefore
> the crash on exit on linux. A scoped_ptr is supposed to be equivalent to a
> normal object variable concerning construction and destruction, so if that
> is needed i think the old solution of Abdel is better.

Yes, the scoped _ptr adds only overhead.

> What I don't understand is: Why does it work for other windows users? 

Maybe they've used mingw, I use msvc.

> If
> this is really necessary we need to reintroduce the #ifdef of Abdel,
> because I get a crash on Linux with this patch.

Seems the destruction order is implemented different by those
two compilers. Why crashes it under Linux? Also because of
Qt objects?


>>         // install translation file for Qt built-in dialogs
>>         // These are only installed since Qt 3.2.x
>> -       QTranslator qt_trans(0);
>> -       if (qt_trans.load(QString("qt_") + QTextCodec::locale(),
>> -                         qInstallPathTranslations())) {
>> +       QTranslator qt_trans;
>> +       QString language_name = QString("qt_") + QLocale::system().name();
>> +       language_name.truncate(5);
>> +       if (qt_trans.load(language_name,
>> +               QLibraryInfo::location(QLibraryInfo::TranslationsPath))
>> +               )
>> +       {
> 
> This indentation is not LyX style, the old one is better.
> 

No problem.

>>                 qApp->installTranslator(&qt_trans);
>>                 // even if the language calls for RtL, don't do that
>> -               qApp->setReverseLayout(false);
>> +               qApp->setLayoutDirection(Qt::LeftToRight);
>>                 lyxerr[Debug::GUI]
>>                         << "Successfully installed Qt translations for
>>                         locale "
>> -                       << QTextCodec::locale() << std::endl;
>> +                       << language_name.toStdString().c_str() <<
>> std::endl;
> 
> toStdString is not available here (see QT_NO_STL). And why do you use c_str?
> 
> lyxerr << fromqstr(language_name);
> 

"fromqstr" is what I was looking for! :)

> works.
> 
> 
> Georg
> 
> 

Reply via email to