mirror of https://github.com/GNOME/gimp.git
app: port gimp_imagefile_get_description() from URI to GFile
This commit is contained in:
parent
98ae4b1f2c
commit
25f190d309
|
@ -47,7 +47,6 @@
|
||||||
#include "gimpprogress.h"
|
#include "gimpprogress.h"
|
||||||
|
|
||||||
#include "file/file-open.h"
|
#include "file/file-open.h"
|
||||||
#include "file/file-utils.h"
|
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
@ -660,29 +659,24 @@ gimp_imagefile_get_description (GimpViewable *viewable,
|
||||||
GimpThumbnail *thumbnail = private->thumbnail;
|
GimpThumbnail *thumbnail = private->thumbnail;
|
||||||
gchar *basename;
|
gchar *basename;
|
||||||
|
|
||||||
if (! thumbnail->image_uri)
|
if (! private->file)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (tooltip)
|
if (tooltip)
|
||||||
{
|
{
|
||||||
gchar *filename;
|
const gchar *name;
|
||||||
const gchar *desc;
|
const gchar *desc;
|
||||||
|
|
||||||
filename = file_utils_uri_display_name (thumbnail->image_uri);
|
name = gimp_file_get_utf8_name (private->file);
|
||||||
desc = gimp_imagefile_get_desc_string (imagefile);
|
desc = gimp_imagefile_get_desc_string (imagefile);
|
||||||
|
|
||||||
if (desc)
|
if (desc)
|
||||||
{
|
*tooltip = g_strdup_printf ("%s\n%s", name, desc);
|
||||||
*tooltip = g_strdup_printf ("%s\n%s", filename, desc);
|
|
||||||
g_free (filename);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
*tooltip = g_strdup (name);
|
||||||
*tooltip = filename;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
basename = file_utils_uri_display_basename (thumbnail->image_uri);
|
basename = g_path_get_basename (gimp_file_get_utf8_name (private->file));
|
||||||
|
|
||||||
if (thumbnail->image_width > 0 && thumbnail->image_height > 0)
|
if (thumbnail->image_width > 0 && thumbnail->image_height > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue