SF.net SVN: geany:[4017] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Thu Jul 23 17:11:31 UTC 2009
Revision: 4017
http://geany.svn.sourceforge.net/geany/?rev=4017&view=rev
Author: ntrel
Date: 2009-07-23 17:11:31 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
Fix GLib warning when pressing a key with no documents open.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/keybindings.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-07-23 16:54:32 UTC (rev 4016)
+++ trunk/ChangeLog 2009-07-23 17:11:31 UTC (rev 4017)
@@ -15,6 +15,8 @@
* src/document.c, src/editor.c:
Fix scrolling horizontally after finding a search match with the
search bar or Find Next/Previous which is off-screen.
+ * src/keybindings.c:
+ Fix GLib warning when pressing a key with no documents open.
2009-07-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2009-07-23 16:54:32 UTC (rev 4016)
+++ trunk/src/keybindings.c 2009-07-23 17:11:31 UTC (rev 4017)
@@ -917,12 +917,14 @@
GeanyKeyBinding *kb = keybindings_lookup_item(GEANY_KEY_GROUP_EDITOR,
GEANY_KEYS_EDITOR_COMPLETESNIPPET);
+ g_return_val_if_fail(doc, FALSE);
+
if (kb->key == keyval && kb->mods == state)
{
GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
/* keybinding only valid when scintilla widget has focus */
- if (doc != NULL && focusw == GTK_WIDGET(doc->editor->sci))
+ if (focusw == GTK_WIDGET(doc->editor->sci))
{
ScintillaObject *sci = doc->editor->sci;
gint pos = sci_get_current_position(sci);
@@ -1086,7 +1088,8 @@
return FALSE;
doc = document_get_current();
- document_check_disk_status(doc, FALSE);
+ if (doc)
+ document_check_disk_status(doc, FALSE);
keyval = ev->keyval;
state = ev->state & gtk_accelerator_get_default_mod_mask();
@@ -1103,7 +1106,7 @@
if (vte_info.have_vte && check_vte(state, keyval))
return FALSE;
#endif
- if (check_snippet_completion(doc, keyval, state))
+ if (doc && check_snippet_completion(doc, keyval, state))
return TRUE;
if (check_menu_key(doc, keyval, state, ev->time))
return TRUE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list