On Fri, Sep 15, 2006 at 02:06:09PM +0200, Jean-Marc Lasgouttes wrote: > >>>>> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes: > > Enrico> according to Rainer Dorsch the attached patch let LyX compile > Enrico> again with qt3.0. Please let me know if I can apply it to > Enrico> 1.4.x. > > The change in toqstr should be conditionned on qt version too. Using > fromLatin1 defeats the purpose of using > QTextCodec::setCodecForCStrings, as I read it from the documentation.
You're right. I should have checked that, too. > With these things fixed, the patch is OK. I have committed the attached patch. -- Enrico
Index: src/frontends/qt2/qt_helpers.C =================================================================== --- src/frontends/qt2/qt_helpers.C (revision 15010) +++ src/frontends/qt2/qt_helpers.C (working copy) @@ -116,7 +116,11 @@ void lengthToWidgets(QLineEdit * input, QString const toqstr(char const * str) { +#if QT_VERSION >= 0x030100 return QString::fromAscii(str); +#else + return QString::fromLatin1(str); +#endif } Index: src/frontends/qt2/ChangeLog =================================================================== --- src/frontends/qt2/ChangeLog (revision 15010) +++ src/frontends/qt2/ChangeLog (working copy) @@ -1,3 +1,10 @@ +2006-09-15 Enrico Forestieri <[EMAIL PROTECTED]> + + * qt_helpers.C (toqstr): use fromAscii only with Qt 3.1 and higher. + + * QLyXKeySym.C (initEncodings): use setCodecForCStrings only with + Qt 3.1 and higher. + 2006-08-19 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * QContentPane.C (focusInEvent, focusOutEvent): new methods; Index: src/frontends/qt2/QLyXKeySym.C =================================================================== --- src/frontends/qt2/QLyXKeySym.C (revision 15010) +++ src/frontends/qt2/QLyXKeySym.C (working copy) @@ -130,7 +130,9 @@ void initEncodings() QTextCodec * defaultCodec = encoding_map[s]; encoding_map[""] = defaultCodec; +#if QT_VERSION >= 0x030100 QTextCodec::setCodecForCStrings(defaultCodec); +#endif }