Commit b3d50ceb authored by Matthias Klumpp's avatar Matthias Klumpp
Browse files

Implement support for icon-theme components

CC: #67
parent fc4732d1
...@@ -53,6 +53,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(KindMap, kindMap, ( { ...@@ -53,6 +53,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(KindMap, kindMap, ( {
{ Component::KindService, QLatin1String("service") }, { Component::KindService, QLatin1String("service") },
{ Component::KindRepository, QLatin1String("repository") }, { Component::KindRepository, QLatin1String("repository") },
{ Component::KindOperatingSystem, QLatin1String("operating-system") }, { Component::KindOperatingSystem, QLatin1String("operating-system") },
{ Component::KindIconTheme, QLatin1String("icon-theme") },
{ Component::KindUnknown, QLatin1String("unknown") } { Component::KindUnknown, QLatin1String("unknown") }
} }
)); ));
...@@ -107,6 +108,9 @@ Component::Kind Component::stringToKind(const QString& kindString) { ...@@ -107,6 +108,9 @@ Component::Kind Component::stringToKind(const QString& kindString) {
if (kindString == QLatin1String("operating-system")) if (kindString == QLatin1String("operating-system"))
return KindOperatingSystem; return KindOperatingSystem;
if (kindString == QLatin1String("icon-theme"))
return KindIconTheme;
return KindUnknown; return KindUnknown;
} }
......
...@@ -65,7 +65,8 @@ Q_GADGET ...@@ -65,7 +65,8 @@ Q_GADGET
KindLocalization, KindLocalization,
KindService, KindService,
KindRepository, KindRepository,
KindOperatingSystem KindOperatingSystem,
KindIconTheme
}; };
Q_ENUM(Kind) Q_ENUM(Kind)
......
...@@ -179,6 +179,7 @@ as_component_kind_get_type (void) ...@@ -179,6 +179,7 @@ as_component_kind_get_type (void)
{AS_COMPONENT_KIND_SERVICE, "AS_COMPONENT_KIND_SERVICE", "service"}, {AS_COMPONENT_KIND_SERVICE, "AS_COMPONENT_KIND_SERVICE", "service"},
{AS_COMPONENT_KIND_REPOSITORY, "AS_COMPONENT_KIND_REPOSITORY", "repository"}, {AS_COMPONENT_KIND_REPOSITORY, "AS_COMPONENT_KIND_REPOSITORY", "repository"},
{AS_COMPONENT_KIND_OPERATING_SYSTEM, "AS_COMPONENT_KIND_OPERATING_SYSTEM", "operating-system"}, {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} {0, NULL, NULL}
}; };
GType as_component_type_type_id; GType as_component_type_type_id;
...@@ -227,6 +228,8 @@ as_component_kind_to_string (AsComponentKind kind) ...@@ -227,6 +228,8 @@ as_component_kind_to_string (AsComponentKind kind)
return "repository"; return "repository";
if (kind == AS_COMPONENT_KIND_OPERATING_SYSTEM) if (kind == AS_COMPONENT_KIND_OPERATING_SYSTEM)
return "operating-system"; return "operating-system";
if (kind == AS_COMPONENT_KIND_ICON_THEME)
return "icon-theme";
return "unknown"; return "unknown";
} }
...@@ -271,6 +274,8 @@ as_component_kind_from_string (const gchar *kind_str) ...@@ -271,6 +274,8 @@ as_component_kind_from_string (const gchar *kind_str)
return AS_COMPONENT_KIND_REPOSITORY; return AS_COMPONENT_KIND_REPOSITORY;
if (g_strcmp0 (kind_str, "operating-system") == 0) if (g_strcmp0 (kind_str, "operating-system") == 0)
return AS_COMPONENT_KIND_OPERATING_SYSTEM; return AS_COMPONENT_KIND_OPERATING_SYSTEM;
if (g_strcmp0 (kind_str, "icon-theme") == 0)
return AS_COMPONENT_KIND_ICON_THEME;
/* legacy */ /* legacy */
if (g_strcmp0 (kind_str, "desktop") == 0) if (g_strcmp0 (kind_str, "desktop") == 0)
......
...@@ -74,6 +74,7 @@ struct _AsComponentClass ...@@ -74,6 +74,7 @@ struct _AsComponentClass
* @AS_COMPONENT_KIND_SERVICE: A system service launched by the init system * @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_REPOSITORY: A remote software or data source
* @AS_COMPONENT_KIND_OPERATING_SYSTEM: A computer operating system * @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. * The type of an #AsComponent.
**/ **/
...@@ -93,6 +94,7 @@ typedef enum { ...@@ -93,6 +94,7 @@ typedef enum {
AS_COMPONENT_KIND_SERVICE, AS_COMPONENT_KIND_SERVICE,
AS_COMPONENT_KIND_REPOSITORY, AS_COMPONENT_KIND_REPOSITORY,
AS_COMPONENT_KIND_OPERATING_SYSTEM, AS_COMPONENT_KIND_OPERATING_SYSTEM,
AS_COMPONENT_KIND_ICON_THEME,
/*< private >*/ /*< private >*/
AS_COMPONENT_KIND_LAST AS_COMPONENT_KIND_LAST
} AsComponentKind; } AsComponentKind;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment