File indexing completed on 2024-06-23 08:47:20

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #include "appletdata.h"
0007 
0008 namespace Latte {
0009 namespace Data {
0010 
0011 Applet::Applet()
0012     : Generic()
0013 {
0014 }
0015 
0016 Applet::Applet(Applet &&o)
0017     : Generic(o),
0018       isSelected(o.isSelected),
0019       description(o.description),
0020       icon(o.icon),
0021       storageId(o.storageId),
0022       subcontainmentId(o.subcontainmentId)
0023 {
0024 }
0025 
0026 Applet::Applet(const Applet &o)
0027     : Generic(o),
0028       isSelected(o.isSelected),
0029       description(o.description),
0030       icon(o.icon),
0031       storageId(o.storageId),
0032       subcontainmentId(o.subcontainmentId)
0033 {
0034 }
0035 
0036 Applet &Applet::operator=(const Applet &rhs)
0037 {
0038     id = rhs.id;
0039     name = rhs.name;
0040     description = rhs.description;
0041     isSelected = rhs.isSelected;
0042     icon = rhs.icon;
0043     storageId = rhs.storageId;
0044     subcontainmentId = rhs.subcontainmentId;
0045 
0046     return (*this);
0047 }
0048 
0049 Applet &Applet::operator=(Applet &&rhs)
0050 {
0051     id = rhs.id;
0052     name = rhs.name;
0053     description = rhs.description;
0054     isSelected = rhs.isSelected;
0055     icon = rhs.icon;
0056     storageId = rhs.storageId;
0057     subcontainmentId = rhs.subcontainmentId;
0058 
0059     return (*this);
0060 }
0061 
0062 bool Applet::operator==(const Applet &rhs) const
0063 {
0064     return (id == rhs.id)
0065             && (name == rhs.name)
0066             && (description == rhs.description)
0067             && (icon == rhs.icon)
0068             && (isSelected == rhs.isSelected)
0069             && (storageId == rhs.storageId)
0070             && (subcontainmentId == rhs.subcontainmentId);
0071 }
0072 
0073 bool  Applet::operator!=(const Applet &rhs) const
0074 {
0075     return !(*this == rhs);
0076 }
0077 
0078 bool Applet::isInstalled() const
0079 {
0080     return isValid() && id != name;
0081 }
0082 
0083 bool Applet::isValid() const
0084 {
0085     return !id.isEmpty();
0086 }
0087 
0088 QString Applet::visibleName() const
0089 {
0090     return name.isEmpty() ? id : name;
0091 }
0092 
0093 }
0094 }