Opened 5 years ago

Last modified 5 years ago

#15348 new patch

Share account picture between different OSes

Reported by: renatosilva Owned by:
Milestone: Patches Needing Improvement Component: libpurple
Version: 2.10.6 Keywords:
Cc:

Description (last modified by renatosilva)

This simple patch allows one to share their account picture between operating systems with different path rules, such as Windows and Unixes. This is because when you save your account picture, Pidgin stores its full absolute path, so for example Windows does not recognize /home/user/me.png and Linux does not recognize C:/Users/User/Pictures/Me.png. Also, g_file_get_contents seems to only deal with absolute paths.

After patching, Pidgin will search for the path indicated by buddyicon configuration also within purple profile, in case loading as is fails, allowing users to set this option with paths relative to purple profile. Even if the operating system does not support forward slashes, users can still store picture in profile's root. It is needed to edit prefs.xml manually to remove absolute part from path, but I think this patch is reasonable already.

Attachments (1)

RelativeBuddyIcon.patch (738 bytes) - added by renatosilva 5 years ago.
Load account icon from config dir for relative paths (memory leak fixed)

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by renatosilva

  • Description modified (diff)

comment:2 Changed 5 years ago by renatosilva

  • Description modified (diff)

comment:3 Changed 5 years ago by renatosilva

  • Description modified (diff)

comment:4 Changed 5 years ago by datallah

  • Milestone set to Patches Needing Improvement

Conceptually, it would be nice to be able to share your .purple directory between several machines, but this solution is something totally non-discoverable and won't be useful to anyone except the very few that look at to code and then mess with prefs.xml manually.

It'd be better to make the action of setting the profile picture save the image that's selected in the buddy icon cache and to reference the path there instead of an arbitrary location on disk.

Forward slashes aren't a problem.

comment:5 Changed 5 years ago by datallah

The attach patch also leaks the prof variable.

Version 0, edited 5 years ago by datallah (next)

Changed 5 years ago by renatosilva

Load account icon from config dir for relative paths (memory leak fixed)

comment:6 Changed 5 years ago by renatosilva

I would save in some non-cache area instead, since account icon is permanent data. CCleaner for example cleans icon cache. I found this worth a look because it doesn't hurt, and the account icon path was the only problem I remember facing when sharing my .purple between Windows and Linux. Also, if one cares to go into hidden OS profile folders and make symlinks to share Pidgin config, then I thought editing prefs.xml to fix a path problem wouldn't be anything much.

comment:7 Changed 5 years ago by renatosilva

Either way, does this debug entry mean it is already trying to put selected picture in cache? It shows when I open the account list:

gtkutils: gdk_pixbuf_new_from_file() returned nothing for file buddyicon.png: Falha ao abrir o arquivo "buddyicon.png": No such file or directory

Last edited 5 years ago by renatosilva (previous) (diff)
Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!