[graphics/okular] /: Deprecate the error-less saveChanges in document

Sune Vuorela <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 0752d76db88a1677dbeb79d153e77b4416b0b830 by Sune Vuorela.
Committed on 17/08/2026 at 10:45.
Pushed by sune into branch 'master'.

Deprecate the error-less saveChanges in document

M  +3    -1    autotests/documenttest.cpp
M  +3    -1    autotests/visibilitytest.cpp
M  +1    -1    core/document.h

https://invent.kde.org/graphics/okular/-/commit/0752d76db88a1677dbeb79d153e77b4416b0b830

diff --git a/autotests/documenttest.cpp b/autotests/documenttest.cpp
index 8e187c787..bc17f34c0 100644
--- a/autotests/documenttest.cpp
+++ b/autotests/documenttest.cpp
@@ -108,7 +108,9 @@ void DocumentTest::testDocdataMigration()
     QTemporaryFile migratedSaveFile(QStringLiteral("%1/okrXXXXXX.pdf").arg(QDir::tempPath()));
     QVERIFY(migratedSaveFile.open());
     migratedSaveFile.close();
-    QVERIFY(m_document->saveChanges(migratedSaveFile.fileName()));
+    QString errorString;
+    QVERIFY(m_document->saveChanges(migratedSaveFile.fileName(), &errorString));
+    QVERIFY(errorString.isEmpty());
     m_document->docdataMigrationDone();
     QVERIFY(!m_document->isDocdataMigrationNeeded());
     m_document->closeDocument();
diff --git a/autotests/visibilitytest.cpp b/autotests/visibilitytest.cpp
index 15b741e9f..0404b5f0c 100644
--- a/autotests/visibilitytest.cpp
+++ b/autotests/visibilitytest.cpp
@@ -116,7 +116,9 @@ void VisibilityTest::testSaveLoad()
     QVERIFY(saveFile.open());
     saveFile.close();
 
-    QVERIFY(m_document->saveChanges(saveFile.fileName()));
+    QString errorString;
+    QVERIFY(m_document->saveChanges(saveFile.fileName(), &errorString));
+    QVERIFY(errorString.isEmpty());
 
     auto newDoc = new Okular::Document(nullptr);
 
diff --git a/core/document.h b/core/document.h
index 0b458424f..3cd98dd33 100644
--- a/core/document.h
+++ b/core/document.h
@@ -991,7 +991,7 @@ public:
      *
      * @since 0.7 (KDE 4.1)
      */
-    bool saveChanges(const QString &fileName);
+    OKULARCORE_DEPRECATED bool saveChanges(const QString &fileName);
 
     /**
      * Save the document and the optional changes to it to the specified
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.