Skip to content

Commit

Permalink
Work around QLocale().timeFormat().simplified() seg faulting in Qt5.6…
Browse files Browse the repository at this point in the history
… with GCC4.8.
  • Loading branch information
dcaliste committed Feb 22, 2017
1 parent cf81fc0 commit a6e6a4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion calligra/sheets/ValueParser.cpp
Expand Up @@ -390,7 +390,10 @@ Value ValueParser::tryParseTime(const QString& str, bool *ok) const
QDateTime ValueParser::readTime(const QString& intstr, bool withSeconds, bool* ok) const
{
QString str = intstr.simplified().toLower();
QString format = m_settings->locale()->timeFormat().simplified();
// Workaround segfault with gcc 4.8 and Qt5.6 when calling
// m_settings->locale()->timeFormat().simplified() all in one line.
QString timeFormat = m_settings->locale()->timeFormat();
QString format = timeFormat.simplified();
if (!withSeconds) {
int n = format.indexOf("%S");
format = format.left(n - 1);
Expand Down

0 comments on commit a6e6a4b

Please sign in to comment.