Skip to content

Commit

Permalink
fixup! use Qt::endl
Browse files Browse the repository at this point in the history
  • Loading branch information
Karry committed Aug 12, 2024
1 parent 0c34fed commit ad057cb
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build_and_test_on_ubuntu_24_04.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 8 additions & 3 deletions src/CameraModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#include <TimeLapse/pipeline_write_frame.h>
#include <TimeLapse/pipeline_cpt_qcamera.h>

#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)
Expand All @@ -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<timelapse::CaptureDevice> d : devices) {
connect(d.data(), &timelapse::CaptureDevice::update, this, &CameraModel::onCameraUpdate);
verboseOutput << " " << d->toString() << Qt::endl;
verboseOutput << " " << d->toString() << endl;
}
}
}
Expand Down Expand Up @@ -117,7 +122,7 @@ QList<QSharedPointer<timelapse::CaptureDevice>> CameraModel::listDevices() {
result.push_back(QSharedPointer<timelapse::Gphoto2Device>(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;
}

{
Expand Down

0 comments on commit ad057cb

Please sign in to comment.