Skip to content

Commit 02a04ba

Browse files
committed
Build Ubuntu packages with the unix folder layout, search config in /usr/share/${PROJECT_NAME}
1 parent a528dd1 commit 02a04ba

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/cppcmake.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
matrix:
3131
config:
3232
- name: "ubuntu-22.04"
33-
os: "ubuntu-latest"
33+
os: "ubuntu-22.04"
3434
- name: "ubuntu-20.04"
3535
os: "ubuntu-20.04"
3636
- name: "ubuntu-18.04"
@@ -51,7 +51,7 @@ jobs:
5151
- name: "macOS-10"
5252
os: "macos-10.15"
5353
steps:
54-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
5555

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

7373
- name: Install Qt (Window and Ubuntu bionic)
7474
if: (matrix.config.os == 'windows-latest') || (matrix.config.os == 'ubuntu-18.04')
75-
uses: jurplel/install-qt-action@v2.14.0
75+
uses: jurplel/install-qt-action@v3.0.0
7676
with:
7777
version: ${{ matrix.config.qt_ver }}
7878
arch: ${{ matrix.config.qt_arch }}
@@ -99,6 +99,9 @@ jobs:
9999
-DLSL_INSTALL_ROOT=$PWD/LSL/ \
100100
-DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON \
101101
${{ matrix.config.cmake_extra }}
102+
if [[ "${{ matrix.config.name }}" = ubuntu-* ]]; then
103+
cmake -DLSL_UNIXFOLDERS=ON build
104+
fi
102105
103106
- name: make
104107
run: cmake --build build --config Release -j --target install
@@ -110,7 +113,7 @@ jobs:
110113
cmake -E remove_directory package/_CPack_Packages
111114
112115
- name: Upload Artifacts
113-
uses: actions/upload-artifact@v2
116+
uses: actions/upload-artifact@v3
114117
with:
115118
name: pkg-${{ matrix.config.name }}
116119
path: package

src/mainwindow.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,12 @@ QString MainWindow::find_config_file(const char *filename) {
585585
qInfo() << defaultCfgFilename;
586586
QStringList cfgpaths;
587587
cfgpaths << QDir::currentPath()
588-
<< QStandardPaths::standardLocations(QStandardPaths::ConfigLocation) << exeInfo.path();
588+
<< QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation)
589+
<< QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)
590+
<< exeInfo.path();
589591
for (const auto &path : qAsConst(cfgpaths)) {
590592
QString cfgfilepath = path + QDir::separator() + defaultCfgFilename;
593+
qInfo() << cfgfilepath;
591594
if (QFileInfo::exists(cfgfilepath)) return cfgfilepath;
592595
}
593596
QMessageBox::warning(this, "No config file not found",

0 commit comments

Comments
 (0)