[gcalctool] Make set default units work for both currency and conversions
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Make set default units work for both currency and conversions
- Date: Sat, 26 Mar 2011 01:20:33 +0000 (UTC)
commit 73798607bf6684e1ca927e22055eb518ab8bd013
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Mar 26 12:20:27 2011 +1100
Make set default units work for both currency and conversions
src/math-converter.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/math-converter.c b/src/math-converter.c
index 28d380f..4eb2cbc 100644
--- a/src/math-converter.c
+++ b/src/math-converter.c
@@ -225,12 +225,16 @@ math_converter_set_conversion(MathConverter *converter, /*const gchar *category,
if (!ua || !ub)
{
GtkTreeModel *model;
- GtkTreeIter iter, child_iter;
+ GtkTreeIter iter;
/* Select the first unit */
model = gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->from_combo));
- if (gtk_tree_model_get_iter_first(model, &iter) && gtk_tree_model_iter_children(model, &child_iter, &iter))
- gtk_combo_box_set_active_iter(GTK_COMBO_BOX(converter->priv->from_combo), &child_iter);
+ if (gtk_tree_model_get_iter_first(model, &iter)) {
+ GtkTreeIter child_iter;
+ while (gtk_tree_model_iter_children(model, &child_iter, &iter))
+ iter = child_iter;
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(converter->priv->from_combo), &iter);
+ }
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]