On Mon, Feb 22, 2010 at 04:35:00PM +0100, Uwe Stöhr wrote:
> Vincent van Ravesteijn - TNW schrieb:
>
>>> Vincent, Enrico, what Qt version are you using?
>>> (I can try to switch to Qt 4.6.2 and try again.)
>>
>> 4.7.
>
> The development version of Qt? OK, then upgrading to 4.6.2 wouldn't fix  
> this issue.

I don't think it is related to the Qt version.

Does the attached patch help?

Ignore the changes to GuiView.cpp (Pavel, Windows doesn't have a sleep()
function).

-- 
Enrico
Index: src/frontends/qt4/GuiView.cpp
===================================================================
--- src/frontends/qt4/GuiView.cpp       (revisione 33537)
+++ src/frontends/qt4/GuiView.cpp       (copia locale)
@@ -106,6 +106,10 @@
 #include <QUrl>
 #include <QScrollBar>
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 #define EXPORT_in_THREAD 1
 
 
@@ -2606,7 +2610,11 @@ void GuiView::dispatchVC(FuncRequest con
                CompareOptions options;
                Compare * compare = new Compare(loadIfNeeded(FileName(f1)), 
loadIfNeeded(FileName(f2)), dest, options);
                compare->start(QThread::LowPriority);
+#ifdef _WIN32
+               Sleep(2*1000);
+#else
                sleep(2);
+#endif
                lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH, 
dest->absFileName()));
                break;
        }
Index: src/support/qstring_helpers.h
===================================================================
--- src/support/qstring_helpers.h       (revisione 33537)
+++ src/support/qstring_helpers.h       (copia locale)
@@ -80,6 +80,10 @@ docstring qstring_to_ucs4(QString const 
  */
 std::string fromqstr(QString const & str);
 
+#ifdef _WIN32
+QString wstr_to_qstr(wchar_t const * wstr);
+#endif
+
 } // namespace lyx
 
 #endif // QSTRING_HELPERS_H
Index: src/support/os_win32.cpp
===================================================================
--- src/support/os_win32.cpp    (revisione 33537)
+++ src/support/os_win32.cpp    (copia locale)
@@ -276,7 +276,7 @@ static QString const get_long_path(QStri
                LASSERT(result <= long_path.size(), /**/);
        }
 
-       return (result == 0) ? short_path : 
QString::fromWCharArray(&long_path[0]);
+       return (result == 0) ? short_path : wstr_to_qstr(&long_path[0]);
 }
 
 
@@ -294,7 +294,7 @@ static QString const get_short_path(QStr
                LASSERT(result <= short_path.size(), /**/);
        }
 
-       return (result == 0) ? long_path : 
QString::fromWCharArray(&short_path[0]);
+       return (result == 0) ? long_path : wstr_to_qstr(&short_path[0]);
 }
 
 
Index: src/support/qstring_helpers.cpp
===================================================================
--- src/support/qstring_helpers.cpp     (revisione 33537)
+++ src/support/qstring_helpers.cpp     (copia locale)
@@ -67,4 +67,12 @@ std::string fromqstr(QString const & str
        return str.isEmpty() ? std::string() : std::string(str.toUtf8());
 }
 
+
+#ifdef _WIN32
+QString wstr_to_qstr(wchar_t const * wstr)
+{
+    return QString::fromWCharArray(wstr);
+}
+#endif
+
 } // namespace lyx

Reply via email to