aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-weather.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2002-03-18 23:47:04 +0800
committerIain Holmes <iain@src.gnome.org>2002-03-18 23:47:04 +0800
commitbc73d24d04269d1cd4df99acdb511580626ca98f (patch)
treebe2344b66d4dcbfe8a28fac8446f3243f2c1b800 /my-evolution/e-summary-weather.c
parent0ae3f73824ac55fab40594bc0ee16812d0f3bbf4 (diff)
downloadgsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.tar
gsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.tar.gz
gsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.tar.bz2
gsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.tar.lz
gsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.tar.xz
gsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.tar.zst
gsoc2013-evolution-bc73d24d04269d1cd4df99acdb511580626ca98f.zip
VFolders in the summary
svn path=/trunk/; revision=16190
Diffstat (limited to 'my-evolution/e-summary-weather.c')
-rw-r--r--my-evolution/e-summary-weather.c51
1 files changed, 18 insertions, 33 deletions
diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c
index db539641d8..c121ba4927 100644
--- a/my-evolution/e-summary-weather.c
+++ b/my-evolution/e-summary-weather.c
@@ -35,7 +35,7 @@
#include <gal/widgets/e-unicode.h>
#include "e-summary.h"
-#include "e-summary-table.h"
+#include "e-summary-shown.h"
#include "e-summary-weather.h"
#include "weather.h"
#include "metar.h"
@@ -663,16 +663,15 @@ is_weather_shown (ESummaryWeather *weather,
}
void
-e_summary_weather_fill_etable (ESummaryTable *est,
+e_summary_weather_fill_etable (ESummaryShown *ess,
ESummary *summary)
{
ESummaryWeather *weather;
ETreePath region, state, location;
- ESummaryTableModelEntry *entry;
+ ESummaryShownModelEntry *entry;
char *key, *path;
int nregions, iregions;
char **regions;
- int i, n, l;
g_return_if_fail (IS_E_SUMMARY (summary));
@@ -688,7 +687,7 @@ e_summary_weather_fill_etable (ESummaryTable *est,
gnome_config_get_vector ("Main/regions", &nregions, &regions);
region = NULL;
- for (i = 0, iregions = nregions - 1; iregions >= 0; iregions--, i++) {
+ for (iregions = nregions - 1; iregions >= 0; iregions--) {
int nstates, istates;
char **states;
char *region_name;
@@ -699,21 +698,17 @@ e_summary_weather_fill_etable (ESummaryTable *est,
states_key = g_strconcat (regions[iregions], "/states", NULL);
region_name = gnome_config_get_string (region_name_key);
- region = e_summary_table_add_node (est, NULL, i, NULL);
-
- entry = g_new (ESummaryTableModelEntry, 1);
- entry->path = region;
+ entry = g_new (ESummaryShownModelEntry, 1);
entry->location = NULL;
entry->name = g_strdup (region_name);
- entry->editable = FALSE;
- entry->removable = FALSE;
- entry->shown = FALSE;
- g_hash_table_insert (est->model, entry->path, entry);
+ entry->showable = FALSE;
+ region = e_summary_shown_add_node (ess, TRUE, entry, NULL, NULL);
+
gnome_config_get_vector (states_key, &nstates, &states);
state = NULL;
- for (n = 0, istates = nstates - 1; istates >= 0; istates--, n++) {
+ for (istates = nstates - 1; istates >= 0; istates--) {
void *iter;
char *iter_key, *iter_val;
char *state_path, *state_name_key, *state_name;
@@ -722,21 +717,16 @@ e_summary_weather_fill_etable (ESummaryTable *est,
state_name_key = g_strconcat (state_path, "name", NULL);
state_name = gnome_config_get_string (state_name_key);
- state = e_summary_table_add_node (est, region, n, NULL);
-
- entry = g_new (ESummaryTableModelEntry, 1);
- entry->path = state;
+ entry = g_new (ESummaryShownModelEntry, 1);
entry->location = NULL;
entry->name = g_strdup (state_name);
- entry->editable = FALSE;
- entry->removable = FALSE;
- entry->shown = FALSE;
- g_hash_table_insert (est->model, entry->path, entry);
+ entry->showable = FALSE;
+
+ state = e_summary_shown_add_node (ess, TRUE, entry, region, NULL);
location = NULL;
iter = gnome_config_init_iterator (state_path);
- l = 0;
while ((iter = gnome_config_iterator_next (iter, &iter_key, &iter_val)) != NULL) {
if (strstr (iter_key, "loc") != NULL) {
char **locdata;
@@ -746,24 +736,19 @@ e_summary_weather_fill_etable (ESummaryTable *est,
&nlocdata,
&locdata);
g_return_if_fail (nlocdata == 4);
-
- location = e_summary_table_add_node (est, state, l, NULL);
- entry = g_new (ESummaryTableModelEntry, 1);
- entry->path = location;
+
+ entry = g_new (ESummaryShownModelEntry, 1);
entry->location = g_strdup (locdata[1]);
entry->name = g_strdup (locdata[0]);
- entry->editable = TRUE;
- entry->removable = FALSE;
-
- entry->shown = is_weather_shown (weather, locdata[1]);
- g_hash_table_insert (est->model, entry->path, entry);
+ entry->showable = TRUE;
+
+ location = e_summary_shown_add_node (ess, TRUE, entry, state, NULL);
g_strfreev (locdata);
}
g_free (iter_key);
g_free (iter_val);
- l++;
}
g_free (state_name);