From 8f4107906961d667c0dcd665f8ec5131f218c5bd Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Fri, 12 Aug 2022 13:51:38 +0300 Subject: [PATCH] Make saving complete article work in Qt 5.15 The old code works correctly in Qt 4.8.7. But in Qt 5.15.5 selectedFilter is never equal to either element of filters. So HTML Only is saved no matter which option the user selects. --- mainwindow.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mainwindow.cc b/mainwindow.cc index 67dfe308..22487a69 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -3585,7 +3585,8 @@ void MainWindow::on_saveArticle_triggered() filters.join( ";;" ), &selectedFilter, options ); - bool complete = ( selectedFilter == filters[ 0 ] ); + // The " (*.html)" part of filters[i] is absent from selectedFilter in Qt 5. + bool const complete = filters.at( 0 ).startsWith( selectedFilter ); if ( !fileName.isEmpty() ) {