Browse Source

Merge pull request #4958

e6beedc [Qt] add more NULL pointer checks in bitcoingui (Philip Kaufmann)
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
c4998661e4
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 14
      src/qt/bitcoingui.cpp

14
src/qt/bitcoingui.cpp

@ -662,6 +662,9 @@ void BitcoinGUI::setNumConnections(int count)
void BitcoinGUI::setNumBlocks(int count) void BitcoinGUI::setNumBlocks(int count)
{ {
if(!clientModel)
return;
// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text) // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
statusBar()->clearMessage(); statusBar()->clearMessage();
@ -832,7 +835,7 @@ void BitcoinGUI::changeEvent(QEvent *e)
#ifndef Q_OS_MAC // Ignored on Mac #ifndef Q_OS_MAC // Ignored on Mac
if(e->type() == QEvent::WindowStateChange) if(e->type() == QEvent::WindowStateChange)
{ {
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())
{ {
QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e); QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized()) if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
@ -847,16 +850,16 @@ void BitcoinGUI::changeEvent(QEvent *e)
void BitcoinGUI::closeEvent(QCloseEvent *event) void BitcoinGUI::closeEvent(QCloseEvent *event)
{ {
if(clientModel)
{
#ifndef Q_OS_MAC // Ignored on Mac #ifndef Q_OS_MAC // Ignored on Mac
if(clientModel && clientModel->getOptionsModel())
{
if(!clientModel->getOptionsModel()->getMinimizeToTray() && if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
!clientModel->getOptionsModel()->getMinimizeOnClose()) !clientModel->getOptionsModel()->getMinimizeOnClose())
{ {
QApplication::quit(); QApplication::quit();
} }
#endif
} }
#endif
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
} }
@ -917,8 +920,7 @@ bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
gotoSendCoinsPage(); gotoSendCoinsPage();
return true; return true;
} }
else return false;
return false;
} }
void BitcoinGUI::setEncryptionStatus(int status) void BitcoinGUI::setEncryptionStatus(int status)

Loading…
Cancel
Save