nautilus-3.6.3/src/nautilus-main.c

No issues found

Incomplete coverage

Tool Failure ID Location Function Message Data
clang-analyzer no-output-found nautilus-main.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
  1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
  2 
  3 /*
  4  * Nautilus
  5  *
  6  * Copyright (C) 1999, 2000 Red Hat, Inc.
  7  * Copyright (C) 1999, 2000 Eazel, Inc.
  8  *
  9  * Nautilus is free software; you can redistribute it and/or
 10  * modify it under the terms of the GNU General Public License as
 11  * published by the Free Software Foundation; either version 2 of the
 12  * License, or (at your option) any later version.
 13  *
 14  * Nautilus is distributed in the hope that it will be useful,
 15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17  * General Public License for more details.
 18  *
 19  * You should have received a copy of the GNU General Public License
 20  * along with this program; if not, write to the Free Software
 21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 22  *
 23  * Authors: Elliot Lee <sopwith@redhat.com>,
 24  *          Darin Adler <darin@bentspoon.com>,
 25  *          John Sullivan <sullivan@eazel.com>
 26  *
 27  */
 28 
 29 /* nautilus-main.c: Implementation of the routines that drive program lifecycle and main window creation/destruction. */
 30 
 31 #include <config.h>
 32 
 33 #include "nautilus-application.h"
 34 
 35 #include <libnautilus-private/nautilus-debug.h>
 36 #include <eel/eel-debug.h>
 37 
 38 #include <glib/gi18n.h>
 39 #include <gtk/gtk.h>
 40 #include <gio/gdesktopappinfo.h>
 41 
 42 #include <libxml/parser.h>
 43 
 44 #ifdef HAVE_LOCALE_H
 45 #include <locale.h>
 46 #endif
 47 #ifdef HAVE_MALLOC_H
 48 #include <malloc.h>
 49 #endif
 50 #include <stdlib.h>
 51 #include <string.h>
 52 #include <unistd.h>
 53 
 54 #ifdef HAVE_EXEMPI
 55 #include <exempi/xmp.h>
 56 #endif
 57 
 58 int
 59 main (int argc, char *argv[])
 60 {
 61 	gint retval;
 62 	NautilusApplication *application;
 63 	
 64 #if defined (HAVE_MALLOPT) && defined(M_MMAP_THRESHOLD)
 65 	/* Nautilus uses lots and lots of small and medium size allocations,
 66 	 * and then a few large ones for the desktop background. By default
 67 	 * glibc uses a dynamic treshold for how large allocations should
 68 	 * be mmaped. Unfortunately this triggers quickly for nautilus when
 69 	 * it does the desktop background allocations, raising the limit
 70 	 * such that a lot of temporary large allocations end up on the
 71 	 * heap and are thus not returned to the OS. To fix this we set
 72 	 * a hardcoded limit. I don't know what a good value is, but 128K
 73 	 * was the old glibc static limit, lets use that.
 74 	 */
 75 	mallopt (M_MMAP_THRESHOLD, 128 *1024);
 76 #endif
 77 
 78 	g_type_init ();
 79 
 80 	/* This will be done by gtk+ later, but for now, force it to GNOME */
 81 	g_desktop_app_info_set_desktop_env ("GNOME");
 82 
 83 	if (g_getenv ("NAUTILUS_DEBUG") != NULL) {
 84 		eel_make_warnings_and_criticals_stop_in_debugger ();
 85 	}
 86 	
 87 	/* Initialize gettext support */
 88 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 89 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 90 	textdomain (GETTEXT_PACKAGE);
 91 
 92 	g_set_prgname ("nautilus");
 93 
 94 #ifdef HAVE_EXEMPI
 95 	xmp_init();
 96 #endif
 97 
 98 	/* Run the nautilus application. */
 99 	application = g_object_new (NAUTILUS_TYPE_APPLICATION,
100 				    "application-id", "org.gnome.NautilusApplication",
101 				    "flags", G_APPLICATION_HANDLES_OPEN,
102 				    NULL);
103 	retval = g_application_run (G_APPLICATION (application),
104 				    argc, argv);
105 
106 	g_object_unref (application);
107 
108  	eel_debug_shut_down ();
109 
110 	return retval;
111 }