summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/mainwindow.cpp32
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() {
IRCTab::m_maxLines = config.readNumEntry("Lines", 100);
+ IRCTab::setUseTimeStamps( config.readBoolEntry("DisplayTime", false ) );
}
@@ -62,3 +63,2 @@ void MainWindow::addTab(IRCTab *tab) {
connect(tab, SIGNAL(prevTab()), this, SLOT(slotPrevTab()));
- connect(tab, SIGNAL(closeTab()), this, SLOT(slotCloseTab()));
@@ -75,8 +75,20 @@ void MainWindow::changeEvent(IRCTab *tab) {
-void MainWindow::killTab(IRCTab *tab) {
- m_tabWidget->removePage(tab);
- m_tabs.remove(tab);
+void MainWindow::killTab(IRCTab *tab, bool imediate) {
+ m_toDelete.append( tab );
- /* there might be nicer ways to do this .. */
- delete tab;
+ if ( imediate )
+ slotKillTabsLater();
+ else
+ QTimer::singleShot(0, this, SLOT(slotKillTabsLater()) );
+}
+
+void MainWindow::slotKillTabsLater() {
+ for ( QListIterator<IRCTab> it(m_toDelete); it.current(); ++it ) {
+ m_tabWidget->removePage( it.current() );
+ m_tabs.remove( it.current() );
+ }
+
+ m_toDelete.setAutoDelete( true );
+ m_toDelete.clear();
+ m_toDelete.setAutoDelete( false );
}
@@ -119,9 +131,3 @@ void MainWindow::slotPrevTab() {
-void MainWindow::slotCloseTab() {
- IRCTab *tab = (IRCTab *) m_tabWidget->currentPage ();
- if ( tab )
- killTab ( tab );
-}
-
-void MainWindow::slotPing( const QString& channel ) {
+void MainWindow::slotPing( const QString& /*channel*/ ) {
raise();