X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=simple-launcher.cc;h=1b35150257c9779fff2cc781137b429a61224211;hb=refs%2Fheads%2Fsvn%2Ftags%2F0.9.5;hp=a609f4c677de7227dc4b6361afba8c46130781d2;hpb=d9a39805e57a5916a98b185e49040eb1b560c28e;p=simple-launcher diff --git a/simple-launcher.cc b/simple-launcher.cc index a609f4c..1b35150 100644 --- a/simple-launcher.cc +++ b/simple-launcher.cc @@ -135,7 +135,7 @@ char *SimpleLauncherApplet::ourDirs[] = { }; // 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", true), myIconSize(base, "icon_size", 26) { } bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) { @@ -184,11 +184,18 @@ void SimpleLauncherApplet::addItem(LauncherItems& items, const std::string& name } } -// FIXME: this probably should be done somehow differently -static char *configFileName="/home/user/.slarc"; +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]; @@ -209,7 +216,7 @@ void SimpleLauncherApplet::loadConfig() { 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) { @@ -249,7 +256,7 @@ void SimpleLauncherApplet::processDirectory(LauncherItems& items, const std::str } bool SimpleLauncherApplet::initWidget() { - myWidget = gtk_hbox_new(false, 0); + myWidget = gtk_hbox_new(false, 2); if (myWidget != NULL) { updateWidget(); @@ -371,7 +378,7 @@ void SimpleLauncherApplet::runDialog() { ; // 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