#include <gtk/gtk.h>
-#include <hildon-home-plugin/hildon-home-plugin-interface.h>
#include <libosso.h>
#include "launcher-item.h"
bool doInit(void *state_data, int *state_size);
- void background() {}
- void foreground() {}
int saveState(void **state_data, int *state_size);
GtkWidget *settings(GtkWindow *parent);
delete applet;
}
-void hildon_home_applet_lib_background(void *applet_data) {
- ((SimpleLauncherApplet *)applet_data)->background();
-}
-
-void hildon_home_applet_lib_foreground (void *applet_data) {
- ((SimpleLauncherApplet *)applet_data)->foreground();
-}
-
GtkWidget *hildon_home_applet_lib_settings(void *applet_data, GtkWindow *parent) {
return ((SimpleLauncherApplet *)applet_data)->settings(parent);
}
};
// SimpleLauncherApplet::SimpleLauncherApplet() : myMainSettings(myClient.getKey(SL_APPLET_GCONF_PATH)), myContext(NULL), myWidget(NULL), myParent(NULL) {
-SimpleLauncherApplet::SimpleLauncherApplet(const GConfKey& base) : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(base, "transparent", true), myIconSize(base, "icon_size", 48) {
+SimpleLauncherApplet::SimpleLauncherApplet(const GConfKey& base) : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(base, "transparent", false), myIconSize(base, "icon_size", 48) {
}
bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
}
}
-// FIXME: this probably should be done somehow differently
-static char *configFileName="/home/user/.slarc";
+// {{{ Configuration file managment
+static const gchar *getConfigFileName() {
+ static gchar *configFileName = NULL;
+
+ if (configFileName == NULL) {
+ configFileName = g_build_filename(g_get_home_dir(), ".slarc", NULL);
+ }
+
+ return configFileName;
+}
void SimpleLauncherApplet::loadConfig() {
- std::ifstream config(configFileName);
+ std::ifstream config(getConfigFileName());
if (config) {
char *buffer = new char [1024];
void SimpleLauncherApplet::saveConfig() {
// TODO: make saving config an atomic operation
- std::ofstream config(configFileName);
+ std::ofstream config(getConfigFileName());
if (config) {
for (size_t i = 0 ; i < myItems.size() ; ++i) {
}
}
+// }}}
+
void SimpleLauncherApplet::updateItems(LauncherItems& items) {
for (int i = 0 ; ourDirs[i] != NULL ; ++i) {
processDirectory(items, ourDirs[i]);
; // FIXME: do I want to do anything in here?
}
- newItems.clear();
+ // newItems.clear(); // TODO: do I really need it?
}
// vim:ts=2:sw=2:et