commit 3e07364877612c260a918505fc2e7db0b643caa6
Author: Juergen Spitzmueller <[email protected]>
Date:   Wed Oct 15 13:03:00 2025 +0200

    Address warning with Qt 6.10
    
    warning: ignoring return value of ‘virtual bool 
QFile::open(QIODeviceBase::OpenMode)’, declared with attribute ‘nodiscard’ 
[-Wunused-result]
       57 |                 file.open(QIODevice::ReadOnly);
          |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/qt6/QtCore/QFile:1,
                     from GuiAbout.cpp:28:
    /usr/include/qt6/QtCore/qfile.h:291:32: note: declared here
      291 |     QFILE_MAYBE_NODISCARD bool open(OpenMode flags) override;
---
 src/frontends/qt/GuiAbout.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp
index b14a6ad991..4d8f14ae06 100644
--- a/src/frontends/qt/GuiAbout.cpp
+++ b/src/frontends/qt/GuiAbout.cpp
@@ -53,8 +53,7 @@ static QString credits()
        if (!file.exists()) {
                out << qt_("ERROR: LyX wasn't able to find the CREDITS file\n");
                out << qt_("Please install correctly to estimate the 
great\namount of work other people have done for the LyX project.");
-       } else {
-               file.open(QIODevice::ReadOnly);
+       } else if (file.open(QIODevice::ReadOnly)) {
                if (!file.isReadable()) {
                        out << qt_("ERROR: LyX wasn't able to read the CREDITS 
file\n");
                        out << qt_("Please install correctly to estimate the 
great\namount of work other people have done for the LyX project.");
@@ -97,8 +96,7 @@ static QString release_notes()
        if (!file.exists()) {
                out << qt_("ERROR: LyX wasn't able to find the RELEASE-NOTES 
file\n");
                out << qt_("Please install correctly to see what has 
changed\nfor this version of LyX.");
-       } else {
-               file.open(QIODevice::ReadOnly);
+       } else if (file.open(QIODevice::ReadOnly)) {
                if (!file.isReadable()) {
                        out << qt_("ERROR: LyX wasn't able to read the 
RELEASE-NOTES file\n");
                        out << qt_("Please install correctly to see what has 
changed\nfor this version of LyX.");
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to