X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=bd123970e5df9ca801400ad23aa4e48e3f392ff0;hb=d908f52b818f4fdf2ab23797756812ec2986bd2b;hp=c575534c060a44eca7ef4f54b58109e39abb501c;hpb=af6fd5651bf8075a0d962ba6d339373179e0195b;p=pspp-builds.git diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index c575534c..bd123970 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -29,16 +29,15 @@ #include "psppire.h" +#include +#include #include #include -#include -#include #include #include #include #include #include -#include #include #include @@ -50,7 +49,6 @@ #include "data-sheet.h" #include "var-sheet.h" #include "message-dialog.h" -#include "flexifile-factory.h" PsppireDataStore *the_data_store = 0; PsppireVarStore *the_var_store = 0; @@ -60,36 +58,18 @@ static void create_icon_factory (void); struct source_stream *the_source_stream ; struct dataset * the_dataset = NULL; -static void -replace_dictionary (struct dictionary *d) -{ - psppire_dict_replace_dictionary (the_data_store->dict, d); -} - static void -replace_flexifile (struct case_source *s) +replace_casereader (struct casereader *s) { - if ( NULL == s ) - psppire_case_file_replace_flexifile (the_data_store->case_file, - (struct flexifile *) flexifile_create (0)); - else - { - if ( ! case_source_is_class (s, &storage_source_class)) - return ; - - psppire_case_file_replace_flexifile (the_data_store->case_file, - (struct flexifile *) - storage_source_get_casefile (s)); - } -} - + PsppireCaseFile *pcf = psppire_case_file_new (s); + psppire_data_store_set_case_file (the_data_store, pcf); +} void initialize (void) { - struct casefile_factory *factory; PsppireDict *dictionary = 0; /* gtk_init messes with the locale. @@ -105,21 +85,18 @@ initialize (void) fmt_init (); settings_init (); fh_init (); - factory = flexifile_factory_create (); the_source_stream = create_source_stream ( fn_getenv_default ("STAT_INCLUDE_PATH", include_path) ); - the_dataset = create_dataset (factory, - replace_flexifile, - replace_dictionary); + the_dataset = create_dataset (NULL, NULL); + message_dialog_init (the_source_stream); - dictionary = psppire_dict_new_from_dict ( - dataset_dict (the_dataset) - ); + dictionary = psppire_dict_new_from_dict (dataset_dict (the_dataset)); + bind_textdomain_codeset (PACKAGE, "UTF-8"); @@ -127,12 +104,9 @@ initialize (void) /* Create the model for the var_sheet */ the_var_store = psppire_var_store_new (dictionary); - the_data_store = psppire_data_store_new (dictionary); + replace_casereader (NULL); - proc_set_source (the_dataset, - storage_source_create (the_data_store->case_file->flexifile) - ); create_icon_factory ();