diff --git a/kopete/chatwindow/chatmessagepart.cpp b/kopete/chatwindow/chatmessagepart.cpp --- a/kopete/chatwindow/chatmessagepart.cpp +++ b/kopete/chatwindow/chatmessagepart.cpp @@ -847,7 +847,7 @@ { if (inProgress()) { d->scrollToEndDelayed = true; - } else { + } else if (view()) { view()->scrollBy(0, view()->contentsHeight()); } } diff --git a/kopete/chatwindow/kopetechatwindow.h b/kopete/chatwindow/kopetechatwindow.h --- a/kopete/chatwindow/kopetechatwindow.h +++ b/kopete/chatwindow/kopetechatwindow.h @@ -187,6 +187,7 @@ public Q_SLOTS: void slotSmileyActivated(const QString &); void setActiveView(QWidget *active); + void setActiveView(int); void updateBackground(const QPixmap &pm); private Q_SLOTS: diff --git a/kopete/chatwindow/kopetechatwindow.cpp b/kopete/chatwindow/kopetechatwindow.cpp --- a/kopete/chatwindow/kopetechatwindow.cpp +++ b/kopete/chatwindow/kopetechatwindow.cpp @@ -693,7 +693,7 @@ connect(m_tabBar, SIGNAL(testCanDecode(const QDragMoveEvent*,bool&)), this, SLOT(testCanDecode(const QDragMoveEvent*,bool&))); connect(m_tabBar, SIGNAL(receivedDropEvent(QWidget*,QDropEvent*)), this, SLOT(receivedDropEvent(QWidget*,QDropEvent*))); - connect(m_tabBar, SIGNAL(currentChanged(QWidget*)), this, SLOT(setActiveView(QWidget*))); + connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(setActiveView(int))); connect(m_tabBar, SIGNAL(contextMenu(QWidget*,QPoint)), this, SLOT(slotTabContextMenu(QWidget*,QPoint))); if (m_activeView) { @@ -759,7 +759,7 @@ void KopeteChatWindow::deleteTabBar() { if (m_tabBar) { - disconnect(m_tabBar, SIGNAL(currentChanged(QWidget*)), this, SLOT(setActiveView(QWidget*))); + disconnect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(setActiveView(int))); disconnect(m_tabBar, SIGNAL(contextMenu(QWidget*,QPoint)), this, SLOT(slotTabContextMenu(QWidget*,QPoint))); if (!chatViewList.isEmpty()) { @@ -1037,6 +1037,11 @@ emit chatSessionChanged(m_activeView->msgManager()); } +void KopeteChatWindow::setActiveView(int idx) +{ + setActiveView(m_tabBar->widget(idx)); +} + void KopeteChatWindow::slotUpdateCaptionIcons(ChatView *view) { if (!view) {