[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:24:51 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=b7b7d6f
The following commit has been merged in the master branch:
commit b7b7d6ff8061c2cc69a22d971c9f02e5db15fcd7
Author: Marcin Ziemiński <zieminn at gmail.com>
Date: Tue Aug 19 20:10:41 2014 +0200
Use Tp::SharedPtr instead of raw pointers
---
app/chat-window.cpp | 4 ++--
app/chat-window.h | 2 +-
config/otr-config.cpp | 11 +++++------
config/otr-config.h | 8 ++++----
lib/channel-adapter.cpp | 2 +-
lib/channel-adapter.h | 5 +++--
lib/chat-widget.cpp | 2 +-
lib/keygendialog.ui | 25 ++++++++++++++++++++++---
lib/proxy-service.cpp | 4 +++-
lib/proxy-service.h | 8 ++++++--
10 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index c5b4527..02040a2 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -935,9 +935,9 @@ void ChatWindow::setupOTR()
actionCollection()->addAction(QLatin1String("otr-actions"), m_otrActionMenu);
// private key generation
- connect(m_proxyService, SIGNAL(keyGenerationStarted(Tp::AccountPtr)),
+ connect(m_proxyService.data(), SIGNAL(keyGenerationStarted(Tp::AccountPtr)),
SLOT(onKeyGenerationStarted(Tp::AccountPtr)));
- connect(m_proxyService, SIGNAL(keyGenerationFinished(Tp::AccountPtr, bool)),
+ connect(m_proxyService.data(), SIGNAL(keyGenerationFinished(Tp::AccountPtr, bool)),
SLOT(onKeyGenerationFinished(Tp::AccountPtr, bool)));
}
diff --git a/app/chat-window.h b/app/chat-window.h
index 8d73b3d..e17dea6 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -222,7 +222,7 @@ private:
QLabel *m_accountIconLabel;
qreal m_zoomFactor;
KActionMenu *m_otrActionMenu;
- ProxyService *m_proxyService;
+ ProxyServicePtr m_proxyService;
};
#endif // CHATWINDOW_H
diff --git a/config/otr-config.cpp b/config/otr-config.cpp
index ccd1601..c84a681 100644
--- a/config/otr-config.cpp
+++ b/config/otr-config.cpp
@@ -42,7 +42,6 @@ OTRConfig::OTRConfig(QWidget *parent, const QVariantList& args)
: KCModule(KCMTelepathyChatOtrConfigFactory::componentData(), parent, args),
ui(new Ui::OTRConfigUi()),
am(KTp::accountManager()),
- ps(NULL),
fpCtxMenu(new QMenu(this))
{
kDebug();
@@ -80,20 +79,20 @@ OTRConfig::~OTRConfig()
delete ui;
}
-ProxyService* OTRConfig::proxyService()
+ProxyServicePtr OTRConfig::proxyService()
{
return ps;
}
-void OTRConfig::setProxyService(ProxyService *proxyService)
+void OTRConfig::setProxyService(const ProxyServicePtr &proxyService)
{
ps = proxyService;
- connect(ps, SIGNAL(keyGenerationFinished(Tp::AccountPtr, bool)), SLOT(onKeyGenerationFinished()));
+ connect(ps.data(), SIGNAL(keyGenerationFinished(Tp::AccountPtr, bool)), SLOT(onKeyGenerationFinished()));
}
void OTRConfig::load()
{
- Q_ASSERT(ps != NULL);
+ Q_ASSERT(!ps.isNull());
kDebug();
accounts = am->validAccounts()->accounts();
QStringList items;
@@ -199,7 +198,7 @@ void OTRConfig::onPolicyGet(Tp::PendingOperation *getOp)
if(getOp->isError()) {
kWarning() << "Could not get OTR policy: " << getOp->errorMessage();
} else {
- Tp::PendingVariant *pv = dynamic_cast<Tp::PendingVariant*>(getOp);
+ Tp::PendingVariant *pv = qobject_cast<Tp::PendingVariant*>(getOp);
const uint id = pv->result().toUInt(NULL);
Q_FOREACH(QAbstractButton *bt, ui->policyGroupButtons->buttons()) {
bt->setChecked(false);
diff --git a/config/otr-config.h b/config/otr-config.h
index 7424123..5b0b781 100644
--- a/config/otr-config.h
+++ b/config/otr-config.h
@@ -37,7 +37,7 @@ class QMenu;
class OTRConfig : public KCModule
{
Q_OBJECT
- Q_PROPERTY(ProxyService* proxyService READ proxyService WRITE setProxyService)
+ Q_PROPERTY(ProxyServicePtr proxyService READ proxyService WRITE setProxyService)
public:
explicit OTRConfig(QWidget *parent = 0, const QVariantList &args = QVariantList());
@@ -49,8 +49,8 @@ protected:
public Q_SLOTS:
virtual void load();
virtual void save();
- ProxyService* proxyService();
- void setProxyService(ProxyService *ps);
+ ProxyServicePtr proxyService();
+ void setProxyService(const ProxyServicePtr &ps);
private Q_SLOTS:
void onRadioSelected(int id);
@@ -74,7 +74,7 @@ private:
Tp::AccountManagerPtr am;
QList<Tp::AccountPtr> accounts;
Tp::OTRPolicy policy;
- ProxyService *ps;
+ ProxyServicePtr ps;
QMenu *fpCtxMenu;
};
diff --git a/lib/channel-adapter.cpp b/lib/channel-adapter.cpp
index fd86755..f599b2c 100644
--- a/lib/channel-adapter.cpp
+++ b/lib/channel-adapter.cpp
@@ -23,7 +23,7 @@
#include <KDebug>
-#include <QSharedPointer>
+#include <TelepathyQt/SharedPtr>
#include <QMap>
#include <QGenericArgument>
diff --git a/lib/channel-adapter.h b/lib/channel-adapter.h
index 851d6a7..b294b25 100644
--- a/lib/channel-adapter.h
+++ b/lib/channel-adapter.h
@@ -27,10 +27,11 @@
#include <TelepathyQt/Types>
#include <TelepathyQt/TextChannel>
#include <TelepathyQt/PendingOperation>
+#include <TelepathyQt/RefCounted>
class ChatWidget;
-class ChannelAdapter : public QObject
+class ChannelAdapter : public QObject, public Tp::RefCounted
{
Q_OBJECT
@@ -107,6 +108,6 @@ class ChannelAdapter : public QObject
Private *d;
};
-typedef QSharedPointer<ChannelAdapter> ChannelAdapterPtr;
+typedef Tp::SharedPtr<ChannelAdapter> ChannelAdapterPtr;
#endif
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index d021adb..ca51489 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -356,7 +356,7 @@ void ChatWidget::setChatEnabled(bool enable)
void ChatWidget::setTextChannel(const Tp::TextChannelPtr &newTextChannelPtr)
{
- d->channel.clear();
+ d->channel.reset();
d->channel = ChannelAdapterPtr(new ChannelAdapter(newTextChannelPtr));
d->contactModel->setTextChannel(newTextChannelPtr);
diff --git a/lib/keygendialog.ui b/lib/keygendialog.ui
index 7a359ff..632e170 100644
--- a/lib/keygendialog.ui
+++ b/lib/keygendialog.ui
@@ -13,6 +13,9 @@
<property name="windowTitle">
<string>Please Wait</string>
</property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>10</number>
@@ -20,6 +23,19 @@
<property name="rightMargin">
<number>10</number>
</property>
+ <property name="verticalSpacing">
+ <number>1</number>
+ </property>
+ <item row="0" column="1">
+ <widget class="QLabel" name="lbText">
+ <property name="text">
+ <string>Please wait while generating the private key</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0">
<widget class="QLabel" name="keyIcon">
<property name="text">
@@ -27,10 +43,13 @@
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QLabel" name="lbText">
+ <item row="1" column="1">
+ <widget class="QLabel" name="lbTime">
<property name="text">
- <string>Please wait while generating the private key</string>
+ <string>TextLabel</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
diff --git a/lib/proxy-service.cpp b/lib/proxy-service.cpp
index 51915bb..2926e93 100644
--- a/lib/proxy-service.cpp
+++ b/lib/proxy-service.cpp
@@ -37,7 +37,8 @@ class KeyGenDialog : public KDialog
{
QWidget *widget = new QWidget(this);
ui.setupUi(widget);
- ui.lbText->setText(i18n("Generating the private key for %1", accountName));
+ ui.lbText->setText(i18n("Generating the private key for %1...", accountName));
+ ui.lbTime->setText(i18n("This may take some time"));
setMainWidget(widget);
this->setCaption(i18n("Please wait"));
this->setButtons(KDialog::Ok);
@@ -70,6 +71,7 @@ class KeyGenDialog : public KDialog
void setFinished(bool error)
{
+ ui.lbTime->clear();
if(error) {
ui.lbText->setText(i18n("Could not generate a private key for %1", accountName));
} else {
diff --git a/lib/proxy-service.h b/lib/proxy-service.h
index 17a5b93..1895adc 100644
--- a/lib/proxy-service.h
+++ b/lib/proxy-service.h
@@ -23,8 +23,10 @@
#include <QWidget>
#include <TelepathyQt/AccountManager>
+#include <TelepathyQt/SharedPtr>
+#include <TelepathyQt/RefCounted>
-class KDE_TELEPATHY_CHAT_EXPORT ProxyService : public QObject
+class KDE_TELEPATHY_CHAT_EXPORT ProxyService : public QObject, public Tp::RefCounted
{
Q_OBJECT
@@ -65,6 +67,8 @@ class KDE_TELEPATHY_CHAT_EXPORT ProxyService : public QObject
Private *d;
};
-Q_DECLARE_METATYPE(ProxyService*)
+typedef Tp::SharedPtr<ProxyService> ProxyServicePtr;
+
+Q_DECLARE_METATYPE(ProxyServicePtr)
#endif
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list