Skip to content

Commit 4fb642b

Browse files
committed
fix: Update system reboot handling and refactor service constants
- Changed the reboot command in ImageWriter to suppress unused return value. - Refactored service and path constants in GnomeSuspendInhibitor to use const char* for better compatibility. - Initialized QDBusConnection in GnomeSuspendInhibitor directly during declaration.
1 parent eac7c2f commit 4fb642b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/imagewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ void MountUtilsLog(std::string msg) {
25332533
void ImageWriter::reboot()
25342534
{
25352535
qDebug() << "Rebooting system.";
2536-
system("reboot");
2536+
(void)system("reboot");
25372537
}
25382538

25392539
void ImageWriter::openUrl(const QUrl &url)

src/linux/linux_suspend_inhibitor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include <QtDBus/QtDBus>
1313

1414
namespace {
15-
constexpr QString service = "org.gnome.SessionManager";
16-
constexpr QString path = "/org/gnome/SessionManager";
15+
constexpr const char* service = "org.gnome.SessionManager";
16+
constexpr const char* path = "/org/gnome/SessionManager";
1717
}
1818

1919
GnomeSuspendInhibitor::GnomeSuspendInhibitor()

src/linux/linux_suspend_inhibitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class GnomeSuspendInhibitor
99
{
10-
QDBusConnection _bus;
10+
QDBusConnection _bus = QDBusConnection::sessionBus();
1111
bool _serviceFound;
1212
int _cookie;
1313
public:

0 commit comments

Comments
 (0)