[gedit] Fix some compiler warnings in the filebrowser plugin
- From: Paolo Borelli <pborelli src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Fix some compiler warnings in the filebrowser plugin
- Date: Wed, 19 Aug 2009 10:59:15 +0000 (UTC)
commit 4843c8206d70b1be855527f27e89cf872949f0b8
Author: Paolo Borelli <pborelli gnome org>
Date: Wed Aug 19 12:58:24 2009 +0200
Fix some compiler warnings in the filebrowser plugin
plugins/filebrowser/gedit-file-bookmarks-store.c | 2 +-
plugins/filebrowser/gedit-file-browser-store.c | 23 +++++++++++--------
plugins/filebrowser/gedit-file-browser-utils.c | 25 ++++++++++++++++++++-
plugins/filebrowser/gedit-file-browser-view.c | 2 +-
4 files changed, 38 insertions(+), 14 deletions(-)
---
diff --git a/plugins/filebrowser/gedit-file-bookmarks-store.c b/plugins/filebrowser/gedit-file-bookmarks-store.c
index 8ca3143..d53bfd4 100644
--- a/plugins/filebrowser/gedit-file-bookmarks-store.c
+++ b/plugins/filebrowser/gedit-file-bookmarks-store.c
@@ -754,7 +754,7 @@ initialize_fill (GeditFileBookmarksStore * model)
/* Public */
GeditFileBookmarksStore *
-gedit_file_bookmarks_store_new ()
+gedit_file_bookmarks_store_new (void)
{
GeditFileBookmarksStore *model;
GType column_types[] = {
diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c
index b540b17..0cbc78c 100644
--- a/plugins/filebrowser/gedit-file-browser-store.c
+++ b/plugins/filebrowser/gedit-file-browser-store.c
@@ -538,16 +538,14 @@ gedit_file_browser_store_get_n_columns (GtkTreeModel * tree_model)
}
static GType
-gedit_file_browser_store_get_column_type (GtkTreeModel * tree_model,
- gint index)
+gedit_file_browser_store_get_column_type (GtkTreeModel * tree_model, gint idx)
{
g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model),
G_TYPE_INVALID);
- g_return_val_if_fail (index < GEDIT_FILE_BROWSER_STORE_COLUMN_NUM
- && index >= 0, G_TYPE_INVALID);
+ g_return_val_if_fail (idx < GEDIT_FILE_BROWSER_STORE_COLUMN_NUM &&
+ idx >= 0, G_TYPE_INVALID);
- return GEDIT_FILE_BROWSER_STORE (tree_model)->priv->
- column_types[index];
+ return GEDIT_FILE_BROWSER_STORE (tree_model)->priv->column_types[idx];
}
static gboolean
@@ -697,6 +695,8 @@ gedit_file_browser_store_get_value (GtkTreeModel * tree_model,
case GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM:
g_value_set_object (value, node->emblem);
break;
+ default:
+ g_return_if_reached ();
}
}
@@ -1338,13 +1338,15 @@ static void
file_browser_node_free (GeditFileBrowserStore * model,
FileBrowserNode * node)
{
- FileBrowserNodeDir * dir;
- gchar * uri;
+ gchar *uri;
if (node == NULL)
return;
- if (NODE_IS_DIR (node)) {
+ if (NODE_IS_DIR (node))
+ {
+ FileBrowserNodeDir *dir;
+
dir = FILE_BROWSER_NODE_DIR (node);
if (dir->cancellable) {
@@ -2351,6 +2353,7 @@ model_load_directory (GeditFileBrowserStore * model,
FileBrowserNode * node)
{
FileBrowserNodeDir *dir;
+ AsyncNode *async;
g_return_if_fail (NODE_IS_DIR (node));
@@ -2369,7 +2372,7 @@ model_load_directory (GeditFileBrowserStore * model,
dir->cancellable = g_cancellable_new ();
- AsyncNode *async = g_new (AsyncNode, 1);
+ async = g_new (AsyncNode, 1);
async->dir = dir;
async->cancellable = g_object_ref (dir->cancellable);
async->original_children = g_slist_copy (dir->children);
diff --git a/plugins/filebrowser/gedit-file-browser-utils.c b/plugins/filebrowser/gedit-file-browser-utils.c
index 3252d69..d8f4028 100644
--- a/plugins/filebrowser/gedit-file-browser-utils.c
+++ b/plugins/filebrowser/gedit-file-browser-utils.c
@@ -1,3 +1,24 @@
+/*
+ * gedit-file-bookmarks-store.c - Gedit plugin providing easy file access
+ * from the sidepanel
+ *
+ * Copyright (C) 2006 - Jesse van den Kieboom <jesse icecrew nl>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "gedit-file-browser-utils.h"
#include <gedit/gedit-utils.h>
@@ -139,11 +160,11 @@ gedit_file_browser_utils_confirmation_dialog (GeditWindow * window,
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
type,
- GTK_BUTTONS_NONE, message, NULL);
+ GTK_BUTTONS_NONE, "%s", message);
if (secondary)
gtk_message_dialog_format_secondary_text
- (GTK_MESSAGE_DIALOG (dlg), secondary, NULL);
+ (GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
/* Add a cancel button */
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/gedit-file-browser-view.c
index 4290dd0..9bd7fd5 100644
--- a/plugins/filebrowser/gedit-file-browser-view.c
+++ b/plugins/filebrowser/gedit-file-browser-view.c
@@ -993,7 +993,7 @@ bookmarks_separator_func (GtkTreeModel * model, GtkTreeIter * iter,
/* Public */
GtkWidget *
-gedit_file_browser_view_new ()
+gedit_file_browser_view_new (void)
{
GeditFileBrowserView *obj =
GEDIT_FILE_BROWSER_VIEW (g_object_new
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]