Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
totem-pl-parser
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
totem-pl-parser
Commits
019cb6a7
Commit
019cb6a7
authored
Nov 12, 2019
by
Bastien Nocera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plparser: Remove g_type_class_add_private() usage
Obsoleted since glib 2.58
parent
a6f21e78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
22 deletions
+13
-22
plparse/totem-pl-parser.c
plparse/totem-pl-parser.c
+4
-8
plparse/totem-pl-playlist.c
plparse/totem-pl-playlist.c
+9
-14
No files found.
plparse/totem-pl-parser.c
View file @
019cb6a7
...
...
@@ -327,8 +327,6 @@ totem_pl_parser_class_init (TotemPlParserClass *klass)
totem_pl_parser_parent_class
=
g_type_class_peek_parent
(
klass
);
g_type_class_add_private
(
klass
,
sizeof
(
TotemPlParserPrivate
));
object_class
->
finalize
=
totem_pl_parser_finalize
;
object_class
->
set_property
=
totem_pl_parser_set_property
;
object_class
->
get_property
=
totem_pl_parser_get_property
;
...
...
@@ -1278,7 +1276,7 @@ totem_pl_parser_read_ini_line_string (char **lines, const char *key)
static
void
totem_pl_parser_init
(
TotemPlParser
*
parser
)
{
parser
->
priv
=
G_TYPE_INSTANCE_GET_PRIVATE
(
parser
,
TOTEM_TYPE_PL_PARSER
,
TotemPlParserPrivate
);
parser
->
priv
=
g_new0
(
TotemPlParserPrivate
,
1
);
parser
->
priv
->
main_thread
=
g_thread_self
();
g_mutex_init
(
&
parser
->
priv
->
ignore_mutex
);
parser
->
priv
->
ignore_schemes
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
g_free
,
NULL
);
...
...
@@ -1289,16 +1287,14 @@ totem_pl_parser_init (TotemPlParser *parser)
static
void
totem_pl_parser_finalize
(
GObject
*
object
)
{
TotemPlParserPrivate
*
priv
=
TOTEM_PL_PARSER
(
object
)
->
priv
;
g_return_if_fail
(
object
!=
NULL
);
g_return_if_fail
(
priv
!=
NULL
);
TotemPlParser
*
parser
=
TOTEM_PL_PARSER
(
object
);
TotemPlParserPrivate
*
priv
=
parser
->
priv
;
g_clear_pointer
(
&
priv
->
ignore_schemes
,
g_hash_table_destroy
);
g_clear_pointer
(
&
priv
->
ignore_mimetypes
,
g_hash_table_destroy
);
g_clear_pointer
(
&
priv
->
ignore_globs
,
g_hash_table_destroy
);
g_mutex_clear
(
&
priv
->
ignore_mutex
);
g_clear_pointer
(
&
parser
->
priv
,
g_free
);
G_OBJECT_CLASS
(
totem_pl_parser_parent_class
)
->
finalize
(
object
);
}
...
...
plparse/totem-pl-playlist.c
View file @
019cb6a7
...
...
@@ -51,13 +51,10 @@ struct TotemPlPlaylistPrivate {
GList
*
items
;
};
#define TOTEM_PL_PLAYLIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TOTEM_TYPE_PL_PLAYLIST, TotemPlPlaylistPrivate))
static
void
totem_pl_playlist_finalize
(
GObject
*
object
);
G_DEFINE_TYPE
(
TotemPlPlaylist
,
totem_pl_playlist
,
G_TYPE_OBJECT
)
G_DEFINE_TYPE_WITH_CODE
(
TotemPlPlaylist
,
totem_pl_playlist
,
G_TYPE_OBJECT
,
G_ADD_PRIVATE
(
TotemPlPlaylist
))
static
void
totem_pl_playlist_class_init
(
TotemPlPlaylistClass
*
klass
)
...
...
@@ -65,8 +62,6 @@ totem_pl_playlist_class_init (TotemPlPlaylistClass *klass)
GObjectClass
*
object_class
=
G_OBJECT_CLASS
(
klass
);
object_class
->
finalize
=
totem_pl_playlist_finalize
;
g_type_class_add_private
(
klass
,
sizeof
(
TotemPlPlaylistPrivate
));
}
static
void
...
...
@@ -79,7 +74,7 @@ totem_pl_playlist_finalize (GObject *object)
{
TotemPlPlaylistPrivate
*
priv
;
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
object
);
priv
=
totem_pl_playlist_get_instance_private
(
TOTEM_PL_PLAYLIST
(
object
)
);
g_list_foreach
(
priv
->
items
,
(
GFunc
)
g_hash_table_destroy
,
NULL
);
g_list_free
(
priv
->
items
);
...
...
@@ -115,7 +110,7 @@ totem_pl_playlist_size (TotemPlPlaylist *playlist)
g_return_val_if_fail
(
TOTEM_IS_PL_PLAYLIST
(
playlist
),
0
);
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
playlist
);
priv
=
totem_pl_playlist_get_instance_private
(
playlist
);
return
g_list_length
(
priv
->
items
);
}
...
...
@@ -148,7 +143,7 @@ totem_pl_playlist_prepend (TotemPlPlaylist *playlist,
g_return_if_fail
(
TOTEM_IS_PL_PLAYLIST
(
playlist
));
g_return_if_fail
(
iter
!=
NULL
);
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
playlist
);
priv
=
totem_pl_playlist_get_instance_private
(
playlist
);
item
=
create_playlist_item
();
priv
->
items
=
g_list_prepend
(
priv
->
items
,
item
);
...
...
@@ -177,7 +172,7 @@ totem_pl_playlist_append (TotemPlPlaylist *playlist,
g_return_if_fail
(
TOTEM_IS_PL_PLAYLIST
(
playlist
));
g_return_if_fail
(
iter
!=
NULL
);
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
playlist
);
priv
=
totem_pl_playlist_get_instance_private
(
playlist
);
item
=
create_playlist_item
();
...
...
@@ -214,7 +209,7 @@ totem_pl_playlist_insert (TotemPlPlaylist *playlist,
g_return_if_fail
(
TOTEM_IS_PL_PLAYLIST
(
playlist
));
g_return_if_fail
(
iter
!=
NULL
);
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
playlist
);
priv
=
totem_pl_playlist_get_instance_private
(
playlist
);
item
=
create_playlist_item
();
priv
->
items
=
g_list_insert
(
priv
->
items
,
item
,
position
);
...
...
@@ -237,7 +232,7 @@ check_iter (TotemPlPlaylist *playlist,
return
FALSE
;
}
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
playlist
);
priv
=
totem_pl_playlist_get_instance_private
(
playlist
);
if
(
g_list_position
(
priv
->
items
,
iter
->
data2
)
==
-
1
)
{
return
FALSE
;
...
...
@@ -264,7 +259,7 @@ totem_pl_playlist_iter_first (TotemPlPlaylist *playlist,
g_return_val_if_fail
(
TOTEM_IS_PL_PLAYLIST
(
playlist
),
FALSE
);
g_return_val_if_fail
(
iter
!=
NULL
,
FALSE
);
priv
=
TOTEM_PL_PLAYLIST_GET_PRIVATE
(
playlist
);
priv
=
totem_pl_playlist_get_instance_private
(
playlist
);
if
(
!
priv
->
items
)
{
/* Empty playlist */
...
...
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