}
if (geocoded_count == 1 && count == 1)
{
- g_string_append_printf(message,
+ g_string_append(message,
_("\nThis image is already geocoded!"));
}
else if (geocoded_count == 1 && count > 1)
{
- g_string_append_printf(message,
+ g_string_append(message,
_("\nOne image is already geocoded!"));
}
else if (geocoded_count > 1 && count > 1)
_("\n%i Images are already geocoded!"), geocoded_count);
}
- location = g_strdup_printf("%lf %lf", pgd->dest_latitude,
- pgd->dest_longitude);
- g_string_append_printf(message, _("\n\nPosition: %s \n"), location);
+ g_string_append_printf(message, _("\n\nPosition: %lf %lf \n"), pgd->dest_latitude, pgd->dest_longitude);
gd = generic_dialog_new(_("Geocode images"),
"geocode_images", nullptr, TRUE,
bar_pane_gps_close_save_cb, TRUE);
gtk_widget_show(gd->dialog);
- g_free(location);
g_string_free(message, TRUE);
}
}
auto pkd = static_cast<PaneKeywordsData *>(data);
GenericDialog *gd;
- GString *message = g_string_new("");
-
- message = g_string_append(message, _("This will disconnect all Marks Keywords connections"));
gd = generic_dialog_new(_("Marks Keywords"),
"marks_keywords", menu_widget, TRUE, dummy_cancel_cb, pkd);
generic_dialog_add_message(gd, GQ_ICON_DIALOG_WARNING,
- "Disconnect all Marks Keywords connections?", message->str, TRUE);
+ "Disconnect all Marks Keywords connections?", _("This will disconnect all Marks Keywords connections"), TRUE);
generic_dialog_add_button(gd, GQ_ICON_OK, "OK", bar_pane_keywords_disconnect_marks_ok_cb, TRUE);
gtk_widget_show(gd->dialog);
-
- g_string_free(message, TRUE);
}
static void bar_pane_keywords_delete_cb(GtkWidget *, gpointer data)
while (work)
{
auto collection_name = static_cast<const gchar *>(work->data);
- out_string = g_string_append(out_string, g_strdup(collection_name));
+ out_string = g_string_append(out_string, collection_name);
out_string = g_string_append(out_string, "\n");
work = work->next;
{
ci = static_cast<CollectInfo *>(work->data);
fd = ci->fd;
- *contents = g_string_append(*contents, g_strdup(fd->path));
+ *contents = g_string_append(*contents, fd->path);
*contents = g_string_append(*contents, "\n");
work = work->next;
GFileOutputStream *gfstream;
GFile *out_file;
GString *output_string;
- gchar *sep;
gchar* rank;
GList *work;
GtkTreeSelection *selection;
return;
}
- sep = g_strdup((edd->separator == EXPORT_CSV) ? "," : "\t");
+ const gchar *sep = (edd->separator == EXPORT_CSV) ? "," : "\t";
output_string = g_string_new(g_strjoin(sep, _("Match"), _("Group"), _("Similarity"), _("Set"), _("Thumbnail"), _("Name"), _("Size"), _("Date"), _("Width"), _("Height"), _("Path\n"), NULL));
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(edd->dupewindow->listview));
match_count++;
}
color_old = color_new;
- output_string = g_string_append(output_string, g_strdup_printf("%d", match_count));
+ g_string_append_printf(output_string, "%d", match_count);
output_string = g_string_append(output_string, sep);
if ((dupe_match_find_parent(edd->dupewindow, di) == di))
}
else
{
- output_string = g_string_append(output_string, g_strdup_printf("%s", rank_split[0]));
+ output_string = g_string_append(output_string, rank_split[0]);
}
output_string = g_string_append(output_string, sep);
g_free(rank);
g_strfreev(rank_split);
- output_string = g_string_append(output_string, g_strdup_printf("%d", (di->second + 1)));
+ g_string_append_printf(output_string, "%d", di->second + 1);
output_string = g_string_append(output_string, sep);
thumb_cache = cache_find_location(CACHE_TYPE_THUMB, di->fd->path);
output_string = g_string_append(output_string, sep);
g_free(name);
- output_string = g_string_append(output_string, g_strdup_printf("%" PRIu64, di->fd->size));
+ g_string_append_printf(output_string, "%" PRIu64, di->fd->size);
output_string = g_string_append(output_string, sep);
output_string = g_string_append(output_string, text_from_time(di->fd->date));
output_string = g_string_append(output_string, sep);
- output_string = g_string_append(output_string, g_strdup_printf("%d", (di->width ? di->width : 0)));
+ g_string_append_printf(output_string, "%d", di->width);
output_string = g_string_append(output_string, sep);
- output_string = g_string_append(output_string, g_strdup_printf("%d", (di->height ? di->height : 0)));
+ g_string_append_printf(output_string, "%d", di->height);
output_string = g_string_append(output_string, sep);
output_string = g_string_append(output_string, di->fd->path);
output_string = g_string_append_c(output_string, '\n');
g_output_stream_write(G_OUTPUT_STREAM(gfstream), output_string->str, output_string->len, nullptr, &error);
- g_free(sep);
g_string_free(output_string, TRUE);
g_object_unref(gfstream);
g_object_unref(out_file);
cache_found = cache_find_location(CACHE_TYPE_THUMB, split_line[1]);
if (cache_found)
{
- file_names = g_string_append(file_names, g_strconcat("\"", cache_found,"\" ", NULL));
+ g_string_append_printf(file_names, "\"%s\" ", cache_found);
line_count++;
}
g_free(cache_found);
}
else
{
- message = g_string_new("");
- message = g_string_append(message, _("Operation failed:\n"));
+ message = g_string_new(_("Operation failed:\n"));
if (run_result == 1)
message = g_string_append(message, _("No file extension\n"));
gsize size;
guint32 flags;
- copyright = g_string_new(nullptr);
- copyright = g_string_append(copyright, "This program comes with absolutely no warranty.\nGNU General Public License, version 2 or later.\nSee https://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n\n");
+ copyright = g_string_new("This program comes with absolutely no warranty.\nGNU General Public License, version 2 or later.\nSee https://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n\n");
timezone_path = g_build_filename(get_rc_dir(), TIMEZONE_DATABASE_FILE, NULL);
if (g_file_test(timezone_path, G_FILE_TEST_EXISTS))
return FALSE;
}
- outstr = g_string_new("");
- g_string_append_printf(outstr, "<!--\n");
- g_string_append_printf(outstr, "######################################################################\n");
+ outstr = g_string_new("<!--\n");
+ g_string_append(outstr, "######################################################################\n");
g_string_append_printf(outstr, "# %30s config file version %-10s #\n", GQ_APPNAME, VERSION);
- g_string_append_printf(outstr, "######################################################################\n");
+ g_string_append(outstr, "######################################################################\n");
WRITE_SEPARATOR();
WRITE_STRING("# Note: This file is autogenerated. Options can be changed here,\n");
return FALSE;
}
- outstr = g_string_new("");
- g_string_append_printf(outstr, "<!--\n");
- g_string_append_printf(outstr, "######################################################################\n");
+ outstr = g_string_new("<!--\n");
+ g_string_append(outstr, "######################################################################\n");
g_string_append_printf(outstr, "# %8s default layout file version %-10s #\n", GQ_APPNAME, VERSION);
- g_string_append_printf(outstr, "######################################################################\n");
+ g_string_append(outstr, "######################################################################\n");
WRITE_SEPARATOR();
WRITE_STRING("# Note: This file is autogenerated. Options can be changed here,\n");
while (work)
{
fd = static_cast<FileData *>(work->data);
- g_string_append_printf(out_string, "%s", fd->path);
+ g_string_append(out_string, fd->path);
format_class = filter_file_get_class(fd->path);
switch (format_class)
while (work)
{
auto collection_name = static_cast<const gchar *>(work->data);
- out_string = g_string_append(out_string, g_strdup(collection_name));
+ out_string = g_string_append(out_string, collection_name);
out_string = g_string_append(out_string, "\n");
work = work->next;
gchar *err_msg = file_data_get_error_string(error);
g_string_append(message, err_msg);
if (icon_name) *icon_name = (error & CHANGE_ERROR_MASK) ? GQ_ICON_DIALOG_ERROR : GQ_ICON_DIALOG_WARNING;
+ g_free(err_msg);
}
else
{