export_object_list_gui_t *object_list = (export_object_list_gui_t*)tap_object->gui_data;
GSList *slist = object_list->entries;
export_object_entry_t *entry;
- gboolean all_saved = TRUE;
gchar* save_in_path = (gchar*)g_hash_table_lookup(eo_opts, proto_get_protocol_filter_name(get_eo_proto_id(object_list->eo)));
GString *safe_filename = NULL;
gchar *save_as_fullpath = NULL;
g_string_free(safe_filename, TRUE);
} while (g_file_test(save_as_fullpath, G_FILE_TEST_EXISTS) && ++count < 1000);
count = 0;
- if (!eo_save_entry(save_as_fullpath, entry))
- all_saved = FALSE;
+ eo_save_entry(save_as_fullpath, entry);
g_free(save_as_fullpath);
save_as_fullpath = NULL;
slist = slist->next;
}
-
- if (!all_saved)
- fprintf(stderr, "Export objects (%s): Some files could not be saved.\n",
- proto_get_protocol_filter_name(get_eo_proto_id(object_list->eo)));
}
static void
#include "export_object_ui.h"
-gboolean
+void
eo_save_entry(const gchar *save_as_filename, export_object_entry_t *entry)
{
int to_fd;
O_BINARY, 0644);
if(to_fd == -1) { /* An error occurred */
report_open_failure(save_as_filename, errno, TRUE);
- return FALSE;
+ return;
}
/*
else
bytes_to_write = (int)bytes_left;
bytes_written = ws_write(to_fd, ptr, bytes_to_write);
- if(bytes_written <= 0) {
+ if (bytes_written <= 0) {
if (bytes_written < 0)
err = errno;
else
err = WTAP_ERR_SHORT_WRITE;
report_write_failure(save_as_filename, err);
ws_close(to_fd);
- return FALSE;
+ break;
}
bytes_left -= bytes_written;
ptr += bytes_written;
}
- if (ws_close(to_fd) < 0) {
+ if (ws_close(to_fd) < 0)
report_write_failure(save_as_filename, errno);
- return FALSE;
- }
-
- return TRUE;
}
/*
/* Common between protocols */
-gboolean eo_save_entry(const gchar *save_as_filename, export_object_entry_t *entry);
+void eo_save_entry(const gchar *save_as_filename, export_object_entry_t *entry);
#ifdef __cplusplus
}
if (save_in_path.length() < 1)
return;
- if (!model_.saveAllEntries(save_in_path))
- {
- QMessageBox::warning(
- this,
- tr("Object Export"),
- tr("Some files could not be saved."),
- QMessageBox::Ok
- );
- }
+ model_.saveAllEntries(save_in_path);
}
/*
return true;
}
-bool ExportObjectModel::saveAllEntries(QString path)
+void ExportObjectModel::saveAllEntries(QString path)
{
if (path.isEmpty())
- return false;
+ return;
- bool all_saved = true;
export_object_entry_t *entry;
for (QList<QVariant>::iterator it = objects_.begin(); it != objects_.end(); ++it)
safe_filename->str, NULL);
g_string_free(safe_filename, TRUE);
} while (g_file_test(save_as_fullpath, G_FILE_TEST_EXISTS) && ++count < 1000);
- if (!eo_save_entry(save_as_fullpath, entry))
- all_saved = false;
+ eo_save_entry(save_as_fullpath, entry);
g_free(save_as_fullpath);
save_as_fullpath = NULL;
}
-
- return all_saved;
}
void ExportObjectModel::resetObjects()
void resetObjects();
bool saveEntry(QModelIndex &index, QString filename);
- bool saveAllEntries(QString path);
+ void saveAllEntries(QString path);
const char* getTapListenerName();
void* getTapData();