Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ exclude: |
misc/image/|
po/|
tools/quicktype/|
tools/openapi-c-libcurl-client/
tools/openapi-c-libcurl-client/|
.obs/|
misc/share/linglong/builder/templates/|
apps/ll-builder-utils/patch/
)

ci:
Expand Down
1 change: 0 additions & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ file_filter = po/<lang>.po
source_file = po/en_US.po
source_lang = en_US
type = PO

2 changes: 1 addition & 1 deletion apps/ll-driver-detect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ make ll-driver-detect

## 许可证

本项目遵循 LGPL-3.0-or-later 许可证。
本项目遵循 LGPL-3.0-or-later 许可证。
1 change: 1 addition & 0 deletions apps/ll-driver-detect/src/application_singleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

#include "application_singleton.h"

#include "linglong/utils/log/log.h"

Check warning on line 7 in apps/ll-driver-detect/src/application_singleton.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "linglong/utils/log/log.h" not found.

#include <filesystem>

Check warning on line 9 in apps/ll-driver-detect/src/application_singleton.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <filesystem> not found. Please note: Cppcheck does not need standard library headers to get proper results.

namespace linglong::driver::detect {

ApplicationSingleton::ApplicationSingleton(const std::string &lockFilePath)
Expand Down
43 changes: 23 additions & 20 deletions apps/ll-driver-detect/src/dbus_notifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ DBusNotifier::sendInteractiveNotification(const NotificationRequest &request)
bool userInteracted = false;
QEventLoop loop;

struct SignalGuard {
struct SignalGuard
{
QMetaObject::Connection closeConn;
QMetaObject::Connection actionConn;

Expand All @@ -67,27 +68,29 @@ DBusNotifier::sendInteractiveNotification(const NotificationRequest &request)
QObject::disconnect(closeConn);
QObject::disconnect(actionConn);
}
} signalGuard{{}, {}};
} signalGuard{ {}, {} };

// 连接信号处理函数
signalGuard.closeConn = QObject::connect(this,
&DBusNotifier::notificationClosed,
[&](quint32 id, quint32 closeReason) {
if (notificationID != 0 && id == notificationID) {
LogD("Notification {} closed with reason: {}", id, closeReason);
loop.quit();
}
});

signalGuard.actionConn = QObject::connect(this,
&DBusNotifier::actionInvoked,
[&](quint32 id, const QString &actionKey) {
if (notificationID != 0 && id == notificationID) {
LogD("Notification {} action invoked: {}", id, actionKey.toStdString());
choice = actionKey;
userInteracted = true;
}
});
signalGuard.closeConn =
QObject::connect(this,
&DBusNotifier::notificationClosed,
[&](quint32 id, quint32 closeReason) {
if (notificationID != 0 && id == notificationID) {
LogD("Notification {} closed with reason: {}", id, closeReason);
loop.quit();
}
});

signalGuard.actionConn = QObject::connect(
this,
&DBusNotifier::actionInvoked,
[&](quint32 id, const QString &actionKey) {
if (notificationID != 0 && id == notificationID) {
LogD("Notification {} action invoked: {}", id, actionKey.toStdString());
choice = actionKey;
userInteracted = true;
}
});

// 检查信号连接是否成功
if (!signalGuard.closeConn || !signalGuard.actionConn) {
Expand Down
8 changes: 3 additions & 5 deletions apps/ll-driver-detect/src/driver_detection_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
{
std::vector<GraphicsDriverInfo> detectedDrivers;

bool hasAvailableDrivers() const

Check warning on line 19 in apps/ll-driver-detect/src/driver_detection_manager.h

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'hasAvailableDrivers' is never used.
{
return std::any_of(detectedDrivers.begin(),
detectedDrivers.end(),
[](const auto &driver) {
return !driver.isInstalled;
});
return std::any_of(detectedDrivers.begin(), detectedDrivers.end(), [](const auto &driver) {
return !driver.isInstalled;
});
}
};

Expand Down
5 changes: 3 additions & 2 deletions apps/ll-driver-detect/src/nvidia_driver_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ NVIDIADriverDetector::checkPackageInstalled(const std::string &packageName)
linglong::utils::command::Cmd("ll-cli").exec({ "info", packageName.c_str() });

if (!listResult) {
LogD("Can not get package info with `ll-cli info`, maybe the package is not installed: {}",
listResult.error().message());
LogD(
"Can not get package info with `ll-cli info`, maybe the package is not installed: {}",
listResult.error().message());
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion libs/linglong/tests/ll-tests/data/demo/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ permissions:

namespaces:
- type: pid
- type: uts
- type: uts
Loading