aboutsummaryrefslogtreecommitdiffstats
path: root/launcher/src/applicationhandler.cpp
blob: 8f3a8fda3acae9d46bf220717a83155e603c2e30 (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
#include <QFileInfo>
#include <functional>

#include "applicationhandler.h"


ApplicationHandler::ApplicationHandler(QObject *parent, Launcher *launcher) :
	QObject(parent)
{
	m_launcher = launcher;
}

ApplicationHandler::~ApplicationHandler()
{
}

size_t
ApplicationHandler::getRunnables(void)
{
	QString data;
	size_t runnables = 0;

	if (m_launcher == nullptr)
		return runnables;

	runnables = m_launcher->get_list_runnables(data);
	emit initAppList(data);

	return runnables;
}

int
ApplicationHandler::launch(const QString &app_id)
{
	if (m_launcher) {
		return m_launcher->start(app_id);
	}

	return -1;
}