From c93c6b02761b9c1c9f286f6d6a8a1bbd93150167 Mon Sep 17 00:00:00 2001 From: Gokhan Simsek Date: Wed, 14 Jun 2017 11:42:51 +0300 Subject: [PATCH] WelcomTab: Fixing a problem where main header text gets hidden at first launch --- CMakeLists.txt | 2 +- src/robomongo/gui/widgets/workarea/WelcomeTab.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6b92d62a..adbd9d06d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") # Project version set(PROJECT_VERSION_MAJOR "1") set(PROJECT_VERSION_MINOR "1") -set(PROJECT_VERSION_PATCH "0") +set(PROJECT_VERSION_PATCH "1") set(PROJECT_VERSION_BUILD "") set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}") diff --git a/src/robomongo/gui/widgets/workarea/WelcomeTab.cpp b/src/robomongo/gui/widgets/workarea/WelcomeTab.cpp index db14f9371..26d4f7478 100644 --- a/src/robomongo/gui/widgets/workarea/WelcomeTab.cpp +++ b/src/robomongo/gui/widgets/workarea/WelcomeTab.cpp @@ -266,8 +266,10 @@ namespace Robomongo void WelcomeTab::on_downloadTextReply(QNetworkReply* reply) { auto hideOrShowWhatsNewHeader = [this]() { - _whatsNewHeader->setHidden( (!_pic1->pixmap() || _pic1->pixmap()->isNull()) - && _whatsNewText->text().isEmpty() ? true : false); + if ((!_pic1->pixmap() || _pic1->pixmap()->isNull()) && _whatsNewText->text().isEmpty()) + _whatsNewHeader->setHidden(true); + else + _whatsNewHeader->setVisible(true); }; if (reply->operation() == QNetworkAccessManager::HeadOperation) { @@ -315,6 +317,7 @@ namespace Robomongo } setWhatsNewHeaderAndText(str); + hideOrShowWhatsNewHeader(); saveIntoCache(Text1_URL.fileName(), str, Text1_LastModifiedDateKey, reply->header(QNetworkRequest::LastModifiedHeader).toString()); } @@ -326,8 +329,10 @@ namespace Robomongo QPixmap image; auto hideOrShowWhatsNewHeader = [this]() { - _whatsNewHeader->setHidden( (!_pic1->pixmap() || _pic1->pixmap()->isNull()) - && _whatsNewText->text().isEmpty() ? true : false); + if ((!_pic1->pixmap() || _pic1->pixmap()->isNull()) && _whatsNewText->text().isEmpty()) + _whatsNewHeader->setHidden(true); + else + _whatsNewHeader->setVisible(true); }; // Network error, load from cache @@ -359,7 +364,6 @@ namespace Robomongo } else { // Get from internet reply->manager()->get(QNetworkRequest(Pic1_URL)); - hideOrShowWhatsNewHeader(); return; } }