#include "notifications.h"
#include "android.h"
#include "desktop.h"
#include <QDebug>
#include <QDateTime>
#include <QMessageBox>


Notifications::Notifications(): QObject() {
	cnt = 0;
	//startTimer(1000);
}


Notifications::~Notifications() {
}


Notifications * Notifications::instance() {
	static Notifications * ret = new Notifications();
	return ret;
}


void Notifications::timerEvent(QTimerEvent * e) {
	notify(QString::number(++cnt));
}


void Notifications::init() {

}


void Notifications::notify(QString s) {
	if (s.isEmpty()) return;
	s.prepend(QDateTime::currentDateTime().toString() + " - ");
#ifdef ANDROID
	ANDROID_LAYER->notify(s);
#else
	DESKTOP_LAYER->notify(s);
#endif
}
