[galeon] Fix compilation warnings.
- From: Fabio Bonelli <fabiob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [galeon] Fix compilation warnings.
- Date: Sun, 2 May 2010 15:32:13 +0000 (UTC)
commit 3e92329ab4e7fa8f1e53662d22f3a6dc02641448
Author: Fabio Bonelli <fabiob src gnome org>
Date: Sun May 2 17:17:03 2010 +0200
Fix compilation warnings.
Patch galeon-2.0.7-warnings.patch from Fedora.
bookmarks/bookmarks-context-menu.c | 2 +-
bookmarks/bookmarks-editor.c | 4 ++--
bookmarks/bookmarks-gtk-menu-item.c | 15 +--------------
bookmarks/bookmarks-gtk-toolbar-set.c | 2 +-
bookmarks/bookmarks-gtk-toolbar.c | 2 +-
bookmarks/bookmarks-icon-provider.c | 2 +-
embed/galeon-embed-shell.c | 2 +-
libegg/dock/egg-dock-item.c | 12 ++++++------
libegg/dock/egg-dock-master.c | 2 +-
libegg/dock/egg-dock-object.c | 3 ++-
libegg/egg-editable-toolbar.c | 6 +++---
mozilla/EphyPromptService.cpp | 2 +-
mozilla/HeaderSniffer.cpp | 7 ++++---
mozilla/ProgressListener.h | 2 +-
mozilla/mozilla-embed-shell.cpp | 12 ++++++++++++
utils/galeon-sidebar.c | 2 +-
utils/gul-download.c | 16 ++++++++++------
utils/gul-notebook.c | 21 ++++-----------------
utils/gul-toolbutton.c | 2 +-
19 files changed, 54 insertions(+), 62 deletions(-)
---
diff --git a/bookmarks/bookmarks-context-menu.c b/bookmarks/bookmarks-context-menu.c
index 362c58a..4ed05a6 100644
--- a/bookmarks/bookmarks-context-menu.c
+++ b/bookmarks/bookmarks-context-menu.c
@@ -236,7 +236,7 @@ gb_context_menu_build_menu (GbContextMenu *cm)
p->menu = gtk_menu_new ();
g_object_ref (p->menu);
- gtk_object_sink (GTK_OBJECT (p->menu));
+ g_object_ref_sink (p->menu);
if (GB_IS_SITE (p->bm))
{
diff --git a/bookmarks/bookmarks-editor.c b/bookmarks/bookmarks-editor.c
index 87dc9da..f941499 100644
--- a/bookmarks/bookmarks-editor.c
+++ b/bookmarks/bookmarks-editor.c
@@ -524,7 +524,7 @@ gb_editor_get_tree_view (GbEditor *e)
gtk_widget_show (GTK_WIDGET (p->left_tree_view));
g_object_ref (p->left_tree_view);
- gtk_object_sink (GTK_OBJECT (p->left_tree_view));
+ g_object_ref_sink (p->left_tree_view);
p->right_tree_view = gb_tree_view_new ();
if (p->location_source)
@@ -540,7 +540,7 @@ gb_editor_get_tree_view (GbEditor *e)
gtk_widget_show (GTK_WIDGET (p->right_tree_view));
g_object_ref (p->right_tree_view);
- gtk_object_sink (GTK_OBJECT (p->right_tree_view));
+ g_object_ref_sink (p->right_tree_view);
gb_tree_view_set_autoexpand_roots (p->right_tree_view, FALSE);
}
diff --git a/bookmarks/bookmarks-gtk-menu-item.c b/bookmarks/bookmarks-gtk-menu-item.c
index f59b7f6..c9098b2 100644
--- a/bookmarks/bookmarks-gtk-menu-item.c
+++ b/bookmarks/bookmarks-gtk-menu-item.c
@@ -82,7 +82,6 @@ enum GbGtkMenuItemSignalsEnum {
GB_GTK_MENU_ITEM_LAST_SIGNAL
};
static gint GbGtkMenuItemSignals[GB_GTK_MENU_ITEM_LAST_SIGNAL];
-static GtkTooltips *_gb_gtk_menu_item_tooltips = NULL;
/**
* GtkMenu object
@@ -115,14 +114,6 @@ gb_gtk_menu_item_init (GbGtkMenuItem *m)
GbGtkMenuItemPrivate *p = GB_GTK_MENU_ITEM_GET_PRIVATE (m);
m->priv = p;
- if (!_gb_gtk_menu_item_tooltips)
- {
- _gb_gtk_menu_item_tooltips = gtk_tooltips_new ();
- g_object_add_weak_pointer (G_OBJECT (_gb_gtk_menu_item_tooltips),
- (gpointer)&_gb_gtk_menu_item_tooltips);
- }
- g_object_ref (_gb_gtk_menu_item_tooltips);
- gtk_object_sink (GTK_OBJECT(_gb_gtk_menu_item_tooltips));
}
static void
@@ -153,8 +144,6 @@ gb_gtk_menu_item_finalize_impl (GObject *o)
g_object_unref (G_OBJECT (p->bookmark));
- g_object_unref (_gb_gtk_menu_item_tooltips);
-
G_OBJECT_CLASS (gb_gtk_menu_item_parent_class)->finalize (o);
}
@@ -228,9 +217,7 @@ gb_gtk_menu_item_set_tooltip (GbGtkMenuItem *bmi, GbBookmark *bm, const char *vi
char *tooltip;
tooltip = g_strjoinv("\n\n", parts);
- gtk_tooltips_set_tip (_gb_gtk_menu_item_tooltips,
- GTK_WIDGET(bmi),
- tooltip, NULL);
+ gtk_widget_set_tooltip_text (GTK_WIDGET(bmi), tooltip);
g_free (tooltip);
}
}
diff --git a/bookmarks/bookmarks-gtk-toolbar-set.c b/bookmarks/bookmarks-gtk-toolbar-set.c
index 7158812..f7adc77 100644
--- a/bookmarks/bookmarks-gtk-toolbar-set.c
+++ b/bookmarks/bookmarks-gtk-toolbar-set.c
@@ -228,7 +228,7 @@ gb_gtk_toolbar_set_build_folder (GbGtkToolbarSet *gts, GbFolder *f)
gtk_widget_show (GTK_WIDGET (tb));
g_hash_table_insert (p->folder_to_toolbar, g_object_ref (f), g_object_ref (tb));
- gtk_object_sink (GTK_OBJECT (tb));
+ g_object_ref_sink (tb);
if (p->add_func)
{
diff --git a/bookmarks/bookmarks-gtk-toolbar.c b/bookmarks/bookmarks-gtk-toolbar.c
index bb9e600..40c7f08 100644
--- a/bookmarks/bookmarks-gtk-toolbar.c
+++ b/bookmarks/bookmarks-gtk-toolbar.c
@@ -247,7 +247,7 @@ toolbar_drag_motion (GbGtkToolbar *toolbar,
* feedback */
toolbar->priv->drag_item = gtk_tool_button_new (NULL, "m");
g_object_ref (G_OBJECT (toolbar->priv->drag_item));
- gtk_object_sink (GTK_OBJECT (toolbar->priv->drag_item));
+ g_object_ref_sink (toolbar->priv->drag_item);
}
gdk_drag_status (context, context->suggested_action, time);
diff --git a/bookmarks/bookmarks-icon-provider.c b/bookmarks/bookmarks-icon-provider.c
index 335324f..c9f1cd8 100644
--- a/bookmarks/bookmarks-icon-provider.c
+++ b/bookmarks/bookmarks-icon-provider.c
@@ -209,7 +209,7 @@ gb_icon_provider_load_default_icons (GbIconProvider *ip)
GtkWidget *dummy = gtk_toolbar_new ();
g_object_ref (dummy);
- gtk_object_sink (GTK_OBJECT (dummy));
+ g_object_ref_sink (dummy);
if (p->folder_pixbuf_data)
{
diff --git a/embed/galeon-embed-shell.c b/embed/galeon-embed-shell.c
index 7d32014..13488b2 100644
--- a/embed/galeon-embed-shell.c
+++ b/embed/galeon-embed-shell.c
@@ -320,7 +320,7 @@ impl_get_js_console (GaleonEmbedShell *shell)
{
shell->priv->js_console = GALEON_JS_CONSOLE (galeon_js_console_new ());
g_object_ref (shell->priv->js_console);
- gtk_object_sink (GTK_OBJECT (shell->priv->js_console));
+ g_object_ref_sink (shell->priv->js_console);
}
return shell->priv->js_console;
diff --git a/libegg/dock/egg-dock-item.c b/libegg/dock/egg-dock-item.c
index de64e79..56355e3 100644
--- a/libegg/dock/egg-dock-item.c
+++ b/libegg/dock/egg-dock-item.c
@@ -1485,13 +1485,13 @@ egg_dock_item_set_tablabel (EggDockItem *item,
NULL, item);
g_object_set (item->_priv->tab_label, "item", NULL, NULL);
}
- gtk_widget_unref (item->_priv->tab_label);
+ g_object_unref (item->_priv->tab_label);
item->_priv->tab_label = NULL;
}
if (tablabel) {
- gtk_widget_ref (tablabel);
- gtk_object_sink (GTK_OBJECT (tablabel));
+ g_object_ref (tablabel);
+ g_object_ref_sink (tablabel);
item->_priv->tab_label = tablabel;
if (EGG_IS_DOCK_TABLABEL (tablabel)) {
g_object_set (tablabel, "item", item, NULL);
@@ -1564,7 +1564,7 @@ egg_dock_item_hide_item (EggDockItem *item)
"host", item,
NULL));
g_object_ref (item->_priv->ph);
- gtk_object_sink (GTK_OBJECT (item->_priv->ph));
+ g_object_ref_sink (item->_priv->ph);
}
egg_dock_object_freeze (EGG_DOCK_OBJECT (item));
@@ -1627,7 +1627,7 @@ egg_dock_item_set_default_position (EggDockItem *item,
if (reference && EGG_DOCK_OBJECT_ATTACHED (reference)) {
if (EGG_IS_DOCK_PLACEHOLDER (reference)) {
g_object_ref (reference);
- gtk_object_sink (GTK_OBJECT (reference));
+ g_object_ref_sink (reference);
item->_priv->ph = EGG_DOCK_PLACEHOLDER (reference);
}
else {
@@ -1637,7 +1637,7 @@ egg_dock_item_set_default_position (EggDockItem *item,
"host", reference,
NULL));
g_object_ref (item->_priv->ph);
- gtk_object_sink (GTK_OBJECT (item->_priv->ph));
+ g_object_ref_sink (item->_priv->ph);
}
}
}
diff --git a/libegg/dock/egg-dock-master.c b/libegg/dock/egg-dock-master.c
index b8d77ec..746f65c 100644
--- a/libegg/dock/egg-dock-master.c
+++ b/libegg/dock/egg-dock-master.c
@@ -736,7 +736,7 @@ egg_dock_master_add (EggDockMaster *master,
}
else {
g_object_ref (object);
- gtk_object_sink (GTK_OBJECT (object));
+ g_object_ref_sink (object);
g_hash_table_insert (master->dock_objects, g_strdup (object->name), object);
}
}
diff --git a/libegg/dock/egg-dock-object.c b/libegg/dock/egg-dock-object.c
index 30496d9..cafd253 100644
--- a/libegg/dock/egg-dock-object.c
+++ b/libegg/dock/egg-dock-object.c
@@ -28,6 +28,7 @@
#include <egg-macros.h>
#include <stdlib.h>
#include <string.h>
+#include <gtk/gtkobject.h>
#include "egg-dock-object.h"
#include "egg-dock-master.h"
@@ -388,7 +389,7 @@ egg_dock_object_real_reduce (EggDockObject *object)
g_object_unref (child);
}
/* sink the widget, so any automatic floating widget is destroyed */
- gtk_object_sink (GTK_OBJECT (object));
+ g_object_ref_sink (object);
/* don't reenter */
object->reduce_pending = FALSE;
egg_dock_object_thaw (object);
diff --git a/libegg/egg-editable-toolbar.c b/libegg/egg-editable-toolbar.c
index ae009c3..efd1963 100644
--- a/libegg/egg-editable-toolbar.c
+++ b/libegg/egg-editable-toolbar.c
@@ -476,7 +476,7 @@ drag_data_received_cb (GtkWidget *widget,
create_item_from_action (etoolbar, id, type,
data_is_separator (id), NULL);
g_object_ref (etoolbar->priv->dragged_item);
- gtk_object_sink (GTK_OBJECT (etoolbar->priv->dragged_item));
+ g_object_ref_sink (etoolbar->priv->dragged_item);
}
else
{
@@ -1278,7 +1278,7 @@ egg_editable_toolbar_set_fixed (EggEditableToolbar *toolbar,
toolbar->priv->fixed_toolbar = gtk_toolbar_new ();
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar->priv->fixed_toolbar), FALSE);
g_object_ref (toolbar->priv->fixed_toolbar);
- gtk_object_sink (GTK_OBJECT (toolbar->priv->fixed_toolbar));
+ g_object_ref_sink (toolbar->priv->fixed_toolbar);
}
if (toolbar->priv->fixed)
@@ -1293,7 +1293,7 @@ egg_editable_toolbar_set_fixed (EggEditableToolbar *toolbar,
if (fixed)
{
g_object_ref (fixed);
- gtk_object_sink (GTK_OBJECT (fixed));
+ g_object_ref_sink (fixed);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar->priv->fixed_toolbar), fixed, 0);
}
diff --git a/mozilla/EphyPromptService.cpp b/mozilla/EphyPromptService.cpp
index 5b2d9a4..982a2f8 100644
--- a/mozilla/EphyPromptService.cpp
+++ b/mozilla/EphyPromptService.cpp
@@ -146,7 +146,7 @@ Prompter::Prompter (const char *aStock,
mDialog = GTK_DIALOG (gtk_dialog_new ());
g_object_ref (mDialog);
- gtk_object_sink (GTK_OBJECT (mDialog));
+ g_object_ref_sink (mDialog);
char *title = NULL;
if (aTitle)
diff --git a/mozilla/HeaderSniffer.cpp b/mozilla/HeaderSniffer.cpp
index 41400f5..36ec2ce 100644
--- a/mozilla/HeaderSniffer.cpp
+++ b/mozilla/HeaderSniffer.cpp
@@ -586,11 +586,12 @@ HeaderSniffer::PerformSave (const GulCString &defaultFileName)
if (mDocument && (flags & EMBED_PERSIST_SAVE_CONTENT))
{
- GtkWidget *toggle;
-
/* Reset the flags to turn off content, the user toggles
* if they want to turn it on */
- (gint&)flags &= ~EMBED_PERSIST_SAVE_CONTENT;
+ GtkWidget *toggle;
+ int f = flags & ~EMBED_PERSIST_SAVE_CONTENT;
+ flags = (EmbedPersistFlags) f;
+
galeon_embed_persist_set_flags (mEmbedPersist, flags);
toggle = gtk_check_button_new_with_mnemonic (_("Save _with content"));
diff --git a/mozilla/ProgressListener.h b/mozilla/ProgressListener.h
index 34e1fee..c6fad77 100644
--- a/mozilla/ProgressListener.h
+++ b/mozilla/ProgressListener.h
@@ -60,7 +60,7 @@ class nsIInputStream;
#define G_PROGRESSDIALOG_CLASSNAME "Galeon's Download Progress Dialog"
#define G_PROGRESSDIALOG_CONTRACTID "@mozilla.org/progressdialog;1"
-class GProgressListener :
+class NS_COM_GLUE GProgressListener :
public nsITransfer,
public nsSupportsWeakReference
{
diff --git a/mozilla/mozilla-embed-shell.cpp b/mozilla/mozilla-embed-shell.cpp
index 7c7e097..61fbc07 100644
--- a/mozilla/mozilla-embed-shell.cpp
+++ b/mozilla/mozilla-embed-shell.cpp
@@ -21,9 +21,21 @@
#endif
#include <nscore.h>
+
+/* Some versions of nscore.h appears to #define nscore_h___, while
+ * gtkmozembed.h looks for nscore_h__ to see if stuff needs
+ * redefining (what were they thinking?!). Define explicitly, then
+ * curse. */
+#ifndef nscore_h__
+#define nscore_h__
+#endif
+
#include <nsComponentManagerUtils.h>
#include <nsServiceManagerUtils.h>
+#define HAVE_VISIBILITY_HIDDEN_ATTRIBUTE 1
+#define HAVE_VISIBILITY_ATTRIBUTE 1
+
#ifdef XPCOM_GLUE
#include <nsXPCOMGlue.h>
#include <gtkmozembed_glue.cpp>
diff --git a/utils/galeon-sidebar.c b/utils/galeon-sidebar.c
index c3459a1..f72f8d3 100644
--- a/utils/galeon-sidebar.c
+++ b/utils/galeon-sidebar.c
@@ -304,7 +304,7 @@ galeon_sidebar_init (GaleonSidebar *sidebar)
sidebar->priv->title_menu = gtk_menu_new ();
g_object_ref (sidebar->priv->title_menu);
- gtk_object_sink (GTK_OBJECT (sidebar->priv->title_menu));
+ g_object_ref_sink (sidebar->priv->title_menu);
gtk_widget_show (sidebar->priv->title_button);
gtk_widget_show (sidebar->priv->title_menu);
diff --git a/utils/gul-download.c b/utils/gul-download.c
index 9f47801..cb58393 100644
--- a/utils/gul-download.c
+++ b/utils/gul-download.c
@@ -65,7 +65,12 @@ gul_download_external_save_url (const gchar *url)
gchar *dirName, *utf8DirName, *prefDir = NULL;
gsize bytesRead, bytesWritten;
gint retVal;
- GtkWidget *fileSel = gtk_file_selection_new(_("Choose destination folder"));
+ GtkWidget *fileSel =
+ gtk_file_chooser_dialog_new(_("Choose destination folder"),
+ NULL,
+ GTK_FILE_CHOOSER_ACTION_SAVE,
+ NULL,
+ NULL);
/* Dirname must end in a '/' for the file selection to treat
* it as a directory. When we have a UI to set the value, we
@@ -96,10 +101,9 @@ gul_download_external_save_url (const gchar *url)
return;
}
- gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileSel),
- dirName);
- gtk_widget_set_sensitive(GTK_FILE_SELECTION(fileSel)
- ->file_list, FALSE);
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fileSel),
+ dirName);
+ gtk_widget_set_sensitive(fileSel, FALSE);
retVal = gtk_dialog_run(GTK_DIALOG(fileSel));
@@ -109,7 +113,7 @@ gul_download_external_save_url (const gchar *url)
* which is what we need.
*/
gul_download_save_url_with_dir(url,
- gtk_file_selection_get_filename(GTK_FILE_SELECTION(fileSel)));
+ gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fileSel)));
}
gtk_widget_hide(fileSel);
gtk_widget_destroy(fileSel);
diff --git a/utils/gul-notebook.c b/utils/gul-notebook.c
index 82b667a..76b1ead 100644
--- a/utils/gul-notebook.c
+++ b/utils/gul-notebook.c
@@ -77,7 +77,6 @@ static void gul_notebook_finalize (GObject *object);
/* Local variables */
static GdkCursor *cursor = NULL;
static GList *notebooks = NULL;
-static GtkTooltips *_gul_notebook_tooltips = NULL;
/* Local functions */
@@ -662,15 +661,6 @@ gul_notebook_switch_page_cb (GtkNotebook *notebook,
static void
gul_notebook_init (GulNotebook *notebook)
{
- if (!_gul_notebook_tooltips)
- {
- _gul_notebook_tooltips = gtk_tooltips_new ();
- g_object_add_weak_pointer (G_OBJECT (_gul_notebook_tooltips),
- (gpointer)&_gul_notebook_tooltips);
- }
- g_object_ref (_gul_notebook_tooltips);
- gtk_object_sink (GTK_OBJECT (_gul_notebook_tooltips));
-
notebook->priv = g_new (GulNotebookPrivate, 1);
notebook->priv->drag_in_progress = FALSE;
@@ -706,8 +696,6 @@ gul_notebook_finalize (GObject *object)
g_free (notebook->priv);
- g_object_unref (_gul_notebook_tooltips);
-
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -794,7 +782,7 @@ tab_build_label (GulNotebook *nb, GtkWidget *child)
rcstyle = gtk_rc_style_new ();
rcstyle->xthickness = rcstyle->ythickness = 0;
gtk_widget_modify_style (close_button, rcstyle);
- gtk_rc_style_unref (rcstyle),
+ g_object_unref (rcstyle),
image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
GTK_ICON_SIZE_MENU);
@@ -802,8 +790,7 @@ tab_build_label (GulNotebook *nb, GtkWidget *child)
gtk_widget_set_size_request (close_button, size.width, size.height);
gtk_container_add (GTK_CONTAINER (close_button), image);
- gtk_tooltips_set_tip (_gul_notebook_tooltips, close_button,
- _("Close this tab"), NULL);
+ gtk_widget_set_tooltip_text (close_button, _("Close this tab"));
/* setup label, need eventbox for tooltips and left-padding to get
* comfortable space between the label and icon/tab border */
@@ -997,7 +984,7 @@ gul_notebook_remove_page (GulNotebook *nb,
/* remove the tool tip for this ebox */
label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (nb), child);
ebox = GTK_WIDGET (g_object_get_data (G_OBJECT (label), "label-ebox"));
- gtk_tooltips_set_tip (_gul_notebook_tooltips, ebox, NULL, NULL);
+ gtk_widget_set_tooltip_text (ebox, NULL);
/* If we don't clear the icon then for some reason it gets reset back
* to an empty icon. This means that although gul_notebook_move_page() has
@@ -1052,7 +1039,7 @@ gul_notebook_set_page_title (GulNotebook *nb,
gtk_label_set_label (GTK_LABEL (label), title);
gtk_notebook_set_menu_label_text (GTK_NOTEBOOK (nb), child, short_title);
- gtk_tooltips_set_tip (_gul_notebook_tooltips, ebox, title, NULL);
+ gtk_widget_set_tooltip_text (ebox, title);
g_free (short_title);
}
diff --git a/utils/gul-toolbutton.c b/utils/gul-toolbutton.c
index c21b51a..55db16f 100644
--- a/utils/gul-toolbutton.c
+++ b/utils/gul-toolbutton.c
@@ -227,7 +227,7 @@ gul_toolbutton_build (GulToolbutton *button)
p->menu = gtk_menu_new ();
g_object_ref (p->menu);
- gtk_object_sink (GTK_OBJECT (p->menu));
+ g_object_ref_sink (p->menu);
hbox = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]