mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: add code for work in Qt5.5
This commit is contained in:
parent
7977c80a52
commit
81587d0fbb
|
@ -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
|
||||
|
|
|
@ -600,6 +600,7 @@ bool GenericChatForm::searchInText(const QString& phrase, const ParameterSearch&
|
|||
startLine = static_cast<int>(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<int>(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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user