diff options
author | 2011-02-04 20:05:20 +0000 | |
---|---|---|
committer | 2011-02-04 20:05:20 +0000 | |
commit | 44d802e9a32aa951bf532bc546293a26232e9d4c (patch) | |
tree | 54c0faf07e9edb338ca2fe810db1db8cb657a0a8 /src | |
parent | 4830642eba6b6dc741ee140088ee7e4be69ca8e8 (diff) |
dont hardcore svgiconsdir in makefile, add missing gconf configure.ac macro
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 48 | ||||
-rw-r--r-- | src/session-get.c | 6 | ||||
-rw-r--r-- | src/session-get.h | 2 | ||||
-rw-r--r-- | src/trg-status-bar.c | 7 |
4 files changed, 50 insertions, 13 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 501062b..c31c94d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,13 @@ +NULL = + +public_icons_themes = \ + hicolor \ + $(NULL) + +public_icons = \ + hicolor_apps_scalable_transmission-remote-gtk.svg \ + $(NULL) + EXTRA_DIST = transmission-remote-gtk.desktop.in CLEANFILES = transmission-remote-gtk.desktop @@ -7,9 +17,6 @@ desktop_DATA = transmission-remote-gtk.desktop schemadir = @GCONF_SCHEMA_FILE_DIR@ schema_DATA = transmission-remote-gtk.schemas -svgiconsdir = /usr/share/icons/hicolor/scalable/apps/ -svgicons_DATA = transmission-remote-gtk.svg - bin_PROGRAMS = transmission-remote-gtk INCLUDES = --pedantic -Wall -I.. -O2 $(jsonglib_CFLAGS) $(gthread_CFLAGS) $(gtk_CFLAGS) $(gconf_CFLAGS) $(gio_CFLAGS) $(unique_CFLAGS) $(notify_CFLAGS) @@ -24,8 +31,41 @@ transmission_remote_gtk_SOURCES = main.c requests.c base64.c json.c http.c dispa transmission_remote_gtk_LDFLAGS = -lcurl $(jsonglib_LIBS) $(gtk_LIBS) $(gthread_LIBS) $(GEOIP_LIBS) $(gconf_LIBS) $(gio_LIBS) $(unique_LIBS) $(notify_LIBS) -install-data-local: +install-data-local: install-icons update-icon-cache GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA) +gtk_update_icon_cache = gtk-update-icon-cache -f -t + +update-icon-cache: + @-if test -z "$(DESTDIR)"; then \ + echo "Updating Gtk icon cache."; \ + for theme in $(public_icons_themes); do \ + $(gtk_update_icon_cache) $(datadir)/icons/$$theme; \ + done; \ + else \ + echo "*** Icon cache not updated. After (un)install, run this:"; \ + for theme in $(public_icons_themes); do \ + echo "*** $(gtk_update_icon_cache) $(datadir)/icons/$$theme"; \ + done; \ + fi + +install-icons: + for icon in $(public_icons); do \ + THEME=`echo $$icon | cut -d_ -f1`; \ + CONTEXT=`echo $$icon | cut -d_ -f2`; \ + SIZE=`echo $$icon | cut -d_ -f3`; \ + ICONFILE=`echo $$icon | cut -d_ -f4`; \ + mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \ + $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \ + done; \ + for icon in $(private_icons); do \ + THEME=`echo $$icon | cut -d_ -f1`; \ + CONTEXT=`echo $$icon | cut -d_ -f2`; \ + SIZE=`echo $$icon | cut -d_ -f3`; \ + ICONFILE=`echo $$icon | cut -d_ -f4`; \ + mkdir -p $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \ + $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \ + done + transmission-remote-gtk.desktop: transmission-remote-gtk.desktop.in sed -e 's,@bindir\@,$(bindir),g' $< > $@ diff --git a/src/session-get.c b/src/session-get.c index f1e5d46..8ee4ab7 100644 --- a/src/session-get.c +++ b/src/session-get.c @@ -24,10 +24,10 @@ #include "protocol-constants.h" #include "session-get.h" -int session_get_version(JsonObject * s, float *version, int *revision) +int session_get_version(JsonObject * s, float *version) { - return sscanf(json_object_get_string_member(s, SGET_VERSION), - "%f (%d)", version, revision); + const gchar *versionStr = json_object_get_string_member(s, SGET_VERSION); + return sscanf(versionStr, "%f", version); } gboolean session_get_pex_enabled(JsonObject * s) diff --git a/src/session-get.h b/src/session-get.h index 71f2a52..bbd31f2 100644 --- a/src/session-get.h +++ b/src/session-get.h @@ -62,7 +62,7 @@ const gchar *session_get_torrent_done_filename(JsonObject * s); gboolean session_get_torrent_done_enabled(JsonObject * s); gint64 session_get_cache_size_mb(JsonObject * s); -int session_get_version(JsonObject * s, float *version, int *revision); +int session_get_version(JsonObject * s, float *version); gboolean session_get_pex_enabled(JsonObject * s); gboolean session_get_lpd_enabled(JsonObject * s); const gchar *session_get_download_dir(JsonObject * s); diff --git a/src/trg-status-bar.c b/src/trg-status-bar.c index d980bac..d6e4cab 100644 --- a/src/trg-status-bar.c +++ b/src/trg-status-bar.c @@ -68,13 +68,10 @@ void trg_status_bar_connect(TrgStatusBar * sb, JsonObject * session) { gchar *statusMsg; float version; - int revision; - session_get_version(session, &version, &revision); + session_get_version(session, &version); statusMsg = - g_strdup_printf - ("Connected to Transmission %g (r%d), getting torrents...", - version, revision); + g_strdup_printf("Connected to Transmission %g, getting torrents...", version); g_printf("%s\n", statusMsg); trg_status_bar_push_connection_msg(sb, statusMsg); g_free(statusMsg); |