}
}
-// 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];
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) {
}
bool SimpleLauncherApplet::initWidget() {
- myWidget = gtk_hbox_new(false, 0);
+ myWidget = gtk_hbox_new(false, 2);
if (myWidget != NULL) {
updateWidget();