PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ create_new_table_config()

static SHPDUMPERCONFIG* create_new_table_config ( GtkTreeIter *  iter)
static

Definition at line 1017 of file shp2pgsql-gui.c.

References chooser_filtered_table_list_store, shp_dumper_config::geo_col_name, malloc(), shp_dumper_config::schema, shp_dumper_config::shp_file, shp_dumper_config::table, TABLECHOOSER_GEO_COLUMN, TABLECHOOSER_HASGEO_COLUMN, TABLECHOOSER_SCHEMA_COLUMN, and TABLECHOOSER_TABLE_COLUMN.

Referenced by pgui_action_open_table_dialog().

1018 {
1019  SHPDUMPERCONFIG *dumper_table_config;
1020  gchar *schema, *table, *geocol;
1021  gint hasgeo;
1022 
1023  /* Generate a new configuration by copying the global options first and then
1024  adding in the specific values for this table */
1025  dumper_table_config = malloc(sizeof(SHPDUMPERCONFIG));
1026  memcpy(dumper_table_config, global_dumper_config, sizeof(SHPDUMPERCONFIG));
1027 
1028  /* Grab the values from the current iter */
1029  gtk_tree_model_get(GTK_TREE_MODEL(chooser_filtered_table_list_store), iter,
1030  TABLECHOOSER_SCHEMA_COLUMN, &schema,
1031  TABLECHOOSER_TABLE_COLUMN, &table,
1032  TABLECHOOSER_GEO_COLUMN, &geocol,
1033  TABLECHOOSER_HASGEO_COLUMN, &hasgeo,
1034  -1);
1035 
1036  /* Set up the values in the SHPDUMPERCONFIG */
1037  dumper_table_config->schema = strdup(schema);
1038  dumper_table_config->table = strdup(table);
1039 
1040  /* We also set the filename the same as the table name */
1041  dumper_table_config->shp_file = strdup(table);
1042 
1043  if (hasgeo && geocol)
1044  dumper_table_config->geo_col_name = strdup(geocol);
1045  else
1046  dumper_table_config->geo_col_name = NULL;
1047 
1048  return dumper_table_config;
1049 }
static SHPDUMPERCONFIG * global_dumper_config
void * malloc(YYSIZE_T)
GtkListStore * chooser_filtered_table_list_store
Here is the call graph for this function:
Here is the caller graph for this function: