|
Lines 1-29
Link Here
|
| 1 |
Starting with Qt 6.10, QFile::open() is automatically marked with |
|
|
| 2 |
[[nodiscard]] [1]; check return value before proceeding. |
| 3 |
|
| 4 |
[1] https://code.qt.io/cgit/qt/qtbase.git/commit/?h=6.10&id=7466831509fe163f3fd1e3a6bbf38f6f5a32ef00 |
| 5 |
|
| 6 |
--- Source/dooble_settings.cc.orig 2025-07-19 00:27:24 UTC |
| 7 |
+++ Source/dooble_settings.cc |
| 8 |
@@ -2095,8 +2095,8 @@ void dooble_settings::restore(bool read_database) |
| 9 |
file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner); |
| 10 |
else |
| 11 |
{ |
| 12 |
- file.open(QIODevice::Truncate | QIODevice::WriteOnly); |
| 13 |
- file.setPermissions(QFileDevice::ReadOwner); |
| 14 |
+ if(file.open(QIODevice::Truncate | QIODevice::WriteOnly)) |
| 15 |
+ file.setPermissions(QFileDevice::ReadOwner); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
@@ -2914,8 +2914,8 @@ void dooble_settings::slot_apply(void) |
| 20 |
file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner); |
| 21 |
else |
| 22 |
{ |
| 23 |
- file.open(QIODevice::Truncate | QIODevice::WriteOnly); |
| 24 |
- file.setPermissions(QFileDevice::ReadOwner); |
| 25 |
+ if(file.open(QIODevice::Truncate | QIODevice::WriteOnly)) |
| 26 |
+ file.setPermissions(QFileDevice::ReadOwner); |
| 27 |
} |
| 28 |
} |
| 29 |
|