Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
GNOME
gThumb
Commits
836702d3
Commit
836702d3
authored
Jan 01, 2019
by
Paolo Bacchilega
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed calls to g_object_newv
It's deprecated.
parent
68616090
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
19 deletions
+43
-19
gthumb/dom.c
gthumb/dom.c
+3
-3
gthumb/gth-extensions.c
gthumb/gth-extensions.c
+1
-1
gthumb/gth-main.c
gthumb/gth-main.c
+39
-15
No files found.
gthumb/dom.c
View file @
836702d3
...
...
@@ -383,7 +383,7 @@ dom_element_new (const char *a_tag_name)
g_return_val_if_fail
(
a_tag_name
!=
NULL
,
NULL
);
self
=
g_object_new
v
(
DOM_TYPE_ELEMENT
,
0
,
NULL
);
self
=
g_object_new
(
DOM_TYPE_ELEMENT
,
NULL
);
self
->
tag_name
=
(
a_tag_name
==
NULL
)
?
NULL
:
g_strdup
(
a_tag_name
);
return
self
;
...
...
@@ -605,7 +605,7 @@ dom_text_node_new (const char *a_data)
{
DomTextNode
*
self
;
self
=
g_object_new
v
(
DOM_TYPE_TEXT_NODE
,
0
,
NULL
);
self
=
g_object_new
(
DOM_TYPE_TEXT_NODE
,
NULL
);
self
->
data
=
(
a_data
==
NULL
?
g_strdup
(
""
)
:
g_strdup
(
a_data
));
return
self
;
...
...
@@ -656,7 +656,7 @@ dom_document_new (void)
{
DomDocument
*
self
;
self
=
g_object_new
v
(
DOM_TYPE_DOCUMENT
,
0
,
NULL
);
self
=
g_object_new
(
DOM_TYPE_DOCUMENT
,
NULL
);
return
g_object_ref_sink
(
self
);
}
...
...
gthumb/gth-extensions.c
View file @
836702d3
...
...
@@ -642,7 +642,7 @@ gth_extension_manager_new (void)
{
GthExtensionManager
*
manager
;
manager
=
(
GthExtensionManager
*
)
g_object_new
v
(
GTH_TYPE_EXTENSION_MANAGER
,
0
,
NULL
);
manager
=
(
GthExtensionManager
*
)
g_object_new
(
GTH_TYPE_EXTENSION_MANAGER
,
NULL
);
gth_extension_manager_load_extensions
(
manager
);
return
manager
;
...
...
gthumb/gth-main.c
View file @
836702d3
...
...
@@ -45,9 +45,10 @@ static GMutex register_mutex;
typedef
struct
{
GType
object_type
;
guint
n_params
;
GParameter
*
params
;
GType
object_type
;
guint
n_params
;
const
char
**
names
;
GValue
*
values
;
}
GthTypeSpec
;
...
...
@@ -59,7 +60,8 @@ gth_type_spec_new (GType object_type)
spec
=
g_new0
(
GthTypeSpec
,
1
);
spec
->
object_type
=
object_type
;
spec
->
n_params
=
0
;
spec
->
params
=
NULL
;
spec
->
names
=
NULL
;
spec
->
values
=
NULL
;
return
spec
;
}
...
...
@@ -69,8 +71,9 @@ static void
gth_type_spec_free
(
GthTypeSpec
*
spec
)
{
while
(
spec
->
n_params
--
)
g_value_unset
(
&
spec
->
params
[
spec
->
n_params
].
value
);
g_free
(
spec
->
params
);
g_value_unset
(
&
spec
->
values
[
spec
->
n_params
]);
g_free
(
spec
->
names
);
g_free
(
spec
->
values
);
g_free
(
spec
);
}
...
...
@@ -81,7 +84,10 @@ gth_type_spec_create_object (GthTypeSpec *spec,
{
GObject
*
object
;
object
=
g_object_newv
(
spec
->
object_type
,
spec
->
n_params
,
spec
->
params
);
object
=
g_object_new_with_properties
(
spec
->
object_type
,
spec
->
n_params
,
spec
->
names
,
spec
->
values
);
if
(
g_object_class_find_property
(
G_OBJECT_GET_CLASS
(
object
),
"id"
))
g_object_set
(
object
,
"id"
,
object_id
,
NULL
);
...
...
@@ -641,7 +647,7 @@ _gth_main_create_type_spec (GType object_type,
GObject
*
object
;
GthTypeSpec
*
type_spec
;
const
char
*
name
;
guint
n_alloced
_params
=
16
;
guint
max
_params
=
16
;
type_spec
=
gth_type_spec_new
(
object_type
);
...
...
@@ -651,8 +657,27 @@ _gth_main_create_type_spec (GType object_type,
GParamSpec
*
pspec
;
char
*
error
=
NULL
;
if
(
type_spec
->
params
==
NULL
)
type_spec
->
params
=
g_new
(
GParameter
,
n_alloced_params
);
if
(
type_spec
->
n_params
==
max_params
-
1
)
{
g_warning
(
"%s: too many params (max: %d)"
,
G_STRFUNC
,
max_params
);
break
;
}
if
(
type_spec
->
names
==
NULL
)
{
int
i
;
type_spec
->
names
=
g_new
(
const
char
*
,
max_params
);
for
(
i
=
0
;
i
<
max_params
;
i
++
)
type_spec
->
names
[
i
]
=
NULL
;
}
if
(
type_spec
->
values
==
NULL
)
{
int
i
;
type_spec
->
values
=
g_new
(
GValue
,
max_params
);
for
(
i
=
0
;
i
<
max_params
;
i
++
)
{
type_spec
->
values
[
i
].
g_type
=
0
;
}
}
pspec
=
g_object_class_find_property
(
G_OBJECT_GET_CLASS
(
object
),
name
);
if
(
pspec
==
NULL
)
{
...
...
@@ -662,14 +687,13 @@ _gth_main_create_type_spec (GType object_type,
name
);
break
;
}
type_spec
->
params
[
type_spec
->
n_params
].
name
=
name
;
type_spec
->
params
[
type_spec
->
n_params
].
value
.
g_type
=
0
;
g_value_init
(
&
type_spec
->
params
[
type_spec
->
n_params
].
value
,
G_PARAM_SPEC_VALUE_TYPE
(
pspec
));
G_VALUE_COLLECT
(
&
type_spec
->
params
[
type_spec
->
n_params
].
value
,
var_args
,
0
,
&
error
);
type_spec
->
names
[
type_spec
->
n_params
]
=
name
;
g_value_init
(
&
type_spec
->
values
[
type_spec
->
n_params
],
G_PARAM_SPEC_VALUE_TYPE
(
pspec
));
G_VALUE_COLLECT
(
&
type_spec
->
values
[
type_spec
->
n_params
],
var_args
,
0
,
&
error
);
if
(
error
!=
NULL
)
{
g_warning
(
"%s: %s"
,
G_STRFUNC
,
error
);
g_free
(
error
);
g_value_unset
(
&
type_spec
->
param
s
[
type_spec
->
n_params
]
.
value
);
g_value_unset
(
&
type_spec
->
value
s
[
type_spec
->
n_params
]);
break
;
}
type_spec
->
n_params
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment