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 ( )
2020-08-17 14:26:28 +03:00
: Generic ( )
2020-08-17 14:11:25 +03:00
{
}
Applet : : Applet ( Applet & & o )
2020-08-17 14:26:28 +03:00
: Generic ( o ) ,
2021-02-07 12:02:50 +02:00
isSelected ( o . isSelected ) ,
2020-08-17 14:11:25 +03:00
description ( o . description ) ,
2021-04-29 18:49:47 +03:00
icon ( o . icon ) ,
2021-04-30 09:35:24 +03:00
storageId ( o . storageId ) ,
subcontainmentId ( o . subcontainmentId )
2020-08-17 14:11:25 +03:00
{
}
Applet : : Applet ( const Applet & o )
2020-08-17 14:26:28 +03:00
: Generic ( o ) ,
2021-02-07 12:02:50 +02:00
isSelected ( o . isSelected ) ,
2020-08-17 14:11:25 +03:00
description ( o . description ) ,
2021-04-29 18:49:47 +03:00
icon ( o . icon ) ,
2021-04-30 09:35:24 +03:00
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 ;
2021-02-07 12:02:50 +02:00
isSelected = rhs . isSelected ;
2020-08-17 14:11:25 +03:00
icon = rhs . icon ;
2021-04-29 18:49:47 +03:00
storageId = rhs . storageId ;
2021-04-30 09:35:24 +03:00
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 ;
2021-02-07 12:02:50 +02:00
isSelected = rhs . isSelected ;
2020-08-17 14:11:25 +03:00
icon = rhs . icon ;
2021-04-29 18:49:47 +03:00
storageId = rhs . storageId ;
2021-04-30 09:35:24 +03:00
subcontainmentId = rhs . subcontainmentId ;
2020-08-17 14:11:25 +03:00
return ( * this ) ;
}
2021-02-10 20:05:13 +02:00
bool Applet : : operator = = ( const Applet & rhs ) const
{
return ( id = = rhs . id )
& & ( name = = rhs . name )
& & ( description = = rhs . description )
& & ( icon = = rhs . icon )
2021-04-29 18:49:47 +03:00
& & ( isSelected = = rhs . isSelected )
2021-04-30 09:35:24 +03:00
& & ( storageId = = rhs . storageId )
& & ( subcontainmentId = = rhs . subcontainmentId ) ;
2021-02-10 20:05:13 +02:00
}
bool Applet : : operator ! = ( const Applet & rhs ) const
{
return ! ( * this = = rhs ) ;
}
2021-02-07 12:53:10 +02:00
bool Applet : : isInstalled ( ) const
{
return isValid ( ) & & id ! = name ;
}
2020-08-20 17:28:29 +03:00
bool Applet : : isValid ( ) const
{
2021-02-09 19:15:51 +02:00
return ! id . isEmpty ( ) ;
2020-08-20 17:28:29 +03:00
}
2021-05-01 13:32:17 +03:00
QString Applet : : visibleName ( ) const
{
return name . isEmpty ( ) ? id : name ;
}
2020-08-17 14:11:25 +03:00
}
}