PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ update_loader_config_globals_from_options_ui()

static void update_loader_config_globals_from_options_ui ( SHPLOADERCONFIG config)
static

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

536{
537 const char *entry_encoding = gtk_entry_get_text(GTK_ENTRY(entry_options_encoding));
538 gboolean preservecase = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_preservecase));
539 gboolean forceint = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_forceint));
540 gboolean createindex = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_autoindex));
541 gboolean dbfonly = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_dbfonly));
542 gboolean dumpformat = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_dumpformat));
543 gboolean geography = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_geography));
544 gboolean simplegeoms = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_simplegeoms));
545
546 if (geography)
547 {
548 config->geography = 1;
549
550 if (config->geo_col)
551 free(config->geo_col);
552
553 config->geo_col = strdup(GEOGRAPHY_DEFAULT);
554 }
555 else
556 {
557 config->geography = 0;
558
559 if (config->geo_col)
560 free(config->geo_col);
561
562 config->geo_col = strdup(GEOMETRY_DEFAULT);
563 }
564
565 /* Encoding */
566 if (entry_encoding && strlen(entry_encoding) > 0)
567 {
568 if (config->encoding)
569 free(config->encoding);
570
571 config->encoding = strdup(entry_encoding);
572 }
573
574 /* Preserve case */
575 if (preservecase)
576 config->quoteidentifiers = 1;
577 else
578 config->quoteidentifiers = 0;
579
580 /* No long integers in table */
581 if (forceint)
582 config->forceint4 = 1;
583 else
584 config->forceint4 = 0;
585
586 /* Create spatial index after load */
587 if (createindex)
588 config->createindex = 1;
589 else
590 config->createindex = 0;
591
592 /* Read the .shp file, don't ignore it */
593 if (dbfonly)
594 {
595 config->readshape = 0;
596
597 /* There will be no spatial column so don't create a spatial index */
598 config->createindex = 0;
599 }
600 else
601 config->readshape = 1;
602
603 /* Use COPY rather than INSERT format */
604 if (dumpformat)
605 config->dump_format = 1;
606 else
607 config->dump_format = 0;
608
609 /* Simple geometries only */
610 if (simplegeoms)
611 config->simple_geometries = 1;
612 else
613 config->simple_geometries = 0;
614
615 return;
616}
void free(void *)
#define GEOGRAPHY_DEFAULT
#define GEOMETRY_DEFAULT
static GtkWidget * checkbutton_loader_options_dumpformat
static GtkWidget * checkbutton_loader_options_simplegeoms
static GtkWidget * checkbutton_loader_options_forceint
static GtkWidget * checkbutton_loader_options_autoindex
static GtkWidget * checkbutton_loader_options_dbfonly
static GtkWidget * checkbutton_loader_options_preservecase
static GtkWidget * entry_options_encoding
static GtkWidget * checkbutton_loader_options_geography

References checkbutton_loader_options_autoindex, checkbutton_loader_options_dbfonly, checkbutton_loader_options_dumpformat, checkbutton_loader_options_forceint, checkbutton_loader_options_geography, checkbutton_loader_options_preservecase, checkbutton_loader_options_simplegeoms, shp_loader_config::createindex, shp_loader_config::dump_format, shp_loader_config::encoding, entry_options_encoding, shp_loader_config::forceint4, free(), shp_loader_config::geo_col, shp_loader_config::geography, GEOGRAPHY_DEFAULT, GEOMETRY_DEFAULT, shp_loader_config::quoteidentifiers, shp_loader_config::readshape, and shp_loader_config::simple_geometries.

Referenced by pgui_set_loader_configs_from_options_ui().

Here is the call graph for this function:
Here is the caller graph for this function: