while (work)
{
gchar *prev = msg;
- msg = g_strdup_printf("%s\n%s", prev, (gchar *)work->data);
+ msg = g_strdup_printf("%s\n%s", prev, static_cast<gchar *>(work->data));
work = work->next;
g_free(prev);
}
}
- warning_dialog(_("Drag and Drop failed"), msg, GTK_STOCK_DIALOG_WARNING, NULL);
+ warning_dialog(_("Drag and Drop failed"), msg, GQ_ICON_DIALOG_WARNING, nullptr);
g_free(msg);
}
{
auto path = static_cast<const gchar *>(work->data);
gchar *local_path = path_from_utf8(path);
- uris[i] = g_filename_to_uri(local_path, NULL, NULL);
+ uris[i] = g_filename_to_uri(local_path, nullptr, nullptr);
g_free(local_path);
i++;
work = work->next;
}
- uris[i] = NULL;
+ uris[i] = nullptr;
return uris;
}
{
GList *path_list = filelist_to_path_list(list);
gchar **ret = uris_from_pathlist(path_list);
- string_list_free(path_list);
+ g_list_free_full(path_list, g_free);
return ret;
}
GList *uri_pathlist_from_uris(gchar **uris, GList **uri_error_list)
{
- GList *list = NULL;
+ GList *list = nullptr;
guint i = 0;
- GError *error = NULL;
+ GError *error = nullptr;
while (uris[i])
{
- gchar *local_path = g_filename_from_uri(uris[i], NULL, &error);
+ gchar *local_path = g_filename_from_uri(uris[i], nullptr, &error);
if (error)
{
DEBUG_1("g_filename_from_uri failed on uri \"%s\"", uris[i]);
DEBUG_1(" error %d: %s", error->code, error->message);
if (error->code == G_CONVERT_ERROR_BAD_URI)
{
- GError *retry_error = NULL;
+ GError *retry_error = nullptr;
gchar *escaped = g_uri_escape_string(uris[i], ":/", TRUE);
- local_path = g_filename_from_uri(escaped, NULL, &retry_error);
+ local_path = g_filename_from_uri(escaped, nullptr, &retry_error);
if(retry_error)
{
DEBUG_1("manually escaped uri \"%s\" also failed g_filename_from_uri", escaped);
g_free(escaped);
}
g_error_free(error);
- error = NULL;
+ error = nullptr;
if (!local_path)
{
*uri_error_list = g_list_prepend(*uri_error_list, g_strdup(uris[i]));
{
GList *path_list = uri_pathlist_from_uris(uris, uri_error_list);
GList *filelist = filelist_from_path_list(path_list);
- string_list_free(path_list);
+ g_list_free_full(path_list, g_free);
return filelist;
}
GList *uri_filelist_from_gtk_selection_data(GtkSelectionData *selection_data)
{
- GList *errors = NULL;
+ GList *errors = nullptr;
gchar **uris = gtk_selection_data_get_uris(selection_data);
GList *ret = uri_filelist_from_uris(uris, &errors);
if(errors)
{
warning_dialog_dnd_uri_error(errors);
- string_list_free(errors);
+ g_list_free_full(errors, g_free);
}
g_strfreev(uris);
return ret;