projects
/
simple-launcher
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
show default app icon if the icon is not specified or is not available
[simple-launcher]
/
launcher-item.cc
diff --git
a/launcher-item.cc
b/launcher-item.cc
index
36653d8
..
67e984d
100644
(file)
--- a/
launcher-item.cc
+++ b/
launcher-item.cc
@@
-35,6
+35,7
@@
static const char *DESKTOP_ENTRY_GROUP = "Desktop Entry",
*DESKTOP_ENTRY_TEXT_DOMAIN = "X-Text-Domain";
static const char *DEFAULT_TEXT_DOMAIN = "maemo-af-desktop";
*DESKTOP_ENTRY_TEXT_DOMAIN = "X-Text-Domain";
static const char *DEFAULT_TEXT_DOMAIN = "maemo-af-desktop";
+static const char *DEFAULT_APP_ICON = "qgn_list_gene_default_app";
class GKeyFileWrapper {
public:
class GKeyFileWrapper {
public:
@@
-130,16
+131,24
@@
bool LauncherItem::load(const std::string& filename) {
}
GdkPixbuf *LauncherItem::getIcon(int icon_size) const {
}
GdkPixbuf *LauncherItem::getIcon(int icon_size) const {
+ if (ourTheme == NULL) {
+ ourTheme = gtk_icon_theme_get_default();
+ }
+
GdkPixbuf *pixbuf = NULL;
GdkPixbuf *pixbuf = NULL;
+ GError *error = NULL;
if (!myIcon.empty()) {
if (!myIcon.empty()) {
- if (ourTheme == NULL) {
- ourTheme = gtk_icon_theme_get_default();
- }
+ pixbuf = gtk_icon_theme_load_icon(ourTheme, myIcon.c_str(), icon_size, GTK_ICON_LOOKUP_NO_SVG, &error);
- GError *error = NULL;
+ if (error != NULL) {
+ g_error_free(error);
+ error = NULL;
+ }
+ }
- pixbuf = gtk_icon_theme_load_icon(ourTheme, myIcon.c_str(), icon_size, GTK_ICON_LOOKUP_NO_SVG, &error);
+ if (pixbuf == NULL) {
+ pixbuf = gtk_icon_theme_load_icon(ourTheme, DEFAULT_APP_ICON, icon_size, GTK_ICON_LOOKUP_NO_SVG, &error);
if (error != NULL) {
g_error_free(error);
if (error != NULL) {
g_error_free(error);