PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ create_new_table_config()

static SHPDUMPERCONFIG* create_new_table_config ( GtkTreeIter *  iter)
static

Definition at line 1018 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().

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