Commit 56eaca01 authored by Andy Hertzfeld's avatar Andy Hertzfeld

we use OAFIIDs as sidebar panel names as a fallback, so I added a little


         we use OAFIIDs as sidebar panel names as a fallback, so I added
	 a little code to clean them up for display.
parent 049ff8a9
2000-05-20 Andy Hertzfeld <andy@eazel.com>
After Maciej's checkin, I didn't kill oafd so I was getting OAFIIDs as sidebar panel labels.
We should never show the user OAFIIDs, even as a fallback, so I added a little code
to clean them up before displaying them.
* libnautilus-extensions/nautilus-view-identifier.c:
(nautilus_view_identifier_new_from_oaf_server_info):
2000-05-19 Andy Hertzfeld <andy@eazel.com>
* components/music/mpg123_handler.c: (parse_header_info),
......
......@@ -26,6 +26,7 @@
#include "nautilus-view-identifier.h"
#include "nautilus-glib-extensions.h"
#include "nautilus-string.h"
#include <glib.h>
#include <stdlib.h>
......@@ -76,13 +77,12 @@ get_lang_list (void)
NautilusViewIdentifier *
nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char *name_attribute)
{
const char *view_as_name;
const char *view_as_name;
GSList *langs;
langs = get_lang_list ();
view_as_name = oaf_server_info_attr_lookup (server, name_attribute, langs);
if (view_as_name == NULL) {
view_as_name = oaf_server_info_attr_lookup (server, "name", langs);
}
......@@ -93,6 +93,22 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char
g_slist_free (langs);
/* if the name is an OAFIID, clean it up for display */
if (nautilus_str_has_prefix (view_as_name, "OAFIID:")) {
char *display_name, *colon_ptr;
NautilusViewIdentifier *new_identifier;
display_name = g_strdup (view_as_name + 7);
colon_ptr = strchr (display_name, ':');
if (colon_ptr) {
*colon_ptr = '\0';
}
new_identifier = nautilus_view_identifier_new (server->iid, display_name);
g_free(display_name);
return new_identifier;
}
return nautilus_view_identifier_new (server->iid, view_as_name);
}
......
......@@ -26,6 +26,7 @@
#include "nautilus-view-identifier.h"
#include "nautilus-glib-extensions.h"
#include "nautilus-string.h"
#include <glib.h>
#include <stdlib.h>
......@@ -76,13 +77,12 @@ get_lang_list (void)
NautilusViewIdentifier *
nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char *name_attribute)
{
const char *view_as_name;
const char *view_as_name;
GSList *langs;
langs = get_lang_list ();
view_as_name = oaf_server_info_attr_lookup (server, name_attribute, langs);
if (view_as_name == NULL) {
view_as_name = oaf_server_info_attr_lookup (server, "name", langs);
}
......@@ -93,6 +93,22 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char
g_slist_free (langs);
/* if the name is an OAFIID, clean it up for display */
if (nautilus_str_has_prefix (view_as_name, "OAFIID:")) {
char *display_name, *colon_ptr;
NautilusViewIdentifier *new_identifier;
display_name = g_strdup (view_as_name + 7);
colon_ptr = strchr (display_name, ':');
if (colon_ptr) {
*colon_ptr = '\0';
}
new_identifier = nautilus_view_identifier_new (server->iid, display_name);
g_free(display_name);
return new_identifier;
}
return nautilus_view_identifier_new (server->iid, view_as_name);
}
......
Markdown is supported
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