[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:25:07 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=224329b
The following commit has been merged in the master branch:
commit 224329b78b63bdb70c8f733362d258085d1c7c14
Author: Martin Klapetek <mklapetek at kde.org>
Date: Mon Jan 12 19:18:11 2015 +0100
[app] Port KTab* to QTab*
---
app/chat-window.cpp | 28 ++++++++++++----------------
app/chat-window.h | 7 ++++---
2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index bea8e05..2ec0919 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -124,20 +124,20 @@ ChatWindow::ChatWindow()
connect(m_keyboardLayoutInterface, SIGNAL(currentLayoutChanged(QString)), this, SLOT(onKeyboardLayoutChange(QString)));
// set up m_tabWidget
- m_tabWidget = new KTabWidget(this);
+ m_tabWidget = new QTabWidget(this);
//clicking on the close button can result in the tab bar getting focus, this works round that
m_tabWidget->setFocusPolicy(Qt::TabFocus);
m_tabWidget->setMovable(true);
m_tabWidget->setDocumentMode(true);
m_tabWidget->setTabsClosable(true);
- m_tabWidget->setTabBarHidden(true);
+ m_tabWidget->tabBar()->hide();
m_tabWidget->setElideMode(Qt::ElideRight);
connect(m_tabWidget, SIGNAL(closeRequest(QWidget*)), this, SLOT(destroyTab(QWidget*)));
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentIndexChanged(int)));
- connect(qobject_cast<KTabBar*>(m_tabWidget->tabBar()), SIGNAL(mouseMiddleClick(int)), this, SLOT(onTabMiddleClicked(int)));
- connect(qobject_cast<KTabBar*>(m_tabWidget->tabBar()), SIGNAL(contextMenu(int,QPoint)), SLOT(tabBarContextMenu(int,QPoint)));
+ connect(qobject_cast<QTabBar*>(m_tabWidget->tabBar()), SIGNAL(mouseMiddleClick(int)), this, SLOT(onTabMiddleClicked(int)));
+ connect(qobject_cast<QTabBar*>(m_tabWidget->tabBar()), SIGNAL(contextMenu(int,QPoint)), SLOT(tabBarContextMenu(int,QPoint)));
setCentralWidget(m_tabWidget);
@@ -189,9 +189,9 @@ void ChatWindow::tabBarContextMenu(int index, const QPoint& globalPos)
} else if (result == &dettach) {
Q_EMIT detachRequested(qobject_cast<ChatTab*>(m_tabWidget->widget(index)));
} else if (result == &moveLeft) {
- m_tabWidget->moveTab(index, index - 1);
+ m_tabWidget->tabBar()->moveTab(index, index - 1);
} else if (result == &moveRight) {
- m_tabWidget->moveTab(index, index + 1);
+ m_tabWidget->tabBar()->moveTab(index, index + 1);
}
}
@@ -250,12 +250,10 @@ void ChatWindow::removeTab(ChatTab *tab)
tab->stopOtrSession();
removeChatTabSignals(tab);
- m_tabWidget->removePage(tab);
+ m_tabWidget->removeTab(m_tabWidget->indexOf(tab));
- if (!m_tabWidget->isTabBarHidden()){
- if (m_tabWidget->count() <= 1) {
- m_tabWidget->setTabBarHidden(true);
- }
+ if (m_tabWidget->tabBar()->isVisible() && m_tabWidget->count() <= 1) {
+ m_tabWidget->tabBar()->hide();
}
}
@@ -281,10 +279,8 @@ void ChatWindow::addTab(ChatTab *tab)
m_tabWidget->setCurrentWidget(tab);
m_tabWidget->setTabToolTip(m_tabWidget->indexOf(tab), tab->title());
- if (m_tabWidget->isTabBarHidden()) {
- if (m_tabWidget->count() > 1) {
- m_tabWidget->setTabBarHidden(false);
- }
+ if (!m_tabWidget->tabBar()->isVisible() && m_tabWidget->count() > 1) {
+ m_tabWidget->tabBar()->show();
}
tab->setFocus();
@@ -328,7 +324,7 @@ void ChatWindow::setTabIcon(int index, const QIcon & newIcon)
void ChatWindow::setTabTextColor(int index, const QColor& color)
{
- m_tabWidget->setTabTextColor(index, color);
+ m_tabWidget->tabBar()->setTabTextColor(index, color);
}
void ChatWindow::closeCurrentTab()
diff --git a/app/chat-window.h b/app/chat-window.h
index cf81375..587661f 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -26,10 +26,11 @@
#include "proxy-service.h"
#include <KXmlGuiWindow>
-#include <KTabWidget>
-#include <QAction>
#include <KActionMenu>
+#include <QTabWidget>
+#include <QAction>
+
namespace Sonnet {
class DictionaryComboBox;
}
@@ -215,7 +216,7 @@ private:
QAction *m_sendMessage;
- KTabWidget *m_tabWidget;
+ QTabWidget *m_tabWidget;
QDBusInterface *m_keyboardLayoutInterface;
Sonnet::DictionaryComboBox *m_spellDictCombo;
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list