[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:10:40 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=a0f42d6
The following commit has been merged in the master branch:
commit a0f42d6bf637017e9b015996c3afa685215ae96e
Author: Dariusz Mikulski <dariusz.mikulski at gmail.com>
Date: Tue Jan 13 22:12:07 2009 +0000
update to new Plasma API
svn path=/trunk/playground/base/plasma/applets/presence/; revision=910661
---
presence/src/presence.cpp | 27 ++++++++++++++-------------
presence/src/presence.h | 12 ++++++------
2 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/presence/src/presence.cpp b/presence/src/presence.cpp
index e8a9205..5100999 100644
--- a/presence/src/presence.cpp
+++ b/presence/src/presence.cpp
@@ -23,7 +23,6 @@
#include <plasma/theme.h>
#include <plasma/widgets/iconwidget.h>
-#include <plasma/dialog.h>
#include <KColorScheme>
#include <KDebug>
@@ -38,11 +37,14 @@
#include <QtGui/QLabel>
#include <QtGui/QStandardItemModel>
#include <QtGui/QTreeView>
-#include <QtGui/QWidget>
+#include <QtGui/QGraphicsProxyWidget>
#include <QtGui/QVBoxLayout>
+
PresenceApplet::PresenceApplet(QObject * parent, const QVariantList & args)
- : Plasma::Applet(parent, args),
+ : Plasma::PopupApplet(parent, args),
+ m_icon(0),
+ m_widget(0),
m_engine(0),
m_colorScheme(0),
m_masterStatusLayout(0),
@@ -50,13 +52,13 @@ PresenceApplet::PresenceApplet(QObject * parent, const QVariantList & args)
m_masterStatusMessageLabel(0),
m_accountsModel(0),
m_accountsView(0),
- m_layout(0),
- m_widget(0),
- m_icon(0)
+ m_layout(0)
{ }
PresenceApplet::~PresenceApplet()
{
+ if(m_widget)
+ delete m_widget;
delete m_colorScheme;
}
@@ -73,7 +75,7 @@ void PresenceApplet::init()
// Set up the icon.
Q_ASSERT(!m_icon); // Pointer should still be assigned to 0.
m_icon = new Plasma::IconWidget(this);
- m_icon->setIcon(KIcon("user-offline"));
+ m_icon->setIcon(KIcon("user-online"));
// The icon has been changed.
iconChanged();
@@ -107,7 +109,7 @@ void PresenceApplet::init()
QWidget *PresenceApplet::widget()
{
- if(!m_widget)
+ if(!m_widget)
{
// Set up the accounts view.
Q_ASSERT(!m_accountsView); // Pointer should still be assigned to 0.
@@ -122,7 +124,7 @@ QWidget *PresenceApplet::widget()
Q_ASSERT(!m_masterIconLabel); // Pointer should still be assigned to 0.
Q_ASSERT(!m_masterStatusMessageLabel); // Pointer should still be assigned to 0.
- m_masterStatusLayout = new QHBoxLayout(m_widget);
+ m_masterStatusLayout = new QHBoxLayout();
m_masterIconLabel = new QLabel;
m_masterStatusMessageLabel = new QLabel;
@@ -136,8 +138,8 @@ QWidget *PresenceApplet::widget()
// Set up the rest of the view/layout etc. stuff.
Q_ASSERT(!m_widget); // Pointer should still be assigned to 0.
Q_ASSERT(!m_layout); // Pointer should still be assigned to 0.
- m_widget = new QWidget();
- m_layout = new QVBoxLayout(m_widget);
+ m_widget = new QWidget;
+ m_layout = new QVBoxLayout();
m_layout->addLayout(m_masterStatusLayout);
m_layout->addWidget(m_accountsView);
m_widget->setLayout(m_layout);
@@ -153,7 +155,7 @@ QWidget *PresenceApplet::widget()
}
Q_ASSERT(m_widget); // We must have a valid m_widget by now.
-
+
return m_widget;
}
@@ -305,7 +307,6 @@ void PresenceApplet::updateMasterPresence()
int accountsBusy = 0;
bool okOffline = true;
- bool okAvailable = true;
bool okAway = true;
bool okExtendedAway = true;
bool okHidden = true;
diff --git a/presence/src/presence.h b/presence/src/presence.h
index 7a38b41..89cfcdc 100644
--- a/presence/src/presence.h
+++ b/presence/src/presence.h
@@ -20,7 +20,7 @@
#ifndef PLASMA_APPLET_PRESENCE_H
#define PLASMA_APPLET_PRESENCE_H
-#include <plasma/applet.h>
+#include <plasma/popupapplet.h>
#include <plasma/dataengine.h>
namespace Plasma
@@ -29,18 +29,18 @@ namespace Plasma
}
#include <QtCore/QString>
+#include <QtGui/QLabel>
class KColorScheme;
class QHBoxLayout;
-class QLabel;
class QStandardItemModel;
class QString;
class QTreeView;
class QVBoxLayout;
-class QWidget;
+class QGraphicsProxyWidget;
-class PresenceApplet : public Plasma::Applet
+class PresenceApplet : public Plasma::PopupApplet
{
Q_OBJECT
@@ -48,7 +48,7 @@ public:
PresenceApplet(QObject * parent, const QVariantList & args);
~PresenceApplet();
- QWidget * widget();
+ QWidget *widget();
void init();
@@ -74,7 +74,7 @@ private:
QStandardItemModel * m_accountsModel;
QTreeView * m_accountsView;
QVBoxLayout * m_layout;
- QWidget * m_widget;
+ QWidget *m_widget;
QString m_masterStatusMessage;
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list