summaryrefslogtreecommitdiff
path: root/qorgwatchlet/qorgwatchletplugin.cpp
blob: 8416f0f3305c84db0f9809761b3909f6d6b36d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "qorgwatchlet.h"
#include "qorgwatchletplugin.h"

#include <QtOrganizer/QOrganizerAbstractRequest>

using namespace sowatch;
QTM_USE_NAMESPACE

QOrgWatchletPlugin::QOrgWatchletPlugin(QObject *parent) :
    QObject(parent)
{
	// Workaround a weird QtOrganizer issue
	qRegisterMetaType<QOrganizerAbstractRequest::State>("QOrganizerAbstractRequest::State");
}

QOrgWatchletPlugin::~QOrgWatchletPlugin()
{
}

QStringList QOrgWatchletPlugin::watchlets()
{
	QStringList l;
	l << "com.javispedro.sowatch.qorg";
	return l;
}

WatchletPluginInterface::WatchletInfo QOrgWatchletPlugin::describeWatchlet(const QString &id)
{
	WatchletInfo info;
	if (id != "com.javispedro.sowatch.qorg") return info;
	info.name = "Calendar";
	info.icon = QUrl::fromLocalFile(SOWATCH_QML_DIR "/qorgwatchlet/icon.png");
	return info;
}

Watchlet* QOrgWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, Watch *watch)
{
	Q_UNUSED(config);
	if (id != "com.javispedro.sowatch.qorg") return 0;
	return new QOrgWatchlet(watch);
}

Q_EXPORT_PLUGIN2(qmsgwatchlet, QOrgWatchletPlugin)