diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2010-05-25 01:23:42 +0200 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2010-05-25 01:23:42 +0200 |
commit | 38aea51b22d1e63b778c0e0cc654edb71b828c4a (patch) | |
tree | 822996b7f584e03640b35c9b61e52ddf2b975f30 /src/redshift.c | |
parent | Update POTFILES and po files (diff) | |
download | redshift-ng-38aea51b22d1e63b778c0e0cc654edb71b828c4a.tar.gz redshift-ng-38aea51b22d1e63b778c0e0cc654edb71b828c4a.tar.bz2 redshift-ng-38aea51b22d1e63b778c0e0cc654edb71b828c4a.tar.xz |
Add location provider that reads location from the gconf key associated
with the GNOME Clock applet. The implementation is rather simplistic as
it only reads the location once on init but that'll have to do for now.
Diffstat (limited to 'src/redshift.c')
-rw-r--r-- | src/redshift.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/redshift.c b/src/redshift.c index f297c3a..b0c3e04 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -70,6 +70,10 @@ #include "location-manual.h" +#ifdef ENABLE_GNOME_CLOCK +# include "location-gnome-clock.h" +#endif + /* Union of state data for gamma adjustment methods */ typedef union { @@ -121,11 +125,23 @@ static const gamma_method_t gamma_methods[] = { /* Union of state data for location providers */ typedef union { location_manual_state_t manual; +#ifdef ENABLE_GNOME_CLOCK + location_gnome_clock_state_t gnome_clock; +#endif } location_state_t; /* Location provider method structs */ static const location_provider_t location_providers[] = { +#ifdef ENABLE_GNOME_CLOCK + { + "GNOME-Clock", + (location_provider_init_func *)location_gnome_clock_init, + (location_provider_free_func *)location_gnome_clock_free, + (location_provider_get_location_func *) + location_gnome_clock_get_location + }, +#endif { "Manual", (location_provider_init_func *)location_manual_init, @@ -361,7 +377,7 @@ main(int argc, char *argv[]) /* Try to parse provider name as float */ errno = 0; char *end; - float lat = strtof(optarg, &end); + float v = strtof(optarg, &end); if (errno == 0 && *end == ':') { provider_name = "Manual"; provider_args = optarg; |