Skip to content

Commit 6fab07d

Browse files
authored
Merge pull request #12 from Acik-Kaynak-Gelistirme-Toplulugu/feature/cmake-setup
build(qml): set Qt policies and add qmldir metadata
2 parents 1951b6e + 7e365e5 commit 6fab07d

6 files changed

Lines changed: 41 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
- name: Install RPM tooling and dependencies
6767
run: |
6868
dnf install -y \
69+
git \
6970
rpm-build \
7071
rpmlint \
7172
cmake \
@@ -79,8 +80,18 @@ jobs:
7980
8081
- name: Prepare source tarball
8182
run: |
83+
VERSION="$(awk '/^Version:/ {print $2}' packaging/rpm/ro-control.spec)"
84+
if [[ -z "${VERSION}" ]]; then
85+
echo "Failed to read Version from packaging/rpm/ro-control.spec" >&2
86+
exit 1
87+
fi
88+
ARCHIVE_BASENAME="ro-control-${VERSION}"
8289
mkdir -p ~/rpmbuild/SOURCES
83-
git archive --format=tar.gz --output=~/rpmbuild/SOURCES/ro-control-0.1.0.tar.gz HEAD
90+
STAGE_DIR="$(mktemp -d)"
91+
cp -a . "${STAGE_DIR}/${ARCHIVE_BASENAME}"
92+
rm -rf "${STAGE_DIR}/${ARCHIVE_BASENAME}/.git" "${STAGE_DIR}/${ARCHIVE_BASENAME}/build"
93+
tar -C "${STAGE_DIR}" -czf "${HOME}/rpmbuild/SOURCES/${ARCHIVE_BASENAME}.tar.gz" "${ARCHIVE_BASENAME}"
94+
rm -rf "${STAGE_DIR}"
8495
8596
- name: Build RPM
8697
run: |

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ find_package(Qt6 QUIET COMPONENTS LinguistTools)
3535

3636
qt_standard_project_setup()
3737

38+
if(COMMAND qt_policy)
39+
qt_policy(SET QTP0001 NEW)
40+
qt_policy(SET QTP0004 NEW)
41+
endif()
42+
3843
# ─── Source Files ─────────────────────────────────────────────────────────────
3944
set(BACKEND_SOURCES
4045
src/backend/nvidia/detector.cpp
@@ -114,8 +119,8 @@ install(FILES data/icons/ro-control.desktop
114119
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
115120
)
116121

117-
install(DIRECTORY data/icons/
118-
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons
122+
install(DIRECTORY data/icons/hicolor/
123+
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
119124
)
120125

121126
install(FILES data/icons/ro-control.metainfo.xml

data/polkit/com.github.AcikKaynakGelistirmeToplulugu.rocontrol.policy

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@
2121
</defaults>
2222
</action>
2323

24+
<action id="com.github.AcikKaynakGelistirmeToplulugu.rocontrol.pkexec">
25+
<description>Execute privileged ro-Control operations</description>
26+
<description xml:lang="tr">Ayricalikli ro-Control islemlerini calistir</description>
27+
<message>Authentication is required to perform privileged system operations</message>
28+
<message xml:lang="tr">Ayricalikli sistem islemleri icin kimlik dogrulama gerekli</message>
29+
<icon_name>ro-control</icon_name>
30+
<defaults>
31+
<allow_any>auth_admin</allow_any>
32+
<allow_inactive>auth_admin</allow_inactive>
33+
<allow_active>auth_admin_keep</allow_active>
34+
</defaults>
35+
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
36+
</action>
37+
2438
</policyconfig>

src/qml/components/qmldir

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SidebarMenu 1.0 SidebarMenu.qml
2+
StatCard 1.0 StatCard.qml

src/qml/pages/SettingsPage.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import QtQuick
2-
import QtQuick.Controls
3-
import QtQuick.Layouts
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Layouts 1.15
44

55
Item {
66
id: settingsPage

src/qml/pages/qmldir

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DriverPage 1.0 DriverPage.qml
2+
MonitorPage 1.0 MonitorPage.qml
3+
SettingsPage 1.0 SettingsPage.qml

0 commit comments

Comments
 (0)