331 | @@ -332,8 +332,12 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
332 | setNumConnections(clientModel->getNumConnections());
333 | connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
334 |
335 | - setNumBlocks(clientModel->getNumBlocks());
336 | - connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
337 | + // don't display the sync. message, if we are not connected to the network
338 | + if (clientModel->getNumConnections() > 0)
Do not make this check in the setModel function but in setNumBlocks.
Background: in Qt, a model is assigned to a widget at most once (there are exceptions, for example when reading a new file and everything should be reset), so it must not make judgements based on temporary state.
Also this does not handle the case where number of connections goes back to 0.
Good point, will change that behaviour.