+// This file is a part of Simple Launcher
+//
+// Copyright (C) 2006, Mikhail Sobolev
+//
+// Simple Launcher is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#include <string>
#include <glib/gmem.h>
#include <glib/gkeyfile.h>
-#include <gtk/gtkicontheme.h>
-
#include "launcher-item.h"
+GtkIconTheme *LauncherItem::ourTheme = 0;
+
static const char *DESKTOP_ENTRY_GROUP = "Desktop Entry",
*DESKTOP_ENTRY_TYPE_FIELD = "Type",
*DESKTOP_ENTRY_ICON_FIELD = "Icon",
std::string result;
if (tempo != 0) {
- result = tempo;
+ result.assign(tempo);
g_free(tempo);
}
std::string result;
if (tempo != 0) {
- result = tempo;
+ result.assign(tempo);
g_free(tempo);
}
GdkPixbuf *pixbuf = 0;
if (!myIcon.empty()) {
- GtkIconTheme *theme;
+ if (ourTheme == 0) {
+ ourTheme = gtk_icon_theme_get_default();
+ }
+
GError *error = 0;
- theme = gtk_icon_theme_get_default();
- pixbuf = gtk_icon_theme_load_icon(theme, myIcon.c_str(), icon_size, GTK_ICON_LOOKUP_NO_SVG, &error);
+ pixbuf = gtk_icon_theme_load_icon(ourTheme, myIcon.c_str(), icon_size, GTK_ICON_LOOKUP_NO_SVG, &error);
if (error != 0) {
g_error_free(error);
return pixbuf;
}
+
+bool LauncherItem::activate(osso_context_t *context) {
+ return osso_application_top(context, myService.c_str(), 0) == OSSO_OK;
+}
+
+// vim:ts=2:sw=2:et