pidgin: 5816559a: When drag-dropping an image into an IM w...
markdoliner at pidgin.im
markdoliner at pidgin.im
Tue Jan 25 04:45:47 EST 2011
----------------------------------------------------------------------
Revision: 5816559a7aa9ddd207f0e03af30d0b98aaf42722
Parent: 01d3d4fd1f666b31fd5c395efab40489c9505bbb
Author: markdoliner at pidgin.im
Date: 01/25/11 04:39:59
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5816559a7aa9ddd207f0e03af30d0b98aaf42722
Changelog:
When drag-dropping an image into an IM window and sending as an inline
image in a direct IM, strip the full path from the filename and just use
the basename.ext. Fixes #13098
Changes against parent 01d3d4fd1f666b31fd5c395efab40489c9505bbb
patched pidgin/gtkutils.c
-------------- next part --------------
============================================================
--- pidgin/gtkutils.c 5537edee3cffeb641b749752fefd6c80a4ef183a
+++ pidgin/gtkutils.c 3d48035ca58340b923f096ad44fb81b973ba10a7
@@ -1463,6 +1463,7 @@ static void dnd_image_ok_callback(_DndDa
static void dnd_image_ok_callback(_DndData *data, int choice)
{
+ const gchar *shortname;
gchar *filedata;
size_t size;
struct stat st;
@@ -1517,7 +1518,9 @@ static void dnd_image_ok_callback(_DndDa
break;
}
- id = purple_imgstore_add_with_id(filedata, size, data->filename);
+ shortname = strrchr(data->filename, G_DIR_SEPARATOR);
+ shortname = shortname ? shortname + 1 : data->filename;
+ id = purple_imgstore_add_with_id(filedata, size, shortname);
gtk_text_buffer_get_iter_at_mark(GTK_IMHTML(gtkconv->entry)->text_buffer, &iter,
gtk_text_buffer_get_insert(GTK_IMHTML(gtkconv->entry)->text_buffer));
More information about the Commits
mailing list