diff --git a/.travis/build-ubuntu-14-04.sh b/.travis/build-ubuntu-14-04.sh index a78d5b068..f19b5e97e 100755 --- a/.travis/build-ubuntu-14-04.sh +++ b/.travis/build-ubuntu-14-04.sh @@ -19,8 +19,8 @@ # stop as soon as one of steps will fail set -e -o pipefail -# Qt 5.6, since that's the lowest supported version -sudo add-apt-repository -y ppa:beineri/opt-qt562-trusty +# Qt 5.5, since that's the lowest supported version +sudo add-apt-repository -y ppa:beineri/opt-qt551-trusty sudo apt-get update -qq # install needed Qt, OpenAL, opus, qrencode, GTK tray deps, sqlcipher @@ -42,15 +42,15 @@ sudo apt-get install -y --force-yes \ libtool \ libvpx-dev \ libxss-dev qrencode \ - qt56base \ - qt56script \ - qt56svg \ - qt56tools \ - qt56xmlpatterns \ + qt55base \ + qt55script \ + qt55svg \ + qt55tools \ + qt55xmlpatterns \ pkg-config || yes # Qt -source /opt/qt56/bin/qt56-env.sh || yes +source /opt/qt55/bin/qt55-env.sh || yes # ffmpeg if [ ! -e "libs" ]; then mkdir libs; fi diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 8a1c9ac8a..3d231ba57 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -600,6 +600,7 @@ bool GenericChatForm::searchInText(const QString& phrase, const ParameterSearch& startLine = static_cast(std::distance(lines.begin(), find)); } } else if (parameter.period == PeriodSearch::BeforeDate) { +#if QT_VERSION > QT_VERSION_CHECK(5, 6, 0) const auto lambda = [=](const ChatLine::Ptr& item) { const auto d = getDate(item); return d.isValid() && parameter.date >= d; @@ -610,6 +611,15 @@ bool GenericChatForm::searchInText(const QString& phrase, const ParameterSearch& if (find != lines.rend()) { startLine = static_cast(std::distance(find, lines.rend())) - 1; } +#else + for (int i = lines.size() - 1; i >= 0; --i) { + auto d = getDate(lines[i]); + if (d.isValid() && parameter.date >= d) { + startLine = i; + break; + } + } +#endif } if (startLine < 0 || startLine >= numLines) {