summaryrefslogtreecommitdiffstats
path: root/backend/BaseUpdate.cpp
blob: 8a4aced37e6e77f2f6d2f0357fe59770704cae77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "BaseUpdate.h"

BaseUpdate::BaseUpdate ( BaseInstance* inst, QObject* parent ) : Task ( parent )
{
	m_inst = inst;
}

void BaseUpdate::error ( const QString& msg )
{
	emit gameUpdateError(msg);
}

void BaseUpdate::updateDownloadProgress(qint64 current, qint64 total)
{
	// The progress on the current file is current / total
	float currentDLProgress = (float) current / (float) total;
	setProgress((int)(currentDLProgress * 100)); // convert to percentage
}