Reader: don't forget comic info visibility

The timer used to time out and invoke Viewer::informationSwitch() twice
before getting destroyed. This caused the following bug:
    1. Press 'I' to Show Info in YACReader.
    2. Restart YACReader (exit and run again). Info is visible.
    3. Restart YACReader one more time. Info is hidden.

Apparently, when informationSwitch() was called a second time soon after
the first one, informationLabel didn't hide for some reason, but the
wrong value (false) was stored at the SHOW_INFO key in Configuration.
This commit is contained in:
Igor Kushnir
2019-11-19 12:36:55 +02:00
committed by Luis Ángel San Martín
parent 1ce873dd63
commit b0082101d3

View File

@ -205,12 +205,8 @@ void Viewer::prepareForOpening()
verticalScrollBar()->setSliderPosition(verticalScrollBar()->minimum());
if (Configuration::getConfiguration().getShowInformation() && !information) {
auto timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(informationSwitch()));
connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
timer->start();
}
if (Configuration::getConfiguration().getShowInformation() && !information)
QTimer::singleShot(0, this, &Viewer::informationSwitch);
informationLabel->setText("...");
}