[gtranslator/gtk4: 73/79] Fix warnings in gtr-actions-file.c
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator/gtk4: 73/79] Fix warnings in gtr-actions-file.c
- Date: Mon, 10 Oct 2022 16:31:21 +0000 (UTC)
commit ea423d2b038858a6bf9251a4bea9c0abfedf4794
Author: Daniel GarcĂa Moreno <dani danigm net>
Date: Mon Oct 3 17:42:39 2022 +0200
Fix warnings in gtr-actions-file.c
src/gtr-actions-file.c | 62 ++++----------------------------------------------
src/gtr-window.c | 42 +---------------------------------
2 files changed, 6 insertions(+), 98 deletions(-)
---
diff --git a/src/gtr-actions-file.c b/src/gtr-actions-file.c
index fc33f807..b6c3a3d7 100644
--- a/src/gtr-actions-file.c
+++ b/src/gtr-actions-file.c
@@ -584,20 +584,6 @@ gtr_save_current_file_dialog (GtkWidget * widget, GtrWindow * window)
gtr_po_set_state (po, GTR_PO_STATE_SAVED);
}
-static gboolean
-is_duplicated_location (const GSList * locations, GFile * u)
-{
- GSList *l;
-
- for (l = (GSList *) locations; l != NULL; l = g_slist_next (l))
- {
- if (g_file_equal (u, l->data))
- return TRUE;
- }
-
- return FALSE;
-}
-
static void
load_file_list (GtrWindow * window, const GSList * locations)
{
@@ -608,7 +594,7 @@ load_file_list (GtrWindow * window, const GSList * locations)
gtr_window_remove_tab (window);
- locations_to_load = g_slist_reverse (locations);
+ locations_to_load = g_slist_reverse ((GSList*) locations);
while (locations_to_load != NULL)
{
@@ -648,7 +634,7 @@ load_file_list (GtrWindow * window, const GSList * locations)
/**
* gtr_actions_load_uris:
*
- * Ignore non-existing URIs
+ * Ignore non-existing URIs
*/
void
gtr_actions_load_locations (GtrWindow * window, const GSList * locations)
@@ -662,64 +648,26 @@ gtr_actions_load_locations (GtrWindow * window, const GSList * locations)
static void
save_and_close_document (GtrPo * po, GtrWindow * window)
{
- GtrTab *tab;
-
gtr_save_current_file_dialog (NULL, window);
-
- //tab = gtr_tab_get_from_document (po);
-
- //_gtr_window_close_tab (window, tab);
gtr_window_remove_tab (window);
}
static void
close_all_tabs (GtrWindow * window)
{
- gtr_window_remove_tab(window);
- /*GtrNotebook *nb;
-
- nb = gtr_window_get_notebook (window);
- gtr_notebook_remove_all_pages (nb);
-
- //FIXME: This has to change once we add the close all documents menuitem*/
+ gtr_window_remove_tab (window);
gtk_window_destroy (GTK_WINDOW (window));
}
static void
save_and_close_all_documents (GList * unsaved_documents, GtrWindow * window)
{
- GtrTab *tab;
- //GList *l;
GError *error = NULL;
- /*for (l = unsaved_documents; l != NULL; l = g_list_next (l))
- {
- gtr_po_save_file (l->data, &error);
-
- if (error)
- {
- GtkWidget *dialog;
- GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
- dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- flags,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "%s", error->message);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
- gtk_window_present (GTK_WINDOW (dialog));
- g_clear_error (&error);
-
- return;
- }
-
- tab = gtr_tab_get_from_document (l->data);
-
- _gtr_window_close_tab (window, tab);
- }*/
-
if(unsaved_documents == NULL)
return;
- gtr_po_save_file(unsaved_documents->data,&error);
+
+ gtr_po_save_file (unsaved_documents->data, &error);
if(error)
{
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 75dd39d8..a2eaf015 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -496,7 +496,7 @@ searchbar_toggled (GtrTab * tab, gboolean revealed, GtrWindow *window)
void
gtr_window_remove_tab (GtrWindow * window)
{
- GtrWindowPrivate *priv = gtr_window_get_instance_private(window);
+ GtrWindowPrivate *priv = gtr_window_get_instance_private (window);
if (priv->active_tab != NULL)
{
if (gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "poeditor"))
@@ -775,46 +775,6 @@ gtr_window_get_tab_from_location (GtrWindow * window, GFile * location)
return NULL;
}
-/**
- * gtr_window_set_active_tab:
- * @window: a #GtrWindow
- * @tab: a #GtrTab
- *
- * Sets the active tab for the @window.
- */
-/* void
-gtr_window_set_active_tab (GtrWindow * window, GtkWidget * tab)
-{
- GtrWindowPrivate *priv = gtr_window_get_instance_private(window);
- gint page;
-
- page = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), tab);
-
- gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page);
-}*/
-
-/**
- * _gtr_window_close_tab:
- * @window: a #GtrWindow
- * @tab: a #GtrTab
- *
- * Closes the opened @tab of the @window and sets the right sensitivity of the
- * widgets.
- */
-/*void
-_gtr_window_close_tab (GtrWindow * window, GtrTab * tab)
-{
- GtrWindowPrivate *priv = gtr_window_get_instance_private(window);
- gint i;
-
- g_return_if_fail (GTR_IS_TAB (tab));
-
- i = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook),
- GTK_WIDGET (tab));
- if (i != -1)
- gtr_notebook_remove_page (GTR_NOTEBOOK (priv->notebook), i);
-}*/
-
void
gtr_window_show_projects (GtrWindow *window)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]