From ad057cb42a8745cb4b9bacd96045e23c317cbabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Karas?= Date: Tue, 13 Aug 2024 00:13:54 +0200 Subject: [PATCH] fixup! use Qt::endl --- .../build_and_test_on_ubuntu_24_04.yml | 39 +++++++++++++++++++ src/CameraModel.cpp | 11 ++++-- 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build_and_test_on_ubuntu_24_04.yml diff --git a/.github/workflows/build_and_test_on_ubuntu_24_04.yml b/.github/workflows/build_and_test_on_ubuntu_24_04.yml new file mode 100644 index 0000000..e5de709 --- /dev/null +++ b/.github/workflows/build_and_test_on_ubuntu_24_04.yml @@ -0,0 +1,39 @@ +name: Ubuntu 24.04 + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build_gcc_cmake: + name: gcc and cmake + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + run: "sudo apt-get update && sudo apt-get install -y --fix-broken + git make libtool pkg-config cmake libarchive-tools + qtdeclarative5-dev libqt5svg5-dev + qttools5-dev-tools qttools5-dev + qtmultimedia5-dev" + - name: Install libsailfishapp + run: "git clone https://github.com/sailfish-sdk/libsailfishapp.git dependencies/libsailfishapp && + cd dependencies/libsailfishapp && + git checkout tags/0.0.5 -b 0.0.5 && + qmake PREFIX=/usr . && + make && + sudo make install" + - name: Configure build project + run: cmake -B build -DCMAKE_UNITY_BUILD=ON -Wno-dev + - name: Build project + run: cmake --build build -- all + - name: Run tests + run: ctest --output-on-failure + working-directory: build diff --git a/src/CameraModel.cpp b/src/CameraModel.cpp index d644bc7..28b0238 100644 --- a/src/CameraModel.cpp +++ b/src/CameraModel.cpp @@ -29,6 +29,11 @@ #include #include +#if QT_VERSION < QT_VERSION_CHECK(5,14,0) +inline QTextStream &endl(QTextStream &s) { + return QTextStreamFunctions::endl(s); +} +#endif CameraModel::CameraModel(QObject *parent): QAbstractListModel(parent) @@ -38,10 +43,10 @@ CameraModel::CameraModel(QObject *parent): if (devices.isEmpty()) { verboseOutput << QCoreApplication::translate("main", "No compatible capture device found"); } else { - verboseOutput << "Found devices: " << Qt::endl; + verboseOutput << "Found devices: " << endl; for (QSharedPointer d : devices) { connect(d.data(), &timelapse::CaptureDevice::update, this, &CameraModel::onCameraUpdate); - verboseOutput << " " << d->toString() << Qt::endl; + verboseOutput << " " << d->toString() << endl; } } } @@ -117,7 +122,7 @@ QList> CameraModel::listDevices() { result.push_back(QSharedPointer(new timelapse::Gphoto2Device(gp2Dev))); } } catch (std::exception &e) { - err << "Can't get Gphoto2 devices. " << QString::fromUtf8(e.what()) << Qt::endl; + err << "Can't get Gphoto2 devices. " << QString::fromUtf8(e.what()) << endl; } {