diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-04-19 14:49:24 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-05-02 12:40:34 +0200 |
commit | d8026c6defb5764eb1ee2649cd530b8f0e708675 (patch) | |
tree | d376d4bfd367536e23a04c4c0112ce74ffa4a1ca | |
parent | a0555f129c4a0042a7138a48e44b610de8e4dcd1 (diff) | |
download | qttools-d8026c6defb5764eb1ee2649cd530b8f0e708675.tar.gz |
Revert "Check the return value from QTranslator::load()"
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 <kai.koehne@qt.io>
-rw-r--r-- | examples/linguist/hellotr/main.cpp | 3 |
1 files changed, 1 insertions, 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] |