summaryrefslogtreecommitdiff
path: root/qmafwwatchlet/qmafwwatchletplugin.cpp
blob: a2d7a1ff839cd9cb810bcb09c8fdd7aa140c5f6e (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
#include "qmafwwatchlet.h"
#include "qmafwwatchletplugin.h"

using namespace sowatch;

QMafwWatchletPlugin::QMafwWatchletPlugin(QObject *parent) :
    QObject(parent)
{
}

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

WatchletPluginInterface::WatchletInfo QMafwWatchletPlugin::describeWatchlet(const QString &id, const QString &watchModel)
{
	WatchletInfo info;
	if (id != "com.javispedro.sowatch.qmafw") return info;
	info.name = tr("Music player");
	info.phoneIcon = QUrl::fromLocalFile(SOWATCH_QML_DIR "/qmafwwatchlet/icon.png");
	info.icon = QUrl::fromLocalFile(SOWATCH_QML_DIR "/qmafwwatchlet/" + watchModel + "-icon.png");
	info.visible = true;
	return info;
}

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

Q_EXPORT_PLUGIN2(qmafwwatchlet, QMafwWatchletPlugin)