* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "metadata.h"
+
#include <clocale>
-#include "main.h"
-#include "metadata.h"
+#include <config.h>
#include "cache.h"
+#include "debug.h"
#include "exif.h"
#include "filedata.h"
+#include "intl.h"
+#include "layout-util.h"
+#include "main-defines.h"
#include "misc.h"
+#include "rcfile.h"
#include "secure-save.h"
#include "ui-fileops.h"
#include "utilops.h"
-#include "layout-util.h"
-#include "rcfile.h"
enum MetadataKey {
MK_NONE,
work = list;
while (work)
{
- FileData *fd = static_cast<FileData *>(work->data);
+ auto *fd = static_cast<FileData *>(work->data);
work = work->next;
ret = ret && metadata_write_queue_remove(fd);
}
{
gdouble coord;
gchar *endptr;
- gdouble deg, min, sec;
+ gdouble deg;
+ gdouble min;
+ gdouble sec;
gboolean ok = FALSE;
gchar *string = metadata_read_string(fd, key, METADATA_PLAIN);
if (!string) return fallback;
{
return metadata_write_string(fd, key, value);
}
- else
- {
- gchar *new_string = g_strconcat(str, value, NULL);
- gboolean ret = metadata_write_string(fd, key, new_string);
- g_free(str);
- g_free(new_string);
- return ret;
- }
+
+ gchar *new_string = g_strconcat(str, value, NULL);
+ gboolean ret = metadata_write_string(fd, key, new_string);
+ g_free(str);
+ g_free(new_string);
+ return ret;
}
gboolean metadata_write_GPS_coord(FileData *fd, const gchar *key, gdouble value)
char *coordinate;
const char *ref;
gboolean ok = TRUE;
- char *old_locale, *saved_locale;
+ char *old_locale;
+ char *saved_locale;
param = value;
if (param < 0)
{
return metadata_write_list(fd, key, values);
}
- else
- {
- gboolean ret;
- list = g_list_concat(list, string_list_copy(values));
- list = remove_duplicate_strings_from_list(list);
- ret = metadata_write_list(fd, key, list);
- g_list_free_full(list, g_free);
- return ret;
- }
+ gboolean ret;
+ list = g_list_concat(list, string_list_copy(values));
+ list = remove_duplicate_strings_from_list(list);
+
+ ret = metadata_write_list(fd, key, list);
+ g_list_free_full(list, g_free);
+ return ret;
}
/**
{
if (options->metadata.keywords_case_sensitive)
return find_string_in_list_utf8case(list, string);
- else
- return find_string_in_list_utf8nocase(list, string);
+
+ return find_string_in_list_utf8nocase(list, string);
}
#define KEYWORDS_SEPARATOR(c) ((c) == ',' || (c) == ';' || (c) == '\n' || (c) == '\r' || (c) == '\b')
{
return keyword_compare(keyword_tree, &parent_a, &parent_b) == 0;
}
- else
- {
- return (!valid_pa && !valid_pb); /* both are toplevel */
- }
+
+ return (!valid_pa && !valid_pb); /* both are toplevel */
}
gboolean keyword_exists(GtkTreeModel *keyword_tree, GtkTreeIter *parent_ptr, GtkTreeIter *sibling, const gchar *name, gboolean exclude_sibling, GtkTreeIter *result)
void keyword_copy(GtkTreeStore *keyword_tree, GtkTreeIter *to, GtkTreeIter *from)
{
- gchar *mark, *name, *casefold;
+ gchar *mark;
+ gchar *name;
+ gchar *casefold;
gboolean is_keyword;
/* do not copy KEYWORD_COLUMN_HIDE_IN, it fully shows the new subtree */
void keyword_tree_new_default()
{
- GtkTreeIter i1, i2;
+ GtkTreeIter i1;
+ GtkTreeIter i2;
if (!keyword_tree) keyword_tree_new();