*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:
}
GdkPixbuf *LauncherItem::getIcon(int icon_size) const {
+ if (ourTheme == NULL) {
+ ourTheme = gtk_icon_theme_get_default();
+ }
+
GdkPixbuf *pixbuf = NULL;
+ GError *error = NULL;
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);
private:
std::string translateString(const std::string& what) const;
- bool checkSanity(void) { return !(myName.empty() || myIcon.empty() || myService.empty()); }
+ bool checkSanity(void) { return !(myName.empty() || myService.empty()); }
private:
std::string myFileName, myName, myComment, myIcon, myService, myTextDomain;