Fix assert in unread count check during startup
commite180c4409043389c195bd4fa58307cc79d4c4e40
authorJan Kundrát <jkt@kde.org>
Wed, 3 Jan 2018 16:39:47 +0000 (3 17:39 +0100)
committerJan Kundrát <jkt@kde.org>
Wed, 3 Jan 2018 16:39:47 +0000 (3 17:39 +0100)
treec91703fe2fd24aed77499e3c1186a9f4d02ae089
parent6e96ab832d3ed5673de6c528260251d95f273aa9
Fix assert in unread count check during startup

The "simple" QaimDfsIterator constructor which only takes a QModelIndex
and not a pair of (QMI, QAIM) asserts when fed with an invalid iterator.
This can happen in case the mailbox list is not available for some
reason:

  ASSERT: "m_model" in file /home/jkt/work/prog/trojita/src/UiUtils/QaimDfsIterator.cpp, line 32
  [...]
  #5  0x000000000066dc15 in UiUtils::QaimDfsIterator::QaimDfsIterator(QModelIndex const&) ()
  #6  0x0000000000476483 in Gui::MainWindow::handleTrayIconChange() ()
  #7  0x0000000000475dda in Gui::MainWindow::createSysTray() ()
  #8  0x0000000000469077 in Gui::MainWindow::slotToggleSysTray() ()
  #9  0x0000000000458fb5 in Gui::MainWindow::MainWindow(QSettings*) ()
  #10 0x0000000000454bab in main ()

Change-Id: Ie9d71b06c86f9f06ea103fee94b414397e379f4b
src/Gui/Window.cpp