@ -84,6 +84,8 @@ MainWindow::MainWindow(QWidget *parent, DbManager* db, const QString& cfgPath,
}
}
MainWindow : : ~ MainWindow ( ) {
MainWindow : : ~ MainWindow ( ) {
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " MainWindow: ~MainWindow — saving channel state " ) ;
if ( m_messageList ) m_messageList - > saveChannelState ( ) ;
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " MainWindow: ~MainWindow — stopping utun node " ) ;
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " MainWindow: ~MainWindow — stopping utun node " ) ;
if ( m_node ) { m_node - > stop ( ) ; delete m_node ; m_node = nullptr ; }
if ( m_node ) { m_node - > stop ( ) ; delete m_node ; m_node = nullptr ; }
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " MainWindow: ~MainWindow done " ) ;
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " MainWindow: ~MainWindow done " ) ;
@ -120,6 +122,7 @@ void MainWindow::setupNode() {
connect ( m_node , & UtunNode : : stopped , this , [ ] ( ) {
connect ( m_node , & UtunNode : : stopped , this , [ ] ( ) {
qDebug ( " UtunNode stopped " ) ;
qDebug ( " UtunNode stopped " ) ;
} ) ;
} ) ;
connect ( m_node , & UtunNode : : stopped , qApp , & QApplication : : quit ) ;
if ( ! m_cfgDebugFile . isEmpty ( ) )
if ( ! m_cfgDebugFile . isEmpty ( ) )
m_node - > setDebugFile ( m_cfgDebugFile ) ;
m_node - > setDebugFile ( m_cfgDebugFile ) ;
@ -230,11 +233,6 @@ void MainWindow::setupConnects() {
m_channelList - > setChannelUnreadCount ( channelId ,
m_channelList - > setChannelUnreadCount ( channelId ,
m_db - > getUnreadCount ( channelId , lastReadMsgId ) ) ;
m_db - > getUnreadCount ( channelId , lastReadMsgId ) ) ;
} ) ;
} ) ;
connect ( qApp , & QApplication : : aboutToQuit , this , [ this ] ( ) {
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " MainWindow: aboutToQuit — saving channel state " ) ;
if ( m_messageList ) m_messageList - > saveChannelState ( ) ;
} ) ;
}
}
void MainWindow : : setupTray ( ) {
void MainWindow : : setupTray ( ) {