[graphics/koko] src: filemenumanager: [[nodiscard]] hinting

Oliver Beard <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 288a2e09f2c0718264a0cd64c819e88310325e28 by Oliver Beard.
Committed on 30/07/2026 at 22:13.
Pushed by olib into branch 'master'.

filemenumanager: [[nodiscard]] hinting

Calling these without using the value is incorrect.

M  +15   -15   src/filemenumanager.h

https://invent.kde.org/graphics/koko/-/commit/288a2e09f2c0718264a0cd64c819e88310325e28

diff --git a/src/filemenumanager.h b/src/filemenumanager.h
index 8674e778..df1252c9 100644
--- a/src/filemenumanager.h
+++ b/src/filemenumanager.h
@@ -42,27 +42,27 @@ class FileMenuManager : public QObject
 public:
     explicit FileMenuManager(QObject *parent = nullptr);
 
-    QList<QUrl> urls() const;
+    [[nodiscard]] QList<QUrl> urls() const;
     void setUrls(const QList<QUrl> &urls);
 
-    QUrl rootUrl() const;
+    [[nodiscard]] QUrl rootUrl() const;
     void setRootUrl(const QUrl &url);
 
-    bool enabled() const;
+    [[nodiscard]] bool enabled() const;
     void setEnabled(const bool enabled);
 
-    bool canSaveAs() const;
-    bool canOpenFolder() const;
-    bool canOpenWith() const;
-    bool canCut() const;
-    bool canCopy() const;
-    bool canCopyPath() const;
-    bool canPaste() const;
-    bool canRenameFile() const;
-    bool canMoveToTrash() const;
-    bool canDeleteFile() const;
-    bool canPrint() const;
-    bool canProperties() const;
+    [[nodiscard]] bool canSaveAs() const;
+    [[nodiscard]] bool canOpenFolder() const;
+    [[nodiscard]] bool canOpenWith() const;
+    [[nodiscard]] bool canCut() const;
+    [[nodiscard]] bool canCopy() const;
+    [[nodiscard]] bool canCopyPath() const;
+    [[nodiscard]] bool canPaste() const;
+    [[nodiscard]] bool canRenameFile() const;
+    [[nodiscard]] bool canMoveToTrash() const;
+    [[nodiscard]] bool canDeleteFile() const;
+    [[nodiscard]] bool canPrint() const;
+    [[nodiscard]] bool canProperties() const;
 
 Q_SIGNALS:
     void urlsChanged();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.