From d8026c6defb5764eb1ee2649cd530b8f0e708675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 19 Apr 2023 14:49:24 +0200 Subject: Revert "Check the return value from QTranslator::load()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a91ac627e84634993fc579d428e4bbc3d0b283a. The example documentation does not match the flow introduced by this change. The example explicitly talks about "No error will occur if the file is not found.", and "If hellotr_la.qm was found and contains a translation for "Hello world!", the translation appears; if not, the source text appears." Q_UNUSED added to satisfy nodiscard attribute. Pick-to: 6.5 Change-Id: I8e4cb6ed3fb81f7739aacd734f3107a8ec6899a1 Reviewed-by: Kai Köhne --- examples/linguist/hellotr/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/linguist/hellotr/main.cpp b/examples/linguist/hellotr/main.cpp index c6db1f37a..e655029fb 100644 --- a/examples/linguist/hellotr/main.cpp +++ b/examples/linguist/hellotr/main.cpp @@ -17,8 +17,7 @@ int main(int argc, char *argv[]) //! [5] QTranslator translator; //! [5] //! [6] - if (!translator.load("hellotr_la")) - return 1; + Q_UNUSED(translator.load("hellotr_la")); //! [6] //! [7] app.installTranslator(&translator); //! [4] //! [7] -- cgit v1.2.1