diff --git a/.github/workflows/action-cpp.yml b/.github/workflows/action-cpp.yml index 993367c..f35c831 100644 --- a/.github/workflows/action-cpp.yml +++ b/.github/workflows/action-cpp.yml @@ -15,12 +15,12 @@ jobs: distro: ubuntu_latest - arch: riscv64 distro: ubuntu_latest - - arch: aarch64 - distro: fedora_latest - - arch: ppc64le - distro: fedora_latest - - arch: s390x - distro: fedora_latest + # - arch: aarch64 + # distro: fedora_latest + # - arch: ppc64le + # distro: fedora_latest + # - arch: s390x + # distro: fedora_latest steps: - name: Get current date id: date @@ -31,7 +31,7 @@ jobs: - name: Set artifacts dir id: artifacts run: echo "artifacts=$(echo $PWD/artifacts)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: uraimo/run-on-arch-action@v2 name: Run commands id: configure-and-build @@ -70,7 +70,7 @@ jobs: id: get-version run: echo "prj_ver=$(cat ${PWD}/artifacts/VERSION.txt)" >> $GITHUB_OUTPUT - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}-{2}', steps.get-version.outputs.prj_ver, matrix.distro, matrix.arch) }} path: ${{ format('{0}/Qldd-{1}-{2}.???', steps.artifacts.outputs.artifacts ,steps.get-version.outputs.prj_ver, matrix.arch) }} @@ -85,6 +85,7 @@ jobs: matrix: container: - ubuntu:22.04 + - ubuntu:24.04 container: image: ${{ matrix.container }} @@ -96,7 +97,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: devel-pkgs run: apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++ lsb-release @@ -115,7 +116,7 @@ jobs: - name: cpack run: cd cmake-build-release && cpack -G DEB && cd .. # upload artifact - - uses: mad9000/actions-find-and-replace-string@3 + - uses: mad9000/actions-find-and-replace-string@5 id: container with: source: ${{ matrix.container }} @@ -123,7 +124,7 @@ jobs: replace: '-' # and replace it with - - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }} path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }} @@ -148,7 +149,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: devel-pkgs run: | @@ -169,7 +170,7 @@ jobs: - name: cpack run: cd cmake-build-release && cpack -G DEB && cd .. # upload artifact - - uses: mad9000/actions-find-and-replace-string@3 + - uses: mad9000/actions-find-and-replace-string@5 id: container with: source: ${{ matrix.container }} @@ -177,7 +178,7 @@ jobs: replace: '-' # and replace it with - - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }} path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }} @@ -202,7 +203,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: devel-pkgs run: apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++ lsb-release @@ -221,7 +222,7 @@ jobs: - name: cpack run: cd cmake-build-release && cpack -G DEB && cd .. # upload artifact - - uses: mad9000/actions-find-and-replace-string@3 + - uses: mad9000/actions-find-and-replace-string@5 id: container with: source: ${{ matrix.container }} @@ -229,7 +230,7 @@ jobs: replace: '-' # and replace it with - - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }} path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }} @@ -254,7 +255,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: devel-pkgs run: apt-get update -y && apt-get install -yq binutils python-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++ lsb-release @@ -273,7 +274,7 @@ jobs: - name: cpack run: cd cmake-build-release && cpack -G DEB && cd .. # upload artifact - - uses: mad9000/actions-find-and-replace-string@3 + - uses: mad9000/actions-find-and-replace-string@5 id: container with: source: ${{ matrix.container }} @@ -281,7 +282,7 @@ jobs: replace: '-' # and replace it with - - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }} path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }} @@ -306,7 +307,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: devel-pkgs run: | @@ -331,7 +332,7 @@ jobs: - name: cpack run: cd cmake-build-release && cpack -G RPM && cd .. # upload artifact - - uses: mad9000/actions-find-and-replace-string@3 + - uses: mad9000/actions-find-and-replace-string@5 id: container with: source: ${{ matrix.container }} @@ -339,7 +340,7 @@ jobs: replace: '-' # and replace it with - - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }} path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }} @@ -364,7 +365,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: devel-pkgs run: yum update -y && yum install -yq binutils python3-nautilus qt5-qtbase-devel qt5-qttools rpm-build redhat-lsb @@ -383,7 +384,7 @@ jobs: - name: cpack run: cd cmake-build-release && cpack -G RPM && cd .. # upload artifact - - uses: mad9000/actions-find-and-replace-string@3 + - uses: mad9000/actions-find-and-replace-string@5 id: container with: source: ${{ matrix.container }} @@ -391,7 +392,7 @@ jobs: replace: '-' # and replace it with - - name: Upload Qldd binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }} path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }} @@ -406,7 +407,7 @@ jobs: - name: Get commit sha id: git_sha run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # install dependencies - name: brew-pkgs run: brew install qt@5 @@ -414,7 +415,7 @@ jobs: - name: mkdir run: mkdir cmake-build-release - name: cmake cmake-build-release - run: cmake -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/qt5 -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H. + run: cmake -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/qt@5 -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H. - name: cmake make run: cmake --build cmake-build-release/ --target all env: @@ -424,7 +425,7 @@ jobs: run: echo "prj_ver=$(cat ./VERSION.txt)" >> $GITHUB_OUTPUT - name: cpack run: cd cmake-build-release && cpack -G DragNDrop && cd .. - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ format('Qldd-{0}-Darwin.dmg', steps.get-version.outputs.prj_ver) }} path: cmake-build-release/${{ format('Qldd-{0}-Darwin.dmg', steps.get-version.outputs.prj_ver) }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 068f61a..07bc3a5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,17 +56,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Threads REQUIRED) -set(QtVerPath qt5) +set(QtVerPath qt@5) if (FORCE_QT6) set(QtVer Qt6) - set(QtVerPath qt6) + set(QtVerPath qt@6) find_package(${QtVer} COMPONENTS Widgets REQUIRED) else() set(QtVer Qt5) find_package(${QtVer} COMPONENTS Widgets QUIET) if (NOT Qt5_FOUND) set(QtVer Qt6) - set(QtVerPath qt6) + set(QtVerPath qt@6) find_package(${QtVer} COMPONENTS Widgets REQUIRED) endif () endif() @@ -163,6 +163,10 @@ if(APPLE) OUTPUT_VARIABLE brew_path) string(STRIP ${brew_path} brew_path) + link_directories("${brew_path}/lib") + add_custom_command(TARGET Qldd + POST_BUILD + COMMAND ln -s "${brew_path}/lib" "lib") add_custom_command(TARGET Qldd POST_BUILD COMMAND "${brew_path}/opt/${QtVerPath}/bin/macdeployqt" Qldd.app) diff --git a/mainwindow.cpp b/mainwindow.cpp index 53b9610..8d92d3a 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -239,7 +239,7 @@ void MainWindow::initDemangleRules() { QJsonDocument doc = QJsonDocument::fromJson(val.toUtf8()); QJsonObject obj = doc.object(); QJsonArray arrRules = obj["rules"].toArray(); - for (const auto &item : qAsConst(arrRules)) { + for (const auto &item : arrRules) { auto itemObj = item.toObject(); auto itemKeys = itemObj.keys(); if (itemKeys.size() == 1) { diff --git a/qldd.cpp b/qldd.cpp index 79524d6..8006d00 100644 --- a/qldd.cpp +++ b/qldd.cpp @@ -92,7 +92,7 @@ void QLdd::fillDependency(QTreeWidget &treeWidget) { sl = line.split(DEPEND_SPLITTER); } int i = 0; - for (const QString &v : qAsConst(sl)) { + for (const QString &v : sl) { if (v.contains("(0x") || v.contains("(compatibility")) { QStringList slTmp = v.split("("); if (slTmp.size() > 1) { @@ -122,7 +122,7 @@ void QLdd::fillDependency(QTreeWidget &treeWidget) { sl.removeFirst(); QTreeWidgetItem *tmp = item; QColor redC("red"); - for (const QString &v : qAsConst(sl)) { + for (const QString &v : sl) { if (!v.trimmed().isEmpty()) { if (v.contains("not found")) { tmp->setForeground(0, QBrush(redC)); @@ -191,7 +191,7 @@ QString QLdd::getInfo() { execAndDoOnEveryLine(ss.str(), [&buf](const QString &line) { buf.append(line + "\n"); }); QStringList slTmp = buf.split(INFO_SPLITTER); buf.clear(); - for (const QString &v : qAsConst(slTmp)) { + for (const QString &v : slTmp) { buf.append(v.trimmed()).append("\n"); } return buf;