PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ pgui_action_handle_file_drop()

static void pgui_action_handle_file_drop ( GtkWidget *  widget,
GdkDragContext *  dc,
gint  x,
gint  y,
GtkSelectionData *  selection_data,
guint  info,
guint  t,
gpointer  data 
)
static

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

References _, pgui_logf(), and process_single_uri().

Referenced by pgui_create_import_file_table().

2060 {
2061  const gchar *p, *q;
2062 
2063  if (selection_data->data == NULL)
2064  {
2065  pgui_logf(_("Unable to process drag data."));
2066  return;
2067  }
2068 
2069  p = (char*)selection_data->data;
2070  while (p)
2071  {
2072  /* Only process non-comments */
2073  if (*p != '#')
2074  {
2075  /* Trim leading whitespace */
2076  while (g_ascii_isspace(*p))
2077  p++;
2078  q = p;
2079  /* Scan to the end of the string (null or newline) */
2080  while (*q && (*q != '\n') && (*q != '\r'))
2081  q++;
2082  if (q > p)
2083  {
2084  /* Ignore terminating character */
2085  q--;
2086  /* Trim trailing whitespace */
2087  while (q > p && g_ascii_isspace(*q))
2088  q--;
2089  if (q > p)
2090  {
2091  process_single_uri(g_strndup(p, q - p + 1));
2092  }
2093  }
2094  }
2095  /* Skip to the next entry */
2096  p = strchr(p, '\n');
2097  if (p)
2098  p++;
2099  }
2100 }
#define _(String)
Definition: shpcommon.h:24
static void pgui_logf(const char *fmt,...)
static void process_single_uri(char *uri)
Here is the call graph for this function:
Here is the caller graph for this function: