[bijiben] Fix some warnings
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] Fix some warnings
- Date: Wed, 9 Oct 2013 20:35:50 +0000 (UTC)
commit dffa524e17f15339de3ebc1c427f0bf69aa500d5
Author: Pierre-Yves Luyten <py luyten fr>
Date: Wed Oct 9 22:35:43 2013 +0200
Fix some warnings
src/.bjb-window-base.c.swp | Bin 0 -> 28672 bytes
src/bjb-bijiben.c | 17 ++++++++---------
src/bjb-main-view.c | 2 +-
src/bjb-window-base.c | 24 +++++++++++++++---------
src/bjb-window-base.h | 2 +-
5 files changed, 25 insertions(+), 20 deletions(-)
---
diff --git a/src/.bjb-window-base.c.swp b/src/.bjb-window-base.c.swp
new file mode 100644
index 0000000..0306082
Binary files /dev/null and b/src/.bjb-window-base.c.swp differ
diff --git a/src/bjb-bijiben.c b/src/bjb-bijiben.c
index e3e534a..050bba6 100644
--- a/src/bjb-bijiben.c
+++ b/src/bjb-bijiben.c
@@ -47,7 +47,7 @@ G_DEFINE_TYPE (Bijiben, bijiben, GTK_TYPE_APPLICATION);
static void
bijiben_new_window_internal (Bijiben *app,
GFile *file,
- BijiNoteObj *note_obj,
+ BijiItem *item,
GError *error);
static void
@@ -73,9 +73,8 @@ on_window_activated_cb (BjbWindowBase *window,
if (item != NULL)
{
- // fixme - bjb_window_base_switch_to_item...
if (win_is_available)
- bjb_window_base_switch_to_note (window, item);
+ bjb_window_base_switch_to_item (window, item);
else
bijiben_new_window_internal (self, NULL, item, NULL);
@@ -107,7 +106,7 @@ on_window_activated_cb (BjbWindowBase *window,
static void
bijiben_new_window_internal (Bijiben *self,
GFile *file,
- BijiNoteObj *note_obj,
+ BijiItem *item,
GError *error)
{
BjbWindowBase *window;
@@ -135,12 +134,12 @@ bijiben_new_window_internal (Bijiben *self,
if (file != NULL)
{
path = g_file_get_parse_name (file);
- note = biji_note_book_get_item_at_path (self->priv->book, path);
+ note = BIJI_NOTE_OBJ (biji_note_book_get_item_at_path (self->priv->book, path));
}
- else if (note_obj != NULL)
+ else if (item != NULL && BIJI_IS_NOTE_OBJ (item))
{
- note = note_obj;
+ note = BIJI_NOTE_OBJ (item);
}
@@ -149,7 +148,7 @@ bijiben_new_window_internal (Bijiben *self,
if (note != NULL)
{
bjb_controller_apply_needle (bjb_window_base_get_controller (window));
- bjb_window_base_switch_to_note (window, note);
+ bjb_window_base_switch_to_item (window, BIJI_ITEM (note));
}
out:
@@ -163,7 +162,7 @@ void
bijiben_new_window_for_note (GApplication *app,
BijiNoteObj *note)
{
- bijiben_new_window_internal (BIJIBEN_APPLICATION (app), NULL, note, NULL);
+ bijiben_new_window_internal (BIJIBEN_APPLICATION (app), NULL, BIJI_ITEM (note), NULL);
}
static void
diff --git a/src/bjb-main-view.c b/src/bjb-main-view.c
index 1b53109..5346fd6 100644
--- a/src/bjb-main-view.c
+++ b/src/bjb-main-view.c
@@ -180,7 +180,7 @@ void
switch_to_note_view (BjbMainView *self, BijiNoteObj *note)
{
bjb_main_view_disconnect_handlers (self);
- bjb_window_base_switch_to_note (BJB_WINDOW_BASE (self->priv->window), note);
+ bjb_window_base_switch_to_item (BJB_WINDOW_BASE (self->priv->window), BIJI_ITEM (note));
}
static void
diff --git a/src/bjb-window-base.c b/src/bjb-window-base.c
index 548c09c..0d0dbdc 100644
--- a/src/bjb-window-base.c
+++ b/src/bjb-window-base.c
@@ -333,7 +333,7 @@ bjb_window_base_switch_to (BjbWindowBase *bwb, BjbWindowViewType type)
}
void
-bjb_window_base_switch_to_note (BjbWindowBase *bwb, BijiNoteObj *note)
+bjb_window_base_switch_to_item (BjbWindowBase *bwb, BijiItem *item)
{
BjbWindowBasePriv *priv = bwb->priv;
GtkWidget *w = GTK_WIDGET (bwb);
@@ -342,17 +342,23 @@ bjb_window_base_switch_to_note (BjbWindowBase *bwb, BijiNoteObj *note)
bjb_search_toolbar_fade_out (priv->search_bar);
destroy_note_if_needed (bwb);
- priv->note = note;
- priv->note_overlay = gtk_overlay_new ();
+ if (BIJI_IS_NOTE_OBJ (item))
+ {
+
+ BijiNoteObj *note = BIJI_NOTE_OBJ (item);
- gtk_stack_add_named (priv->stack, priv->note_overlay, "note-view");
- priv->note_view = bjb_note_view_new (w, priv->note_overlay, note);
+ priv->note = note;
+ priv->note_overlay = gtk_overlay_new ();
- g_object_add_weak_pointer (G_OBJECT (priv->note_view),
- (gpointer *) &priv->note_view);
+ gtk_stack_add_named (priv->stack, priv->note_overlay, "note-view");
+ priv->note_view = bjb_note_view_new (w, priv->note_overlay, note);
- bjb_window_base_switch_to (bwb, BJB_WINDOW_BASE_NOTE_VIEW);
- gtk_widget_show_all (w);
+ g_object_add_weak_pointer (G_OBJECT (priv->note_view),
+ (gpointer *) &priv->note_view);
+
+ bjb_window_base_switch_to (bwb, BJB_WINDOW_BASE_NOTE_VIEW);
+ gtk_widget_show_all (w);
+ }
}
BjbWindowViewType
diff --git a/src/bjb-window-base.h b/src/bjb-window-base.h
index 28cb568..d2ae604 100644
--- a/src/bjb-window-base.h
+++ b/src/bjb-window-base.h
@@ -51,7 +51,7 @@ BjbController * bjb_window_base_get_controller ( BjbWindowBase *window ) ;
void bjb_window_base_switch_to (BjbWindowBase *bwb, BjbWindowViewType type);
-void bjb_window_base_switch_to_note (BjbWindowBase *bwb, BijiNoteObj *note);
+void bjb_window_base_switch_to_item (BjbWindowBase *bwb, BijiItem *item);
BjbWindowViewType bjb_window_base_get_view_type (BjbWindowBase *win);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]