psppire: Remove unused function.
[pspp] / src / ui / gui / psppire.c
index 9ed7d15becb3e4757006d6bbfcc95238eb2c605e..1532cbd316fca466ad9f6ef5169db23f353cfb39 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013, 2014  Free Software Foundation
+   Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013, 2014, 2016  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -126,12 +126,23 @@ initialize (const struct init_source *is)
       break;
     case 14:
       {
-      if (is->file)
+      if (is->filename_arg != -1)
        {
+#ifndef G_OS_WIN32
+         const char *file = (*is->argv)[is->filename_arg];
          const gchar *local_encoding = NULL;
          g_get_charset (&local_encoding);
-
-         struct file_handle *fh = fh_create_file (NULL, is->file, local_encoding, fh_default_properties ());
+#else
+         char **as = g_win32_get_command_line ();
+         const char *file = as[is->filename_arg];
+         const gchar *local_encoding = "UTF-8";
+#endif   
+
+         struct file_handle *fh = fh_create_file (NULL,
+                                                  file,
+                                                  local_encoding,
+                                                  fh_default_properties ());
+         
          const char *filename = fh_get_file_name (fh);
 
          int retval = any_reader_detect (fh, NULL);
@@ -171,21 +182,9 @@ de_initialize (void)
   i18n_done ();
 }
 
-static void
-func (gpointer key, gpointer value, gpointer data)
-{
-  gboolean rv;
-  PsppireWindow *window = PSPPIRE_WINDOW (value);
-
-  g_signal_emit_by_name (window, "delete-event", 0, &rv);
-}
-
 void
 psppire_quit (void)
 {
-  PsppireWindowRegister *reg = psppire_window_register_new ();
-  psppire_window_register_foreach (reg, func, NULL);
-
   gtk_main_quit ();
 }