gui: New type PsppireEmptyListStore.
[pspp] / src / ui / gui / psppire-dict.c
index 16576dc3aa5f80e38b58c8e21f24805b85ba236d..312220f9de3ac23263d0e242c10bc46bef00cf5f 100644 (file)
@@ -129,7 +129,7 @@ psppire_dict_class_init (PsppireDictClass *class)
 
 
   signals [VARIABLE_CHANGED] =
-    g_signal_new ("variable_changed",
+    g_signal_new ("variable-changed",
                  G_TYPE_FROM_CLASS (class),
                  G_SIGNAL_RUN_FIRST,
                  0,
@@ -142,7 +142,7 @@ psppire_dict_class_init (PsppireDictClass *class)
 
 
   signals [VARIABLE_INSERTED] =
-    g_signal_new ("variable_inserted",
+    g_signal_new ("variable-inserted",
                  G_TYPE_FROM_CLASS (class),
                  G_SIGNAL_RUN_FIRST,
                  0,
@@ -464,14 +464,17 @@ psppire_dict_set_name (PsppireDict* d, gint idx, const gchar *name)
 
 
 
-/* Return the IDXth variable in D. */
+/* Return the IDXth variable.
+   Will return NULL if IDX  exceeds the number of variables in the dictionary.
+ */
 struct variable *
 psppire_dict_get_variable (const PsppireDict *d, gint idx)
 {
   g_return_val_if_fail (d, NULL);
   g_return_val_if_fail (d->dict, NULL);
-  g_return_val_if_fail (idx < 0, NULL);
-  g_return_val_if_fail (dict_get_var_cnt (d->dict) <= idx, NULL);
+
+  if ( dict_get_var_cnt (d->dict) <= idx )
+    return NULL;
 
   return dict_get_var (d->dict, idx);
 }