Blame src/nautilus-main.c

Packit a189e0
/*
Packit a189e0
 * Nautilus
Packit a189e0
 *
Packit a189e0
 * Copyright (C) 1999, 2000 Red Hat, Inc.
Packit a189e0
 * Copyright (C) 1999, 2000 Eazel, Inc.
Packit a189e0
 *
Packit a189e0
 * Nautilus is free software; you can redistribute it and/or
Packit a189e0
 * modify it under the terms of the GNU General Public License as
Packit a189e0
 * published by the Free Software Foundation; either version 2 of the
Packit a189e0
 * License, or (at your option) any later version.
Packit a189e0
 *
Packit a189e0
 * Nautilus is distributed in the hope that it will be useful,
Packit a189e0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a189e0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a189e0
 * General Public License for more details.
Packit a189e0
 *
Packit a189e0
 * You should have received a copy of the GNU General Public License
Packit a189e0
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Packit a189e0
 *
Packit a189e0
 * Authors: Elliot Lee <sopwith@redhat.com>,
Packit a189e0
 *          Darin Adler <darin@bentspoon.com>,
Packit a189e0
 *          John Sullivan <sullivan@eazel.com>
Packit a189e0
 *
Packit a189e0
 */
Packit a189e0
Packit a189e0
/* nautilus-main.c: Implementation of the routines that drive program lifecycle and main window creation/destruction. */
Packit a189e0
Packit a189e0
#include <config.h>
Packit a189e0
Packit a189e0
#include "nautilus-application.h"
Packit a189e0
#include "nautilus-resources.h"
Packit a189e0
Packit a189e0
#include "nautilus-debug.h"
Packit a189e0
#include <eel/eel-debug.h>
Packit a189e0
Packit a189e0
#include <glib/gi18n.h>
Packit a189e0
#include <gtk/gtk.h>
Packit a189e0
#include <gio/gdesktopappinfo.h>
Packit a189e0
Packit a189e0
#include <libxml/parser.h>
Packit a189e0
Packit a189e0
#ifdef HAVE_LOCALE_H
Packit a189e0
#include <locale.h>
Packit a189e0
#endif
Packit a189e0
#ifdef HAVE_MALLOC_H
Packit a189e0
#include <malloc.h>
Packit a189e0
#endif
Packit a189e0
#include <stdlib.h>
Packit a189e0
#include <string.h>
Packit a189e0
#include <unistd.h>
Packit a189e0
Packit a189e0
int
Packit a189e0
main (int   argc,
Packit a189e0
      char *argv[])
Packit a189e0
{
Packit a189e0
    gint retval;
Packit a189e0
    NautilusApplication *application;
Packit a189e0
Packit a189e0
    if (g_getenv ("NAUTILUS_DEBUG") != NULL)
Packit a189e0
    {
Packit a189e0
        eel_make_warnings_and_criticals_stop_in_debugger ();
Packit a189e0
    }
Packit a189e0
Packit a189e0
    /* Initialize gettext support */
Packit a189e0
    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Packit a189e0
    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Packit a189e0
    textdomain (GETTEXT_PACKAGE);
Packit a189e0
Packit a189e0
    g_set_prgname ("nautilus");
Packit a189e0
Packit a189e0
#ifdef HAVE_EXEMPI
Packit a189e0
    xmp_init ();
Packit a189e0
#endif
Packit a189e0
    nautilus_register_resource ();
Packit a189e0
    /* Run the nautilus application. */
Packit a189e0
    application = nautilus_application_new ();
Packit a189e0
Packit a189e0
    /* hold indefinitely if we're asked to persist */
Packit a189e0
    if (g_getenv ("NAUTILUS_PERSIST") != NULL)
Packit a189e0
    {
Packit a189e0
        g_application_hold (G_APPLICATION (application));
Packit a189e0
    }
Packit a189e0
Packit a189e0
    retval = g_application_run (G_APPLICATION (application),
Packit a189e0
                                argc, argv);
Packit a189e0
Packit a189e0
    g_object_unref (application);
Packit a189e0
Packit a189e0
    eel_debug_shut_down ();
Packit a189e0
Packit a189e0
    return retval;
Packit a189e0
}