1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-10 04:58:16 +03:00
latte-dock/app/data/appletdata.cpp

95 lines
1.8 KiB
C++
Raw Normal View History

2020-08-17 14:11:25 +03:00
/*
2021-05-27 15:01:00 +00:00
SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
2020-08-17 14:11:25 +03:00
#include "appletdata.h"
namespace Latte {
namespace Data {
Applet::Applet()
: Generic()
2020-08-17 14:11:25 +03:00
{
}
Applet::Applet(Applet &&o)
: Generic(o),
isSelected(o.isSelected),
2020-08-17 14:11:25 +03:00
description(o.description),
icon(o.icon),
storageId(o.storageId),
subcontainmentId(o.subcontainmentId)
2020-08-17 14:11:25 +03:00
{
}
Applet::Applet(const Applet &o)
: Generic(o),
isSelected(o.isSelected),
2020-08-17 14:11:25 +03:00
description(o.description),
icon(o.icon),
storageId(o.storageId),
subcontainmentId(o.subcontainmentId)
2020-08-17 14:11:25 +03:00
{
}
Applet &Applet::operator=(const Applet &rhs)
{
id = rhs.id;
name = rhs.name;
description = rhs.description;
isSelected = rhs.isSelected;
2020-08-17 14:11:25 +03:00
icon = rhs.icon;
storageId = rhs.storageId;
subcontainmentId = rhs.subcontainmentId;
2020-08-17 14:11:25 +03:00
return (*this);
}
Applet &Applet::operator=(Applet &&rhs)
{
id = rhs.id;
name = rhs.name;
description = rhs.description;
isSelected = rhs.isSelected;
2020-08-17 14:11:25 +03:00
icon = rhs.icon;
storageId = rhs.storageId;
subcontainmentId = rhs.subcontainmentId;
2020-08-17 14:11:25 +03:00
return (*this);
}
bool Applet::operator==(const Applet &rhs) const
{
return (id == rhs.id)
&& (name == rhs.name)
&& (description == rhs.description)
&& (icon == rhs.icon)
&& (isSelected == rhs.isSelected)
&& (storageId == rhs.storageId)
&& (subcontainmentId == rhs.subcontainmentId);
}
bool Applet::operator!=(const Applet &rhs) const
{
return !(*this == rhs);
}
bool Applet::isInstalled() const
{
return isValid() && id != name;
}
bool Applet::isValid() const
{
return !id.isEmpty();
}
QString Applet::visibleName() const
{
return name.isEmpty() ? id : name;
}
2020-08-17 14:11:25 +03:00
}
}