Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/mainwindow.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp index 2e674c5..2562f33 100644 --- a/noncore/net/opieirc/mainwindow.cpp +++ b/noncore/net/opieirc/mainwindow.cpp | |||
@@ -50,2 +50,3 @@ void MainWindow::loadSettings() { | |||
50 | IRCTab::m_maxLines = config.readNumEntry("Lines", 100); | 50 | IRCTab::m_maxLines = config.readNumEntry("Lines", 100); |
51 | IRCTab::setUseTimeStamps( config.readBoolEntry("DisplayTime", false ) ); | ||
51 | } | 52 | } |
@@ -62,3 +63,2 @@ void MainWindow::addTab(IRCTab *tab) { | |||
62 | connect(tab, SIGNAL(prevTab()), this, SLOT(slotPrevTab())); | 63 | connect(tab, SIGNAL(prevTab()), this, SLOT(slotPrevTab())); |
63 | connect(tab, SIGNAL(closeTab()), this, SLOT(slotCloseTab())); | ||
64 | 64 | ||
@@ -75,8 +75,20 @@ void MainWindow::changeEvent(IRCTab *tab) { | |||
75 | 75 | ||
76 | void MainWindow::killTab(IRCTab *tab) { | 76 | void MainWindow::killTab(IRCTab *tab, bool imediate) { |
77 | m_tabWidget->removePage(tab); | 77 | m_toDelete.append( tab ); |
78 | m_tabs.remove(tab); | ||
79 | 78 | ||
80 | /* there might be nicer ways to do this .. */ | 79 | if ( imediate ) |
81 | delete tab; | 80 | slotKillTabsLater(); |
81 | else | ||
82 | QTimer::singleShot(0, this, SLOT(slotKillTabsLater()) ); | ||
83 | } | ||
84 | |||
85 | void MainWindow::slotKillTabsLater() { | ||
86 | for ( QListIterator<IRCTab> it(m_toDelete); it.current(); ++it ) { | ||
87 | m_tabWidget->removePage( it.current() ); | ||
88 | m_tabs.remove( it.current() ); | ||
89 | } | ||
90 | |||
91 | m_toDelete.setAutoDelete( true ); | ||
92 | m_toDelete.clear(); | ||
93 | m_toDelete.setAutoDelete( false ); | ||
82 | } | 94 | } |
@@ -119,9 +131,3 @@ void MainWindow::slotPrevTab() { | |||
119 | 131 | ||
120 | void MainWindow::slotCloseTab() { | 132 | void MainWindow::slotPing( const QString& /*channel*/ ) { |
121 | IRCTab *tab = (IRCTab *) m_tabWidget->currentPage (); | ||
122 | if ( tab ) | ||
123 | killTab ( tab ); | ||
124 | } | ||
125 | |||
126 | void MainWindow::slotPing( const QString& channel ) { | ||
127 | raise(); | 133 | raise(); |