From fb47d709ee585bcd876cb2d5479c720513fcc03e Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 19 Mar 2009 08:57:09 +0000 Subject: [PATCH] Fix display of release date with Qt 4.2. In Qt 4.2, QLocale::toString(QDate, ...) returns an invalid but not empty date when QDate is invalid. So, check whether QDate is valid before conversion. (status.16x is already updated) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@28864 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiAbout.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/GuiAbout.cpp b/src/frontends/qt4/GuiAbout.cpp index 9ec6cc337f..c21cb10777 100644 --- a/src/frontends/qt4/GuiAbout.cpp +++ b/src/frontends/qt4/GuiAbout.cpp @@ -94,10 +94,12 @@ static QString disclaimer() static QString version() { - QLocale loc; - QString loc_release_date = - loc.toString(release_date(), QLocale::LongFormat); - if (loc_release_date.isEmpty()) { + QString loc_release_date; + QDate date = release_date(); + if (date.isValid()) { + QLocale loc; + loc_release_date = loc.toString(date, QLocale::LongFormat); + } else { if (QString(lyx_release_date) == "not released yet") loc_release_date = qt_("not released yet"); else