Enlightenment CVS committal
Author : lordchaos
Project : e17
Module : proto
Dir : e17/proto/entropy/src
Modified Files:
entropy_core.c
Log Message:
* MIME-Action association saving is now in the UI and it saves on exit. It is
very cumbersome right now, but it works, and at least you can bind an action to
a type without having to edit source.
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_core.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- entropy_core.c 26 Nov 2005 11:50:41 -0000 1.26
+++ entropy_core.c 26 Nov 2005 23:53:08 -0000 1.27
@@ -286,7 +286,7 @@
Ecore_List* mime_type_actions;
char* key;
int i=0;
- char type[50];
+ char type[100];
char* pos;
entropy_mime_action* action;
@@ -308,7 +308,7 @@
new_count = ecore_list_nodes(mime_type_actions);
- if ( (!(count = entropy_config_int_get("core","mime_type_count"))) ||
count < new_count || 1 ) {
+ if ( (!(count = entropy_config_int_get("core","mime_type_count"))) ||
count < new_count ) {
entropy_config_int_set("core", "mime_type_count", new_count);
@@ -336,7 +336,7 @@
key = entropy_config_str_get("core", type);
pos = strrchr(key, ':');
-
+ printf("Key is: '%s'\n", key);
if (pos >= 0) {
*pos = '\0';
@@ -359,6 +359,43 @@
}
+void entropy_core_config_save() {
+ Ecore_List* keys;
+ int count;
+ char key[100];
+ char executable[256];
+ entropy_mime_action* action;
+ char* gkey;
+ int i=0;
+
+
+
+ /*Save the mime_action config*/
+ keys = ecore_hash_keys(core_core->mime_action_hint);
+ count = ecore_list_nodes(keys);
+
+ /*Set the count of mime_types*/
+ entropy_config_int_set("core","mime_type_count", count);
+
+ /*Write the types*/
+ while ( (gkey = ecore_list_remove_first(keys)) ) {
+ snprintf(key, 100, "mimetype_action.%d", i);
+
+ snprintf(executable,256,"%s:%s", gkey,
+
((entropy_mime_action*)ecore_hash_get(core_core->mime_action_hint,
gkey))->executable);
+
+ printf("Saving '%s' for '%s' using '%s'\n",
+
((entropy_mime_action*)ecore_hash_get(core_core->mime_action_hint,
gkey))->executable, gkey, key);
+
+ entropy_config_str_set("core", key, executable);
+
+ i++;
+ }
+
+
+
+}
+
entropy_mime_action* entropy_core_mime_hint_get(char* mime_type) {
return ecore_hash_get(core_core->mime_action_hint, mime_type);
}
@@ -371,7 +408,7 @@
char* key;
//printf("Destroying config subsystem...\n");
- entropy_config_destroy(core->config);
+
/*Destroy the notification engines*/
entropy_notification_engine_destroy(core->notify);
@@ -418,6 +455,12 @@
/*Destroy the plugins*/
/*Destroy the eLists/eHashes*/
+
+ /*Save the config*/
+ entropy_core_config_save();
+
+ entropy_config_destroy(core->config);
+
}
void entropy_layout_run(entropy_core* core) {
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs