Implement tilde replacing in icon names
This commit is contained in:
parent
a0f21f5c26
commit
42cc561569
@ -8,6 +8,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "notification.h"
|
#include "notification.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
static bool is_readable_file(const char *filename)
|
static bool is_readable_file(const char *filename)
|
||||||
{
|
{
|
||||||
@ -60,14 +61,18 @@ cairo_surface_t *gdk_pixbuf_to_cairo_surface(GdkPixbuf *pixbuf)
|
|||||||
static GdkPixbuf *get_pixbuf_from_file(const char *filename)
|
static GdkPixbuf *get_pixbuf_from_file(const char *filename)
|
||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf = NULL;
|
GdkPixbuf *pixbuf = NULL;
|
||||||
if (is_readable_file(filename)) {
|
char *path = string_to_path(g_strdup(filename));
|
||||||
|
|
||||||
|
if (is_readable_file(path)) {
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
pixbuf = gdk_pixbuf_new_from_file(filename, &error);
|
pixbuf = gdk_pixbuf_new_from_file(path, &error);
|
||||||
if (!pixbuf) {
|
if (!pixbuf) {
|
||||||
LOG_W("%s", error->message);
|
LOG_W("%s", error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free(path);
|
||||||
return pixbuf;
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user