mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-10 19:52:24 +00:00
[Linux] Use Qt 6.4 for compatibility with Debian Stable (#116)
This commit is contained in:
@@ -4,9 +4,9 @@ project(linux VERSION 0.1 LANGUAGES CXX)
|
|||||||
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Quick Widgets Bluetooth DBus)
|
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick Widgets Bluetooth DBus)
|
||||||
|
|
||||||
qt_standard_project_setup(REQUIRES 6.5)
|
qt_standard_project_setup(REQUIRES 6.4)
|
||||||
|
|
||||||
qt_add_executable(applinux
|
qt_add_executable(applinux
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ A native Linux application to control your AirPods, with support for:
|
|||||||
2. Qt6 packages
|
2. Qt6 packages
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo pacman -S qt6-base qt6-connectivity qt6-multimedia-ffmpeg qt6-multimedia # Arch Linux / EndeavourOS
|
# For Arch Linux / EndeavourOS
|
||||||
|
sudo pacman -S qt6-base qt6-connectivity qt6-multimedia-ffmpeg qt6-multimedia
|
||||||
|
|
||||||
|
# For Debian
|
||||||
|
sudo apt-get install qt6-base-dev qt6-declarative-dev qt6-connectivity-dev qt6-multimedia-dev \
|
||||||
|
qml6-module-qtquick-controls qml6-module-qtqml-workerscript qml6-module-qtquick-templates \
|
||||||
|
qml6-module-qtquick-window qml6-module-qtquick-layouts
|
||||||
```
|
```
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ set(CMAKE_AUTOMOC ON)
|
|||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Core Bluetooth Widgets)
|
find_package(Qt6 6.4 REQUIRED COMPONENTS Core Bluetooth Widgets)
|
||||||
|
|
||||||
qt_add_executable(ble_monitor
|
qt_add_executable(ble_monitor
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ private slots:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parent->loadFromModule("linux", "Main");
|
loadMainModule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ private slots:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parent->loadFromModule("linux", "Main");
|
loadMainModule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -908,6 +908,10 @@ private slots:
|
|||||||
connectToPhone();
|
connectToPhone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void loadMainModule() {
|
||||||
|
parent->load(QUrl(QStringLiteral("qrc:/linux/Main.qml")));
|
||||||
|
}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void noiseControlModeChanged(NoiseControlMode mode);
|
void noiseControlModeChanged(NoiseControlMode mode);
|
||||||
void earDetectionStatusChanged(const QString &status);
|
void earDetectionStatusChanged(const QString &status);
|
||||||
@@ -995,7 +999,7 @@ int main(int argc, char *argv[]) {
|
|||||||
qmlRegisterType<Battery>("me.kavishdevar.Battery", 1, 0, "Battery");
|
qmlRegisterType<Battery>("me.kavishdevar.Battery", 1, 0, "Battery");
|
||||||
AirPodsTrayApp *trayApp = new AirPodsTrayApp(debugMode, hideOnStart, &engine);
|
AirPodsTrayApp *trayApp = new AirPodsTrayApp(debugMode, hideOnStart, &engine);
|
||||||
engine.rootContext()->setContextProperty("airPodsTrayApp", trayApp);
|
engine.rootContext()->setContextProperty("airPodsTrayApp", trayApp);
|
||||||
engine.loadFromModule("linux", "Main");
|
trayApp->loadMainModule();
|
||||||
|
|
||||||
QLocalServer server;
|
QLocalServer server;
|
||||||
QLocalServer::removeServer("app_server");
|
QLocalServer::removeServer("app_server");
|
||||||
@@ -1012,7 +1016,7 @@ int main(int argc, char *argv[]) {
|
|||||||
QObject::connect(&server, &QLocalServer::newConnection, [&]() {
|
QObject::connect(&server, &QLocalServer::newConnection, [&]() {
|
||||||
QLocalSocket* socket = server.nextPendingConnection();
|
QLocalSocket* socket = server.nextPendingConnection();
|
||||||
// Handles Proper Connection
|
// Handles Proper Connection
|
||||||
QObject::connect(socket, &QLocalSocket::readyRead, [socket, &engine]() {
|
QObject::connect(socket, &QLocalSocket::readyRead, [socket, &engine, &trayApp]() {
|
||||||
QString msg = socket->readAll();
|
QString msg = socket->readAll();
|
||||||
// Check if the message is "reopen", if so, trigger onOpenApp function
|
// Check if the message is "reopen", if so, trigger onOpenApp function
|
||||||
if (msg == "reopen") {
|
if (msg == "reopen") {
|
||||||
@@ -1023,7 +1027,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
engine.loadFromModule("linux", "Main");
|
trayApp->loadMainModule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user