aboutsummaryrefslogtreecommitdiffstats
path: root/core/pictureobj.cpp
blob: cb6b32675a3f336f1776926171b461bb19bff440 (plain) (blame)
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
// SPDX-License-Identifier: GPL-2.0
#include "pictureobj.h"
#include "qthelper.h"

PictureObj::PictureObj() : offset({ 0 }), location({ 0 })
{
}

PictureObj::PictureObj(const picture &pic) : filename(pic.filename), offset(pic.offset), location(pic.location)
{
}

picture PictureObj::toCore() const
{
	return picture {
		strdup(filename.c_str()),
		offset,
		location
	};
}

bool PictureObj::operator<(const PictureObj &p2) const
{
	if (offset.seconds != p2.offset.seconds)
		return offset.seconds < p2.offset.seconds;
	return strcmp(filename.c_str(), p2.filename.c_str()) < 0;
}