LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Tags used in this thread
Popular LQ Tags , , , ,

Reply
 
Thread Tools
Old 06-02-2009, 10:26 AM   #1
herculoid
LQ Newbie
 
Registered: Jun 2009
Location: Tucker, GA
Distribution: ?
Posts: 1
Thanked: 0
Smile hey guys - theme change keeps same gnome default folder icon


[Log in to get rid of this advertisement]
There is a bug in ubuntu where if you switch to certain things the default folder icon pulls the old gnome folder icon. There is a patch for this problem here:

diff -ru nautilus-2.24.0-orig/libnautilus-private/nautilus-file.c
nautilus-2.24.0/libnautilus-private/nautilus-file.c
--- nautilus-2.24.0-orig/libnautilus-private/nautilus-file.c 2008-09-22
00:02:14.000000000 +0200
+++ nautilus-2.24.0/libnautilus-private/nautilus-file.c 2009-01-10
15:58:23.000000000 +0100
@@ -3410,16 +3410,23 @@
return FALSE;
}

+static void
+prepend_icon_name (const char *name,
+ GThemedIcon *icon)
+{
+ g_themed_icon_prepend_name(icon, name);
+}
+
GIcon *
nautilus_file_get_gicon (NautilusFile *file,
NautilusFileIconFlags flags)
{
const char * const * names;
const char *name;
- GPtrArray *array;
+ GPtrArray *prepend_array;
GIcon *icon;
int i;
- gboolean changed;
+ gboolean is_folder = FALSE, is_preview = FALSE, is_inode_directory = FALSE;

if (file == NULL) {
return NULL;
@@ -3435,41 +3442,54 @@
nautilus_file_has_open_window (file))) &&
G_IS_THEMED_ICON (file->details->icon)) {
names = g_themed_icon_get_names (G_THEMED_ICON (file->details->icon));
- array = g_ptr_array_new ();
-
- changed = TRUE;
+ prepend_array = g_ptr_array_new ();
+
for (i = 0; names[i] != NULL; i++) {
name = names[i];

- if (strcmp (name, "folder") == 0 &&
- (flags & NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING) == 0 &&
- nautilus_file_has_open_window (file)) {
- changed = TRUE;
- g_ptr_array_add (array, "folder-visiting");
- }
- if (strcmp (name, "folder") == 0 &&
- (flags & NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT)) {
- changed = TRUE;
- g_ptr_array_add (array, "folder-drag-accept");
+ if (strcmp (name, "folder") == 0) {
+ is_folder = TRUE;
}
- if (strcmp (name, "folder") == 0 &&
- (flags & NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER)) {
- changed = TRUE;
- g_ptr_array_add (array, "folder-open");
+ if (strcmp (name, "inode-directory") == 0) {
+ is_inode_directory = TRUE;
}
if (strcmp (name, "text-x-generic") == 0 &&
(flags & NAUTILUS_FILE_ICON_FLAGS_EMBEDDING_TEXT)) {
- changed = TRUE;
- g_ptr_array_add (array, "text-x-preview");
+ is_preview = TRUE;
}
- g_ptr_array_add (array, (char *)name);
}

- if (changed) {
- icon = g_themed_icon_new_from_names ((char **)array->pdata, array->len);
+ /* Here, we add icons in reverse order of precedence,
+ * because they are later prepended */
+ if (is_preview) {
+ g_ptr_array_add (prepend_array, "text-x-preview");
}

- g_ptr_array_free (array, TRUE);
+ /* "folder" should override "inode-directory", not the other way around */
+ if (is_inode_directory) {
+ g_ptr_array_add (prepend_array, "folder");
+ }
+ if (is_folder && (flags & NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER)) {
+ g_ptr_array_add (prepend_array, "folder-open");
+ }
+ if (is_folder &&
+ (flags & NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING) == 0 &&
+ nautilus_file_has_open_window (file)) {
+ g_ptr_array_add (prepend_array, "folder-visiting");
+ }
+ if (is_folder &&
+ (flags & NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT)) {
+ g_ptr_array_add (prepend_array, "folder-drag-accept");
+ }
+
+ if (prepend_array->len) {
+ /* When constructing GThemed Icon, pointers from the array
+ * are reused, but not the array itself, so the cast is safe */
+ icon = g_themed_icon_new_from_names ((char**) names, -1);
+ g_ptr_array_foreach (prepend_array, (GFunc) prepend_icon_name, icon);
+ }
+
+ g_ptr_array_free (prepend_array, TRUE);
}

if (icon == NULL) {


It requires making changes in Nautilus, but I have no idea how to get into nautilus which file to perform the change on, etc. I need basic step by step instructions on how to perform a bug fix, please.

I would appreciate any help I can get. Thanks as I will probably be performing similar tasks in the future.

Last edited by herculoid; 06-02-2009 at 12:49 PM..
herculoid is offline  
Tag This Post , , , ,
Reply With Quote
Old 06-03-2009, 02:50 AM   #2
rikxik
Member
 
Registered: Dec 2007
Posts: 66
Thanked: 3
The name is given at the top of the patch itself - (libnautilus-private/nautilus-file.c). This is not a simple edit and restart job. You will have to download nautilus source, apply the batch, compile and install. You may want to do some googling on compilation basics before you undertake this.
rikxik is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default folder icons not changing with icon theme tw001_tw Ubuntu 1 03-08-2009 11:08 PM
How to change default icon size in GNOME? Mateo1041 Linux - Newbie 6 08-14-2008 09:31 AM
Can't Change Icon Theme in GNOME with XGL... sancho Fedora 4 04-25-2007 12:13 PM
setting a default icon theme (gnome+fluxbox) hungrigerhaifisch Linux - Software 7 09-12-2005 06:39 PM
Default folder icon on Gnome mrozkan Linux - General 0 07-14-2003 11:09 AM


All times are GMT -5. The time now is 01:49 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration