1
/* ide-devhelp-search-result.c
3
* Copyright (C) 2015 Christian Hergert <christian@hergert.me>
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#include <glib/gi18n.h>
21
#include "ide-devhelp-search-result.h"
23
struct _IdeDevhelpSearchResult
25
IdeSearchResult parent_instance;
36
G_DEFINE_TYPE (IdeDevhelpSearchResult, ide_devhelp_search_result, IDE_TYPE_SEARCH_RESULT)
38
static GParamSpec *gParamSpecs [LAST_PROP];
41
ide_devhelp_search_result_finalize (GObject *object)
43
IdeDevhelpSearchResult *self = (IdeDevhelpSearchResult *)object;
45
g_clear_pointer (&self->uri, g_free);
47
G_OBJECT_CLASS (ide_devhelp_search_result_parent_class)->finalize (object);
51
ide_devhelp_search_result_get_property (GObject *object,
56
IdeDevhelpSearchResult *self = IDE_DEVHELP_SEARCH_RESULT (object);
61
g_value_set_string (value, self->uri);
65
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
70
ide_devhelp_search_result_set_property (GObject *object,
75
IdeDevhelpSearchResult *self = IDE_DEVHELP_SEARCH_RESULT (object);
80
self->uri = g_value_dup_string (value);
84
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
89
ide_devhelp_search_result_class_init (IdeDevhelpSearchResultClass *klass)
91
GObjectClass *object_class = G_OBJECT_CLASS (klass);
93
object_class->finalize = ide_devhelp_search_result_finalize;
94
object_class->get_property = ide_devhelp_search_result_get_property;
95
object_class->set_property = ide_devhelp_search_result_set_property;
97
gParamSpecs [PROP_URI] =
98
g_param_spec_string ("uri",
100
_("The URI to the Devhelp document."),
102
(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
104
g_object_class_install_properties (object_class, LAST_PROP, gParamSpecs);
108
ide_devhelp_search_result_init (IdeDevhelpSearchResult *result)