Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
violethaze74
appstream
Commits
b3d50ceb
Commit
b3d50ceb
authored
Aug 15, 2019
by
Matthias Klumpp
Browse files
Implement support for icon-theme components
CC: #67
parent
fc4732d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
qt/component.cpp
View file @
b3d50ceb
...
...
@@ -53,6 +53,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(KindMap, kindMap, ( {
{
Component
::
KindService
,
QLatin1String
(
"service"
)
},
{
Component
::
KindRepository
,
QLatin1String
(
"repository"
)
},
{
Component
::
KindOperatingSystem
,
QLatin1String
(
"operating-system"
)
},
{
Component
::
KindIconTheme
,
QLatin1String
(
"icon-theme"
)
},
{
Component
::
KindUnknown
,
QLatin1String
(
"unknown"
)
}
}
));
...
...
@@ -107,6 +108,9 @@ Component::Kind Component::stringToKind(const QString& kindString) {
if
(
kindString
==
QLatin1String
(
"operating-system"
))
return
KindOperatingSystem
;
if
(
kindString
==
QLatin1String
(
"icon-theme"
))
return
KindIconTheme
;
return
KindUnknown
;
}
...
...
qt/component.h
View file @
b3d50ceb
...
...
@@ -65,7 +65,8 @@ Q_GADGET
KindLocalization
,
KindService
,
KindRepository
,
KindOperatingSystem
KindOperatingSystem
,
KindIconTheme
};
Q_ENUM
(
Kind
)
...
...
src/as-component.c
View file @
b3d50ceb
...
...
@@ -179,6 +179,7 @@ as_component_kind_get_type (void)
{
AS_COMPONENT_KIND_SERVICE
,
"AS_COMPONENT_KIND_SERVICE"
,
"service"
},
{
AS_COMPONENT_KIND_REPOSITORY
,
"AS_COMPONENT_KIND_REPOSITORY"
,
"repository"
},
{
AS_COMPONENT_KIND_OPERATING_SYSTEM
,
"AS_COMPONENT_KIND_OPERATING_SYSTEM"
,
"operating-system"
},
{
AS_COMPONENT_KIND_ICON_THEME
,
"AS_COMPONENT_KIND_ICON_THEME"
,
"icon-theme"
},
{
0
,
NULL
,
NULL
}
};
GType
as_component_type_type_id
;
...
...
@@ -227,6 +228,8 @@ as_component_kind_to_string (AsComponentKind kind)
return
"repository"
;
if
(
kind
==
AS_COMPONENT_KIND_OPERATING_SYSTEM
)
return
"operating-system"
;
if
(
kind
==
AS_COMPONENT_KIND_ICON_THEME
)
return
"icon-theme"
;
return
"unknown"
;
}
...
...
@@ -271,6 +274,8 @@ as_component_kind_from_string (const gchar *kind_str)
return
AS_COMPONENT_KIND_REPOSITORY
;
if
(
g_strcmp0
(
kind_str
,
"operating-system"
)
==
0
)
return
AS_COMPONENT_KIND_OPERATING_SYSTEM
;
if
(
g_strcmp0
(
kind_str
,
"icon-theme"
)
==
0
)
return
AS_COMPONENT_KIND_ICON_THEME
;
/* legacy */
if
(
g_strcmp0
(
kind_str
,
"desktop"
)
==
0
)
...
...
src/as-component.h
View file @
b3d50ceb
...
...
@@ -74,6 +74,7 @@ struct _AsComponentClass
* @AS_COMPONENT_KIND_SERVICE: A system service launched by the init system
* @AS_COMPONENT_KIND_REPOSITORY: A remote software or data source
* @AS_COMPONENT_KIND_OPERATING_SYSTEM: A computer operating system
* @AS_COMPONENT_KIND_ICON_THEME: An icon theme following the XDG specification
*
* The type of an #AsComponent.
**/
...
...
@@ -93,6 +94,7 @@ typedef enum {
AS_COMPONENT_KIND_SERVICE
,
AS_COMPONENT_KIND_REPOSITORY
,
AS_COMPONENT_KIND_OPERATING_SYSTEM
,
AS_COMPONENT_KIND_ICON_THEME
,
/*< private >*/
AS_COMPONENT_KIND_LAST
}
AsComponentKind
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment