Skip to content

Commit

Permalink
Build Ubuntu packages with the unix folder layout, search config in `…
Browse files Browse the repository at this point in the history
…/usr/share/${PROJECT_NAME}`
  • Loading branch information
tstenner committed Dec 30, 2022
1 parent a528dd1 commit 02a04ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/cppcmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
matrix:
config:
- name: "ubuntu-22.04"
os: "ubuntu-latest"
os: "ubuntu-22.04"
- name: "ubuntu-20.04"
os: "ubuntu-20.04"
- name: "ubuntu-18.04"
Expand All @@ -51,7 +51,7 @@ jobs:
- name: "macOS-10"
os: "macos-10.15"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install liblsl (Ubuntu)
if: startsWith(matrix.config.os, 'ubuntu-')
Expand All @@ -72,7 +72,7 @@ jobs:

- name: Install Qt (Window and Ubuntu bionic)
if: (matrix.config.os == 'windows-latest') || (matrix.config.os == 'ubuntu-18.04')
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3.0.0
with:
version: ${{ matrix.config.qt_ver }}
arch: ${{ matrix.config.qt_arch }}
Expand All @@ -99,6 +99,9 @@ jobs:
-DLSL_INSTALL_ROOT=$PWD/LSL/ \
-DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON \
${{ matrix.config.cmake_extra }}
if [[ "${{ matrix.config.name }}" = ubuntu-* ]]; then
cmake -DLSL_UNIXFOLDERS=ON build
fi
- name: make
run: cmake --build build --config Release -j --target install
Expand All @@ -110,7 +113,7 @@ jobs:
cmake -E remove_directory package/_CPack_Packages
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pkg-${{ matrix.config.name }}
path: package
Expand Down
5 changes: 4 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,12 @@ QString MainWindow::find_config_file(const char *filename) {
qInfo() << defaultCfgFilename;
QStringList cfgpaths;
cfgpaths << QDir::currentPath()
<< QStandardPaths::standardLocations(QStandardPaths::ConfigLocation) << exeInfo.path();
<< QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation)
<< QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)
<< exeInfo.path();
for (const auto &path : qAsConst(cfgpaths)) {
QString cfgfilepath = path + QDir::separator() + defaultCfgFilename;
qInfo() << cfgfilepath;
if (QFileInfo::exists(cfgfilepath)) return cfgfilepath;
}
QMessageBox::warning(this, "No config file not found",
Expand Down

0 comments on commit 02a04ba

Please sign in to comment.