@@ -266,8 +266,10 @@ namespace Robomongo
266266 void WelcomeTab::on_downloadTextReply (QNetworkReply* reply)
267267 {
268268 auto hideOrShowWhatsNewHeader = [this ]() {
269- _whatsNewHeader->setHidden ( (!_pic1->pixmap () || _pic1->pixmap ()->isNull ())
270- && _whatsNewText->text ().isEmpty () ? true : false );
269+ if ((!_pic1->pixmap () || _pic1->pixmap ()->isNull ()) && _whatsNewText->text ().isEmpty ())
270+ _whatsNewHeader->setHidden (true );
271+ else
272+ _whatsNewHeader->setVisible (true );
271273 };
272274
273275 if (reply->operation () == QNetworkAccessManager::HeadOperation) {
@@ -315,6 +317,7 @@ namespace Robomongo
315317 }
316318
317319 setWhatsNewHeaderAndText (str);
320+ hideOrShowWhatsNewHeader ();
318321 saveIntoCache (Text1_URL.fileName (), str, Text1_LastModifiedDateKey,
319322 reply->header (QNetworkRequest::LastModifiedHeader).toString ());
320323 }
@@ -326,8 +329,10 @@ namespace Robomongo
326329
327330 QPixmap image;
328331 auto hideOrShowWhatsNewHeader = [this ]() {
329- _whatsNewHeader->setHidden ( (!_pic1->pixmap () || _pic1->pixmap ()->isNull ())
330- && _whatsNewText->text ().isEmpty () ? true : false );
332+ if ((!_pic1->pixmap () || _pic1->pixmap ()->isNull ()) && _whatsNewText->text ().isEmpty ())
333+ _whatsNewHeader->setHidden (true );
334+ else
335+ _whatsNewHeader->setVisible (true );
331336 };
332337
333338 // Network error, load from cache
@@ -359,7 +364,6 @@ namespace Robomongo
359364 }
360365 else { // Get from internet
361366 reply->manager ()->get (QNetworkRequest (Pic1_URL));
362- hideOrShowWhatsNewHeader ();
363367 return ;
364368 }
365369 }
0 commit comments