No issues found
Tool | Failure ID | Location | Function | Message | Data |
---|---|---|---|---|---|
clang-analyzer | no-output-found | nautilus-metadata.c | Message(text='Unable to locate XML output from invoke-clang-analyzer') | None |
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-*/
2
3 /* nautilus-metadata.c - metadata utils
4 *
5 * Copyright (C) 2009 Red Hatl, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 */
22
23 #include <config.h>
24 #include "nautilus-metadata.h"
25 #include <glib.h>
26
27 static char *used_metadata_names[] = {
28 NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
29 NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE,
30 NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT,
31 NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY,
32 NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED,
33 NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED,
34 NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP,
35 NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN,
36 NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED,
37 NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS,
38 NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER,
39 NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY,
40 NAUTILUS_METADATA_KEY_WINDOW_SCROLL_POSITION,
41 NAUTILUS_METADATA_KEY_WINDOW_SHOW_HIDDEN_FILES,
42 NAUTILUS_METADATA_KEY_WINDOW_MAXIMIZED,
43 NAUTILUS_METADATA_KEY_WINDOW_STICKY,
44 NAUTILUS_METADATA_KEY_WINDOW_KEEP_ABOVE,
45 NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR,
46 NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE,
47 NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS,
48 NAUTILUS_METADATA_KEY_ANNOTATION,
49 NAUTILUS_METADATA_KEY_ICON_POSITION,
50 NAUTILUS_METADATA_KEY_ICON_POSITION_TIMESTAMP,
51 NAUTILUS_METADATA_KEY_ICON_SCALE,
52 NAUTILUS_METADATA_KEY_CUSTOM_ICON,
53 NAUTILUS_METADATA_KEY_CUSTOM_ICON_NAME,
54 NAUTILUS_METADATA_KEY_SCREEN,
55 NAUTILUS_METADATA_KEY_EMBLEMS,
56 NULL
57 };
58
59 guint
60 nautilus_metadata_get_id (const char *metadata)
61 {
62 static GHashTable *hash;
63 int i;
64
65 if (hash == NULL)
66 {
67 hash = g_hash_table_new (g_str_hash, g_str_equal);
68 for (i = 0; used_metadata_names[i] != NULL; i++)
69 g_hash_table_insert (hash,
70 used_metadata_names[i],
71 GINT_TO_POINTER (i + 1));
72 }
73
74 return GPOINTER_TO_INT (g_hash_table_lookup (hash, metadata));
75 }