projects
/
psensor-pkg-debian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'upstream/1.2.0'
[psensor-pkg-debian.git]
/
src
/
pxdg.c
diff --git
a/src/pxdg.c
b/src/pxdg.c
index
aa61e03
..
a43d075
100644
(file)
--- a/
src/pxdg.c
+++ b/
src/pxdg.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
4
jeanfi@gmail.com
+ * Copyright (C) 2010-201
6
jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-27,10
+27,11
@@
#include <pio.h>
#include <plog.h>
#include <pio.h>
#include <plog.h>
+#include <pxdg.h>
static const char *KEY_GNOME_AUTOSTART = "X-GNOME-Autostart-enabled";
static const char *KEY_GNOME_AUTOSTART = "X-GNOME-Autostart-enabled";
-static char *get_user_autostart_dir()
+static char *get_user_autostart_dir(
void
)
{
const char *xdg_cfg_dir;
{
const char *xdg_cfg_dir;
@@
-41,21
+42,21
@@
static char *get_user_autostart_dir()
return path_append(xdg_cfg_dir, "autostart");
}
return path_append(xdg_cfg_dir, "autostart");
}
-static char *get_user_desktop_file()
+static char *get_user_desktop_file(
void
)
{
char *dir, *path;
dir = get_user_autostart_dir();
{
char *dir, *path;
dir = get_user_autostart_dir();
- path = path_append(dir,
"psensor.desktop"
);
+ path = path_append(dir,
PSENSOR_DESKTOP_FILE
);
free(dir);
return path;
}
free(dir);
return path;
}
-static const char *get_desktop_file()
+static const char *get_desktop_file(
void
)
{
{
- return DATADIR"/applications/
psensor.desktop"
;
+ return DATADIR"/applications/
"PSENSOR_DESKTOP_FILE
;
}
static int is_file_exists(const char *path)
}
static int is_file_exists(const char *path)
@@
-77,14
+78,13
@@
static GKeyFile *get_key_file(const char *path)
| G_KEY_FILE_KEEP_TRANSLATIONS,
NULL);
| G_KEY_FILE_KEEP_TRANSLATIONS,
NULL);
- if (ret)
{
+ if (ret)
return kfile;
return kfile;
- } else {
- log_err("Failed to parse: %s", path);
- g_key_file_free(kfile);
- return NULL;
- }
+ log_err("Failed to parse: %s", path);
+
+ g_key_file_free(kfile);
+ return NULL;
}
static int is_user_desktop_autostarted(GKeyFile *f)
}
static int is_user_desktop_autostarted(GKeyFile *f)
@@
-99,7
+99,7
@@
static int is_user_desktop_autostarted(GKeyFile *f)
NULL);
}
NULL);
}
-int pxdg_is_autostarted()
+int pxdg_is_autostarted(
void
)
{
char *user_desktop;
unsigned int ret;
{
char *user_desktop;
unsigned int ret;
@@
-180,7
+180,8
@@
void pxdg_set_autostart(unsigned int enable)
enable_gnome_autostart(user_desktop);
} else {
/* because X-GNOME-Autostart-enabled does not turn off
enable_gnome_autostart(user_desktop);
} else {
/* because X-GNOME-Autostart-enabled does not turn off
- * autostart on all Desktop Envs. */
+ * autostart on all Desktop Envs.
+ */
remove(user_desktop);
}
remove(user_desktop);
}