From 9550c53c05969353233850a5c120c3f9dea44b10 Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 31 Aug 2021 17:27:07 +0800 Subject: [PATCH 1/4] Add github ci --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a71b4bd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + debian: + name: Debian + runs-on: ubuntu-latest + container: docker.io/library/debian:sid + steps: + - name: Checkout Source + uses: actions/checkout@v2 + - name: Update repository + run: apt-get update -y + - name: Install the basic dev packages + run: apt-get install -y equivs curl git devscripts lintian build-essential automake autotools-dev cmake g++ + - name: Install build dependencies + run: mk-build-deps -i -t "apt-get --yes" -r + - name: Build Package + run: dpkg-buildpackage -b -uc -us -j$(nproc) + + ubuntu: + name: Ubuntu + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v2 + - name: Update repository + run: sudo apt-get update -y + - name: Install the basic dev packages + run: sudo apt-get install -y equivs curl git devscripts lintian build-essential automake autotools-dev cmake g++ + - name: Install build dependencies + run: sudo mk-build-deps -i -t "apt-get --yes" -r + - name: Build Package + run: dpkg-buildpackage -b -uc -us -j$(nproc) From 380e509df100b00269a99959c675df98c0b900d1 Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 31 Aug 2021 17:33:49 +0800 Subject: [PATCH 2/4] Fix qt endl --- qmltermwidget/lib/kpty.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmltermwidget/lib/kpty.cpp b/qmltermwidget/lib/kpty.cpp index fe901dc..d758a94 100644 --- a/qmltermwidget/lib/kpty.cpp +++ b/qmltermwidget/lib/kpty.cpp @@ -331,7 +331,12 @@ gotpty: !d->chownpty(true)) { qWarning() << "chownpty failed for device " << ptyName << "::" << d->ttyName - << "\nThis means the communication can be eavesdropped." << Qt::endl; + << "\nThis means the communication can be eavesdropped." +#if QT_VERSION >= 0x050e00 + << Qt::endl; +#else + << endl; +#endif } #if defined (HAVE__GETPTY) || defined (HAVE_GRANTPT) From c33e012aeb3d5e7f9eb43a2df66db927ef4a1965 Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 31 Aug 2021 17:41:16 +0800 Subject: [PATCH 3/4] Fix Qt SkipEmptyParts --- qmltermwidget/lib/ProcessInfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qmltermwidget/lib/ProcessInfo.cpp b/qmltermwidget/lib/ProcessInfo.cpp index af15d33..bed8ed9 100644 --- a/qmltermwidget/lib/ProcessInfo.cpp +++ b/qmltermwidget/lib/ProcessInfo.cpp @@ -442,7 +442,11 @@ private: uidLine = statusLine; } while (!statusLine.isNull() && uidLine.isNull()); - uidStrings << uidLine.split('\t', Qt::SkipEmptyParts); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + uidStrings << uidLine.split('\t', QString::SkipEmptyParts); +#else + uidStrings << uidLine.split('\t', Qt::SkipEmptyParts); +#endif // Must be 5 entries: 'Uid: %d %d %d %d' and // uid string must be less than 5 chars (uint) if (uidStrings.size() == 5) From 529de3b43726176774683573880c66f166a0c7c5 Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 31 Aug 2021 17:49:56 +0800 Subject: [PATCH 4/4] Fix wheelEvent --- qmltermwidget/lib/TerminalDisplay.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmltermwidget/lib/TerminalDisplay.cpp b/qmltermwidget/lib/TerminalDisplay.cpp index a18a290..af91ab1 100644 --- a/qmltermwidget/lib/TerminalDisplay.cpp +++ b/qmltermwidget/lib/TerminalDisplay.cpp @@ -2447,7 +2447,12 @@ void TerminalDisplay::wheelEvent( QWheelEvent* ev ) // terminal program wants notification of mouse activity int charLine; int charColumn; - getCharacterPosition(ev->position().toPoint() , charLine , charColumn); + +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + getCharacterPosition(ev->pos(), charLine, charColumn); +#else + getCharacterPosition(ev->position().toPoint(), charLine, charColumn); +#endif emit mouseSignal(ev->angleDelta().y() > 0 ? 4 : 5, charColumn + 1,