[easytag/wip/application-window: 76/105] Split off main() to a separate source file



commit b77ada21186b4eff66a9c3f82f8bfb222406bbea
Author: David King <amigadave amigadave com>
Date:   Wed Aug 6 07:47:16 2014 +0100

    Split off main() to a separate source file

 Makefile.am   |    1 +
 src/easytag.c |   29 -----------------------------
 src/main.c    |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 29 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d11f644..4569b62 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,6 +63,7 @@ easytag_SOURCES = \
        src/id3v24_tag.c \
        src/load_files_dialog.c \
        src/log.c \
+       src/main.c \
        src/misc.c \
        src/monkeyaudio_header.c \
        src/mpeg_header.c \
diff --git a/src/easytag.c b/src/easytag.c
index 6dafbf7..a79e553 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -17,7 +17,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
 #include "config.h" // For definition of ENABLE_OGG
 #include <gtk/gtk.h>
 #include <stdio.h>
@@ -38,7 +37,6 @@
 
 #include "gtk2_compat.h"
 #include "easytag.h"
-#include "application.h"
 #include "application_window.h"
 #include "browser.h"
 #include "log.h"
@@ -98,33 +96,6 @@ static void Destroy_Quit_Recursion_Function_Window (void);
 static void et_on_quit_recursion_response (GtkDialog *dialog, gint response_id,
                                            gpointer user_data);
 
-/********
- * Main *
- ********/
-int main (int argc, char *argv[])
-{
-    EtApplication *application;
-    gint status;
-
-#if ENABLE_NLS
-    textdomain (GETTEXT_PACKAGE);
-    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
-    bind_textdomain_codeset (PACKAGE_TARNAME, "UTF-8");
-#endif /* ENABLE_NLS */
-
-    INIT_DIRECTORY = NULL;
-
-#if !GLIB_CHECK_VERSION (2, 35, 1)
-    g_type_init ();
-#endif /* !GLIB_CHECK_VERSION (2, 35, 1) */
-
-    application = et_application_new ();
-    status = g_application_run (G_APPLICATION (application), argc, argv);
-    g_object_unref (application);
-
-    return status;
-}
-
 /*
  * Select a file in the "main list" using the ETFile adress of each item.
  */
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..6a7632e
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,49 @@
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+
+#include "application.h"
+#include "easytag.h"
+
+int
+main (int argc, char *argv[])
+{
+    EtApplication *application;
+    gint status;
+
+#if ENABLE_NLS
+    textdomain (GETTEXT_PACKAGE);
+    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+    bind_textdomain_codeset (PACKAGE_TARNAME, "UTF-8");
+#endif /* ENABLE_NLS */
+
+    INIT_DIRECTORY = NULL;
+
+#if !GLIB_CHECK_VERSION (2, 35, 1)
+    g_type_init ();
+#endif /* !GLIB_CHECK_VERSION (2, 35, 1) */
+
+    application = et_application_new ();
+    status = g_application_run (G_APPLICATION (application), argc, argv);
+    g_object_unref (application);
+
+    return status;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]