Fix issues with old qt and bump to 5.10

This commit is contained in:
Nicolas Werner 2020-10-08 17:26:07 +02:00
parent 99ba1f17d3
commit 08d5a84cbd
4 changed files with 26 additions and 24 deletions

View File

@ -63,21 +63,21 @@ matrix:
env: env:
- CXX=g++-8 - CXX=g++-8
- CC=gcc-8 - CC=gcc-8
- QT_PKG=59 - QT_PKG=510
addons: addons:
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt597-xenial' - sourceline: 'ppa:beineri/opt-qt-5.10.1-xenial'
packages: packages:
- g++-8 - g++-8
- ninja-build - ninja-build
- qt59base - qt510base
- qt59tools - qt510tools
- qt59svg - qt510svg
- qt59multimedia - qt510multimedia
- qt59quickcontrols2 - qt510quickcontrols2
- qt59graphicaleffects - qt510graphicaleffects
- liblmdb-dev - liblmdb-dev
- libgl1-mesa-dev # needed for missing gl.h - libgl1-mesa-dev # needed for missing gl.h
- os: linux - os: linux
@ -85,23 +85,23 @@ matrix:
env: env:
- CXX=clang++-6.0 - CXX=clang++-6.0
- CC=clang-6.0 - CC=clang-6.0
- QT_PKG=59 - QT_PKG=510
addons: addons:
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0 - llvm-toolchain-xenial-6.0
- sourceline: 'ppa:beineri/opt-qt597-xenial' - sourceline: 'ppa:beineri/opt-qt-5.10.1-xenial'
packages: packages:
- clang++-6.0 - clang++-6.0
- g++-7 - g++-7
- ninja-build - ninja-build
- qt59base - qt510base
- qt59tools - qt510tools
- qt59svg - qt510svg
- qt59multimedia - qt510multimedia
- qt59quickcontrols2 - qt510quickcontrols2
- qt59graphicaleffects - qt510graphicaleffects
- liblmdb-dev - liblmdb-dev
- libgl1-mesa-dev # needed for missing gl.h - libgl1-mesa-dev # needed for missing gl.h
- os: linux - os: linux

View File

@ -142,9 +142,9 @@ if (APPLE)
endif(APPLE) endif(APPLE)
if (Qt5Widgets_FOUND) if (Qt5Widgets_FOUND)
if (Qt5Widgets_VERSION VERSION_LESS 5.9.0) if (Qt5Widgets_VERSION VERSION_LESS 5.10.0)
message(STATUS "Qt version ${Qt5Widgets_VERSION}") message(STATUS "Qt version ${Qt5Widgets_VERSION}")
message(WARNING "Minimum supported Qt5 version is 5.9!") message(WARNING "Minimum supported Qt5 version is 5.10!")
endif() endif()
endif(Qt5Widgets_FOUND) endif(Qt5Widgets_FOUND)

View File

@ -174,7 +174,7 @@ sudo pacman -S qt5-base \
##### Gentoo Linux ##### Gentoo Linux
```bash ```bash
sudo emerge -a ">=dev-qt/qtgui-5.9.0" media-libs/fontconfig sudo emerge -a ">=dev-qt/qtgui-5.10.0" media-libs/fontconfig
``` ```
##### Ubuntu 20.04 ##### Ubuntu 20.04

View File

@ -125,11 +125,13 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin
0, 0,
"UserProfileModel", "UserProfileModel",
"UserProfile needs to be instantiated on the C++ side"); "UserProfile needs to be instantiated on the C++ side");
static auto self = this;
qmlRegisterSingletonType<TimelineViewManager>( qmlRegisterSingletonType<TimelineViewManager>(
"im.nheko", 1, 0, "TimelineManager", [this](QQmlEngine *, QJSEngine *) { return this; }); "im.nheko", 1, 0, "TimelineManager", [](QQmlEngine *, QJSEngine *) { return self; });
qmlRegisterSingletonType<UserSettings>( qmlRegisterSingletonType<UserSettings>(
"im.nheko", 1, 0, "Settings", [this](QQmlEngine *, QJSEngine *) { "im.nheko", 1, 0, "Settings", [](QQmlEngine *, QJSEngine *) {
return this->settings.data(); return self->settings.data();
}); });
qRegisterMetaType<mtx::events::collections::TimelineEvents>(); qRegisterMetaType<mtx::events::collections::TimelineEvents>();
@ -413,8 +415,8 @@ void
TimelineViewManager::removeVerificationFlow(DeviceVerificationFlow *flow) TimelineViewManager::removeVerificationFlow(DeviceVerificationFlow *flow)
{ {
for (auto it = dvList.keyValueBegin(); it != dvList.keyValueEnd(); ++it) { for (auto it = dvList.keyValueBegin(); it != dvList.keyValueEnd(); ++it) {
if (it->second == flow) { if ((*it).second == flow) {
dvList.remove(it->first); dvList.remove((*it).first);
return; return;
} }
} }