[pim/kdepim-addons] kmail/editorconvertertextplugins/markdown/tests: Warning--

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit a364ce2bf67696e6118e831125008d3dca9ffd83 by Laurent Montel.
Committed on 19/07/2026 at 10:57.
Pushed by mlaurent into branch 'master'.

Warning--

M  +5    -2    kmail/editorconvertertextplugins/markdown/tests/markdowndemowidget.cpp

https://invent.kde.org/pim/kdepim-addons/-/commit/a364ce2bf67696e6118e831125008d3dca9ffd83

diff --git a/kmail/editorconvertertextplugins/markdown/tests/markdowndemowidget.cpp b/kmail/editorconvertertextplugins/markdown/tests/markdowndemowidget.cpp
index 8088876c2..bd1189e81 100644
--- a/kmail/editorconvertertextplugins/markdown/tests/markdowndemowidget.cpp
+++ b/kmail/editorconvertertextplugins/markdown/tests/markdowndemowidget.cpp
@@ -30,8 +30,11 @@ MarkdownDemoWidget::MarkdownDemoWidget(QWidget *parent)
     });
 
     QFile defaultTextFile(u":/test.txt"_s);
-    defaultTextFile.open(QIODevice::ReadOnly);
-    mEdit->setPlainText(QString::fromUtf8(defaultTextFile.readAll()));
+    if (!defaultTextFile.open(QIODevice::ReadOnly)) {
+        qWarning() << "impossible to find test.txt file";
+    } else {
+        mEdit->setPlainText(QString::fromUtf8(defaultTextFile.readAll()));
+    }
 }
 
 #include "moc_markdowndemowidget.cpp"
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.