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, ( {
{ 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;
}
......
......@@ -65,7 +65,8 @@ Q_GADGET
KindLocalization,
KindService,
KindRepository,
KindOperatingSystem
KindOperatingSystem,
KindIconTheme
};
Q_ENUM(Kind)
......
......@@ -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)
......
......@@ -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;
......
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