Mercurial > geeqie.yaz
comparison src/collect-table.c @ 777:088b71bf5715
Reduce indentation level.
author | zas_ |
---|---|
date | Tue, 03 Jun 2008 08:57:46 +0000 |
parents | 9c962ffe8edc |
children | 21ec5e6d3ddf |
comparison
equal
deleted
inserted
replaced
776:9c962ffe8edc | 777:088b71bf5715 |
---|---|
127 | 127 |
128 static CollectInfo *collection_table_find_data_by_coord(CollectTable *ct, gint x, gint y, GtkTreeIter *iter) | 128 static CollectInfo *collection_table_find_data_by_coord(CollectTable *ct, gint x, gint y, GtkTreeIter *iter) |
129 { | 129 { |
130 GtkTreePath *tpath; | 130 GtkTreePath *tpath; |
131 GtkTreeViewColumn *column; | 131 GtkTreeViewColumn *column; |
132 | 132 GtkTreeModel *store; |
133 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(ct->listview), x, y, | 133 GtkTreeIter row; |
134 &tpath, &column, NULL, NULL)) | 134 GList *list; |
135 { | 135 gint n; |
136 GtkTreeModel *store; | 136 |
137 GtkTreeIter row; | 137 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(ct->listview), x, y, |
138 GList *list; | 138 &tpath, &column, NULL, NULL)) |
139 gint n; | 139 return NULL; |
140 | 140 |
141 store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview)); | 141 store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview)); |
142 gtk_tree_model_get_iter(store, &row, tpath); | 142 gtk_tree_model_get_iter(store, &row, tpath); |
143 gtk_tree_path_free(tpath); | 143 gtk_tree_path_free(tpath); |
144 | 144 |
145 gtk_tree_model_get(store, &row, CTABLE_COLUMN_POINTER, &list, -1); | 145 gtk_tree_model_get(store, &row, CTABLE_COLUMN_POINTER, &list, -1); |
146 if (!list) return NULL; | 146 if (!list) return NULL; |
147 | 147 |
148 n = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_number")); | 148 n = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_number")); |
149 if (iter) *iter = row; | 149 if (iter) *iter = row; |
150 return g_list_nth_data(list, n); | 150 return g_list_nth_data(list, n); |
151 } | |
152 | |
153 return NULL; | |
154 } | 151 } |
155 | 152 |
156 static void collection_table_update_status(CollectTable *ct) | 153 static void collection_table_update_status(CollectTable *ct) |
157 { | 154 { |
158 if (ct->status_label) | 155 gchar *buf; |
159 { | 156 |
160 gchar *buf; | 157 if (!ct->status_label) return; |
161 | 158 |
162 if (!ct->cd->list) | 159 if (!ct->cd->list) |
163 { | 160 { |
164 buf = g_strdup(_("Empty")); | 161 buf = g_strdup(_("Empty")); |
165 } | 162 } |
166 else if (ct->selection) | 163 else if (ct->selection) |
167 { | 164 { |
168 buf = g_strdup_printf(_("%d images (%d)"), g_list_length(ct->cd->list), g_list_length(ct->selection)); | 165 buf = g_strdup_printf(_("%d images (%d)"), g_list_length(ct->cd->list), g_list_length(ct->selection)); |
169 } | 166 } |
170 else | 167 else |
171 { | 168 { |
172 buf = g_strdup_printf(_("%d images"), g_list_length(ct->cd->list)); | 169 buf = g_strdup_printf(_("%d images"), g_list_length(ct->cd->list)); |
173 } | 170 } |
174 | 171 |
175 gtk_label_set_text(GTK_LABEL(ct->status_label), buf); | 172 gtk_label_set_text(GTK_LABEL(ct->status_label), buf); |
176 g_free(buf); | 173 g_free(buf); |
177 } | |
178 } | 174 } |
179 | 175 |
180 static void collection_table_update_extras(CollectTable *ct, gint loading, gdouble value) | 176 static void collection_table_update_extras(CollectTable *ct, gint loading, gdouble value) |
181 { | 177 { |
182 if (ct->extra_label) | 178 gchar *text; |
183 { | 179 |
184 gchar *text; | 180 if (!ct->extra_label) return; |
185 if (loading) | 181 |
186 text = _("Loading thumbs..."); | 182 if (loading) |
187 else | 183 text = _("Loading thumbs..."); |
188 text = " "; | 184 else |
189 | 185 text = " "; |
190 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ct->extra_label), value); | 186 |
191 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ct->extra_label), text); | 187 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ct->extra_label), value); |
192 } | 188 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ct->extra_label), text); |
193 } | 189 } |
194 | 190 |
195 static void collection_table_toggle_filenames(CollectTable *ct) | 191 static void collection_table_toggle_filenames(CollectTable *ct) |
196 { | 192 { |
197 ct->show_text = !ct->show_text; | 193 ct->show_text = !ct->show_text; |