[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/applets/presence
From: Dariusz Mikulski <dariusz.mikulski () gmail ! com>
Date: 2009-01-12 20:38:38
Message-ID: 1231792718.048339.1380.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 910200 by mikulski:
update to new Plasma API
M +17 -3 CMakeLists.txt
M +8 -3 presence.cpp
M +8 -3 presence.h
--- trunk/playground/base/plasma/applets/presence/CMakeLists.txt #910199:910200
@@ -1,7 +1,17 @@
+SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" \
${CMAKE_MODULE_PATH}) project(plasma-presence)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
+find_package(KDE4 REQUIRED)
+find_package (TelepathyQt4 REQUIRED)
+include(KDE4Defaults)
+
+add_definitions(${KDE4_DEFINITIONS})
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${KDE4_INCLUDES}
+ ${TELEPATHY_QT4_INCLUDE_DIR}
)
set(presence_SRCS
@@ -9,7 +19,11 @@
presenceitemdelegate.cpp)
kde4_add_plugin(plasma_applet_presence ${presence_SRCS})
-target_link_libraries(plasma_applet_presence plasmaappletdialog ${KDE4_PLASMA_LIBS} \
decibel ${KDE4_KDEUI_LIBS} QtTapioca) +target_link_libraries(plasma_applet_presence
+ ${KDE4_PLASMA_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${TELEPATHY_QT4_LIBRARIES}
+)
install(TARGETS plasma_applet_presence DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-applet-presence.desktop DESTINATION ${SERVICES_INSTALL_DIR})
--- trunk/playground/base/plasma/applets/presence/presence.cpp #910199:910200
@@ -22,7 +22,8 @@
#include "presenceitemdelegate.h"
#include <plasma/theme.h>
-#include <plasma/widgets/icon.h>
+#include <plasma/widgets/iconwidget.h>
+#include <plasma/dialog.h>
#include <Decibel/Types>
@@ -42,7 +43,7 @@
#include <QtGui/QVBoxLayout>
PresenceApplet::PresenceApplet(QObject * parent, const QVariantList & args)
- : PlasmaAppletDialog(parent, args),
+ : Plasma::Applet(parent, args),
m_engine(0),
m_colorScheme(0),
m_masterStatusLayout(0),
@@ -72,7 +73,7 @@
// Set up the icon.
Q_ASSERT(!m_icon); // Pointer should still be assigned to 0.
- m_icon = new Plasma::Icon(KIcon("user-offline"), QString(), this);
+ m_icon = new Plasma::IconWidget(KIcon("user-offline"), QString(), this);
// The icon has been changed.
iconChanged();
@@ -194,6 +195,9 @@
//online->setData(Plasma::Theme::self()->textColor(), Qt::ForegroundRole);
//status->setData(Plasma::Theme::self()->textColor(), Qt::ForegroundRole);
//message->setData(Plasma::Theme::self()->textColor(), Qt::ForegroundRole);
+
+ // FIXME: TelepathyQt4
+/*
QtTapioca::PresenceState currentPresence
= data.value("current_presence").value<QtTapioca::PresenceState>();
@@ -202,6 +206,7 @@
presence_state->setData(currentPresence.name(), Qt::DisplayRole);
message->setData(data.value("status_message").toString(),
Qt::DisplayRole);
+*/
/*
* so, we need to look in the first column
* to see if we can find a row with that value
--- trunk/playground/base/plasma/applets/presence/presence.h #910199:910200
@@ -20,10 +20,14 @@
#ifndef PLASMA_APPLET_PRESENCE_H
#define PLASMA_APPLET_PRESENCE_H
-#include <plasmaappletdialog.h>
-
+#include <plasma/applet.h>
#include <plasma/dataengine.h>
+namespace Plasma
+{
+ class IconWidget;
+}
+
#include <QtCore/QString>
class KColorScheme;
@@ -36,7 +40,7 @@
class QVBoxLayout;
class QWidget;
-class PresenceApplet : public PlasmaAppletDialog
+class PresenceApplet : public Plasma::Applet
{
Q_OBJECT
@@ -61,6 +65,7 @@
void updateMasterPresence();
Plasma::DataEngine * m_engine;
+ Plasma::IconWidget *m_icon;
KColorScheme * m_colorScheme;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic