From f47ebabd80b11e962e39872d87b8e1e03caa82bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Canek=20Pel=C3=A1ez=20Vald=C3=A9s?= Date: Mon, 10 Apr 2017 20:20:27 -0500 Subject: [PATCH] Update documentation. --- Makefile.am | 2 ++ src/application-window.vala | 14 +++++++++----- src/photograph.vala | 19 ++++++++++--------- src/tag.vala | 2 +- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6ce231a..40a3250 100644 --- a/Makefile.am +++ b/Makefile.am @@ -109,6 +109,8 @@ doc/gqpe/index.htm: $(GQPESOURCES) --target-glib=2.38 \ --vapidir=vapi \ --verbose \ + @CHAMPLAIN_PACKAGES@ \ + @CLUTTER_GTK_PACKAGES@ \ @GEE_PACKAGES@ \ @GEXIV2_PACKAGES@ \ @GTK_PACKAGES@ \ diff --git a/src/application-window.vala b/src/application-window.vala index 7ee2277..1f7ca0c 100644 --- a/src/application-window.vala +++ b/src/application-window.vala @@ -131,8 +131,9 @@ namespace GQPE { private Champlain.MarkerLayer layer; /* The marker. */ private Champlain.Label marker; - + /* Counter for the loader. */ private int counter; + /* Updating flag. */ private bool updating; /** @@ -520,14 +521,15 @@ namespace GQPE { /* Updates the map. */ private void update_map() { if (photograph.has_geolocation) { - update_location(photograph.latitude, photograph.longitude); + update_map_location(photograph.latitude, photograph.longitude); on_pin_map_clicked(); } marker.text = photograph.caption; } - private void update_location(double latitude, - double longitude) { + /* Updates the map location. */ + private void update_map_location(double latitude, + double longitude) { if (marker != null) { layer.remove_marker(marker); marker = null; @@ -538,6 +540,7 @@ namespace GQPE { this.longitude.value = longitude; } + /* Creates a new marker. */ private Champlain.Label create_marker(double latitude, double longitude) { string photo_caption = (photograph != null && @@ -556,12 +559,13 @@ namespace GQPE { return marker; } + /* Map button release callback. */ private bool map_button_release(Clutter.ButtonEvent event) { double latitude = view.y_to_latitude(event.y); double longitude = view.x_to_longitude(event.x); if (event.button == 1) { - update_location(latitude, longitude); + update_map_location(latitude, longitude); photograph.latitude = this.latitude.value; photograph.longitude = this.longitude.value; enable_ui(Item.PIN_MAP); diff --git a/src/photograph.vala b/src/photograph.vala index 1a488e4..94f6871 100644 --- a/src/photograph.vala +++ b/src/photograph.vala @@ -148,15 +148,6 @@ namespace GQPE { update_data(); } - private void update_data() { - album = (metadata.has_tag(Tag.SUBJECT)) ? - metadata.get_tag_string(Tag.SUBJECT).strip() : ""; - caption = (metadata.has_tag(Tag.CAPTION)) ? - metadata.get_tag_string(Tag.CAPTION).strip() : ""; - comment = (metadata.has_tag(Tag.DESCRIPTION)) ? - metadata.get_tag_string(Tag.DESCRIPTION).strip() : ""; - } - /** * Resizes the photograph so it fills the given width and height. * @param width the width. @@ -244,6 +235,16 @@ namespace GQPE { metadata.save_file(file.get_path()); } + /* Updates the data from the metadata. */ + private void update_data() { + album = (metadata.has_tag(Tag.SUBJECT)) ? + metadata.get_tag_string(Tag.SUBJECT).strip() : ""; + caption = (metadata.has_tag(Tag.CAPTION)) ? + metadata.get_tag_string(Tag.CAPTION).strip() : ""; + comment = (metadata.has_tag(Tag.DESCRIPTION)) ? + metadata.get_tag_string(Tag.DESCRIPTION).strip() : ""; + } + /* Updates the text tags. */ private void update_text_tags() throws GLib.Error { metadata.clear_tag(Tag.SUBJECT); diff --git a/src/tag.vala b/src/tag.vala index 1680168..9669da8 100644 --- a/src/tag.vala +++ b/src/tag.vala @@ -22,7 +22,7 @@ namespace GQPE { /** * Constants for the used tags. */ - private class Tag { + public class Tag { /** * Orientation tag. -- GitLab