started proper implementation of icon size selection: hackish and dirty at the moment
[simple-launcher] / simple-launcher.cc
index 5fe3aae..c3bfd8e 100644 (file)
@@ -27,7 +27,6 @@
 #include <libosso.h>
 
 #include "launcher-item.h"
-#include "sla-list.h"
 #include "launchable-item.h"
 #include "settings-dialog.h"
 #include "gconf-wrapper.h"
@@ -83,7 +82,6 @@ private:
   GConfBooleanOption myTransparent;
   // bool myShowInfobanner; // FIXME: to implement
   GConfIntegerOption myIconSize;
-  GConfIntegerOption myCanvasSize;
 
   static char *ourDirs[];
 };
@@ -137,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), myCanvasSize(base, "canvas_size", 1) {
+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) {
@@ -157,12 +155,13 @@ bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
 
 SimpleLauncherApplet::~SimpleLauncherApplet() {
   myItems.clear();
-
+#if 0
+  // This does not seem to be necessary
   if (myWidget != NULL) {
     gtk_widget_destroy(myWidget);
     myWidget = NULL;
   }
-
+#endif
   if (myContext != NULL) {
     osso_deinitialize(myContext);
     myContext = NULL;
@@ -204,7 +203,7 @@ void SimpleLauncherApplet::loadConfig() {
       addItem(myItems, buffer, (p != NULL && (*p == '1' || *p == 'y' || *p == 'Y')));
     }
 
-    delete buffer;
+    delete [] buffer;
   }
 }
 
@@ -276,7 +275,6 @@ void SimpleLauncherApplet::updateWidget() {
       g_signal_connect(button, "button-press-event", G_CALLBACK(_button_pressed), this);
 
       gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent.value());
-      gtk_container_set_border_width(GTK_CONTAINER(button), myCanvasSize.value());
 
       {
         GdkPixbuf *pixbuf = item->getIcon(myIconSize.value());
@@ -296,7 +294,7 @@ void SimpleLauncherApplet::updateWidget() {
 
   g_object_unref(G_OBJECT(group));
 
-  int totalSize = myIconSize.value()+2*myCanvasSize.value();
+  int totalSize = myIconSize.value();
 
   if (button_no == 0) {
     gtk_widget_set_size_request(myWidget, totalSize, totalSize);
@@ -355,7 +353,7 @@ void SimpleLauncherApplet::runDialog() {
   LauncherItems newItems = myItems;
 
   // TODO: make it nicer... this code is ugly :(
-  SettingsDialog dialog(myParent, newItems, myTransparent, myIconSize, myCanvasSize);
+  SettingsDialog dialog(myParent, newItems, myTransparent, myIconSize);
 
   switch (dialog.run()) {
     case GTK_RESPONSE_OK:
@@ -372,6 +370,8 @@ void SimpleLauncherApplet::runDialog() {
     default:
       ;     // FIXME: do I want to do anything in here?
   }
+
+  // newItems.clear(); // TODO: do I really need it?
 }
 
 // vim:ts=2:sw=2:et