Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at drag_and_drop.c:323

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

dnd_data_received

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/drag_and_drop.c)expand/collapse
Show more  
 308  dnd_data_received(GtkWidget *widget _U_, GdkDragContext *dc _U_, gint x _U_, gint y _U_,
 309  GtkSelectionData *selection_data, guint info, guint t _U_, gpointer data _U_)
 310  {
 311      gpointer  dialog;
 312      gchar *cf_names_freeme;
 313   
 314      if (info == DND_TARGET_URL) {
 315          /* Usually we block incoming events by disabling the corresponding menu/toolbar items.
 316           * This is the only place where an incoming event won't be blocked in such a way,
 317           * so we have to take care of NOT loading a new file while a different process
 318           * (e.g. capture/load/...) is still in progress. */
 319   
 320  #ifdef HAVE_LIBPCAP 
 321          /* if a capture is running, do nothing but warn the user */
 322          if((global_capture_opts.state != CAPTURE_STOPPED)) {
 323              dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
 324                          ESD_BTN_OK,
 325                          "%sDrag and Drop currently not possible!%s\n\n"
 326                          "Dropping a file isn't possible while a capture is in progress.",
 327                          simple_dialog_primary_start(), simple_dialog_primary_end());
 328              return;
 329          }
 330  #endif
 331   
 332          /* if another file read is still in progress, do nothing but warn the user */
 333          if((cfile.state == FILE_READ_IN_PROGRESS)) {
 334              dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
 335                          ESD_BTN_OK,
 336                          "%sDrag and Drop currently not possible!%s\n\n"
 337                          "Dropping a file isn't possible while loading another capture file.",
 338                          simple_dialog_primary_start(), simple_dialog_primary_end());
 339              return;
 340          }
 341   
 342                  /* the selection_data will soon be gone, make a copy first */
 343                  /* the data string is not zero terminated -> make a zero terminated "copy" of it */
 344                  cf_names_freeme = g_malloc(selection_data->length + 1);
 345                  memcpy(cf_names_freeme, selection_data->data, selection_data->length);
 346                  cf_names_freeme[selection_data->length] = '\0';
 347   
 348          /* ask the user to save it's current capture file first */
 349          if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) {
 350              /* user didn't saved his current file, ask him */
 351              dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
 352                          ESD_BTNS_SAVE_DONTSAVE_CANCEL,
 353                          "%sSave capture file before opening a new one?%s\n\n"
 354                          "If you open a new capture file without saving, your current capture data will be discarded.",
 355                          simple_dialog_primary_start(), simple_dialog_primary_end());
 356              simple_dialog_set_cb(dialog, dnd_save_file_answered_cb, cf_names_freeme );
 357          } else {
 358              /* unchanged file */
 359              dnd_open_file_cmd( cf_names_freeme );
 360          }
 361      }
 362  }
Show more  




Change Warning 4052.32715 : Unused Value

Because they are very similar, this warning shares annotations with warning 4052.32716.

Priority:
State:
Finding:
Owner:
Note: