summaryrefslogtreecommitdiff
path: root/capplets/default-applications/mate-da-xml.c
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-12-06 08:42:47 -0300
committerPerberos <[email protected]>2011-12-06 08:42:47 -0300
commit0e3c4a26638e0685da1c9ad21546ad5c962d3e5c (patch)
treefb2b342afd326c038426892e24fe65fac960d09a /capplets/default-applications/mate-da-xml.c
parent06d81df2871a25a93cdf7cffaf87f5cd4f15fe84 (diff)
downloadmate-control-center-0e3c4a26638e0685da1c9ad21546ad5c962d3e5c.tar.bz2
mate-control-center-0e3c4a26638e0685da1c9ad21546ad5c962d3e5c.tar.xz
adding support for video players
Diffstat (limited to 'capplets/default-applications/mate-da-xml.c')
-rw-r--r--capplets/default-applications/mate-da-xml.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/capplets/default-applications/mate-da-xml.c b/capplets/default-applications/mate-da-xml.c
index eba290db..46b31789 100644
--- a/capplets/default-applications/mate-da-xml.c
+++ b/capplets/default-applications/mate-da-xml.c
@@ -148,6 +148,7 @@ static void mate_da_xml_load_xml(MateDACapplet* capplet, const gchar* filename)
MateDAImageItem* image_item;
MateDATextItem* text_item;
MateDAFileItem* file_item;
+ MateDASimpleItem* video_item;
xml_doc = xmlParseFile(filename);
@@ -278,6 +279,34 @@ static void mate_da_xml_load_xml(MateDACapplet* capplet, const gchar* filename)
}
}
}
+ else if (!xmlStrncmp(section->name, (const xmlChar*) "video-players", strlen("video-players")))
+ {
+ for (element = section->children; element != NULL; element = element->next)
+ {
+ if (!xmlStrncmp (element->name, (const xmlChar*) "video-player", strlen("video-player")))
+ {
+ executable = mate_da_xml_get_string(element, "executable");
+
+ if (is_executable_valid(executable))
+ {
+ video_item = mate_da_simple_item_new();
+
+ video_item->generic.name = mate_da_xml_get_string (element, "name");
+ video_item->generic.executable = executable;
+ video_item->generic.command = mate_da_xml_get_string (element, "command");
+ video_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name");
+
+ video_item->run_in_terminal = mate_da_xml_get_bool (element, "run-in-terminal");
+
+ capplet->video_players = g_list_append (capplet->video_players, video_item);
+ }
+ else
+ {
+ g_free(executable);
+ }
+ }
+ }
+ }
else if (!xmlStrncmp(section->name, (const xmlChar*) "image-viewers", strlen("image-viewers")))
{
for (element = section->children; element != NULL; element = element->next)
@@ -454,6 +483,7 @@ void mate_da_xml_free(MateDACapplet* capplet)
g_list_foreach(capplet->mail_readers, (GFunc) mate_da_simple_item_free, NULL);
g_list_foreach(capplet->terminals, (GFunc) mate_da_term_item_free, NULL);
g_list_foreach(capplet->media_players, (GFunc) mate_da_simple_item_free, NULL);
+ g_list_foreach(capplet->video_players, (GFunc) mate_da_simple_item_free, NULL);
g_list_foreach(capplet->visual_ats, (GFunc) mate_da_visual_item_free, NULL);
g_list_foreach(capplet->mobility_ats, (GFunc) mate_da_mobility_item_free, NULL);
g_list_foreach(capplet->image_viewers, (GFunc) mate_da_image_item_free, NULL);
@@ -464,6 +494,7 @@ void mate_da_xml_free(MateDACapplet* capplet)
g_list_free(capplet->mail_readers);
g_list_free(capplet->terminals);
g_list_free(capplet->media_players);
+ g_list_free(capplet->video_players);
g_list_free(capplet->visual_ats);
g_list_free(capplet->mobility_ats);
g_list_free(capplet->image_viewers);