Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
4aef58eb
Commit
4aef58eb
authored
Sep 03, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS dialog provider: drop legacy NSAutoreleasePool pattern
parent
0ea9d324
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
35 deletions
+39
-35
modules/gui/ios_dialog_provider/dialogProvider.m
modules/gui/ios_dialog_provider/dialogProvider.m
+39
-35
No files found.
modules/gui/ios_dialog_provider/dialogProvider.m
View file @
4aef58eb
...
...
@@ -161,54 +161,58 @@ void CloseIntf(vlc_object_t *p_this)
*****************************************************************************/
static
int
DisplayError
(
vlc_object_t
*
p_this
,
const
char
*
type
,
vlc_value_t
previous
,
vlc_value_t
value
,
void
*
data
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
dialog_fatal_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
[
sys
->
displayer
performSelectorOnMainThread
:
@selector
(
displayError
:)
withObject
:
DictFromDialogFatal
(
dialog
)
waitUntilDone
:
NO
];
[
pool
release
];
return
VLC_SUCCESS
;
@autoreleasepool
{
dialog_fatal_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
[
sys
->
displayer
performSelectorOnMainThread
:
@selector
(
displayError
:)
withObject:
DictFromDialogFatal
(
dialog
)
waitUntilDone:
NO
];
return
VLC_SUCCESS
;
}
}
static
int
DisplayCritical
(
vlc_object_t
*
p_this
,
const
char
*
type
,
vlc_value_t
previous
,
vlc_value_t
value
,
void
*
data
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
dialog_fatal_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
[
sys
->
displayer
performSelectorOnMainThread
:
@selector
(
displayCritical
:)
withObject
:
DictFromDialogFatal
(
dialog
)
waitUntilDone
:
NO
];
[
pool
release
];
return
VLC_SUCCESS
;
@autoreleasepool
{
dialog_fatal_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
[
sys
->
displayer
performSelectorOnMainThread
:
@selector
(
displayCritical
:)
withObject:
DictFromDialogFatal
(
dialog
)
waitUntilDone:
NO
];
return
VLC_SUCCESS
;
}
}
static
int
DisplayQuestion
(
vlc_object_t
*
p_this
,
const
char
*
type
,
vlc_value_t
previous
,
vlc_value_t
value
,
void
*
data
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
dialog_question_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
dialog
->
answer
=
[[
sys
->
displayer
displayQuestion
:
DictFromDialogQuestion
(
dialog
)]
intValue
];
[
pool
release
]
;
return
VLC_SUCCESS
;
@autoreleasepool
{
dialog_question_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
dialog
->
answer
=
[[
sys
->
displayer
displayQuestion
:
DictFromDialogQuestion
(
dialog
)]
intValue
];
return
VLC_SUCCESS
;
}
}
static
int
DisplayLogin
(
vlc_object_t
*
p_this
,
const
char
*
type
,
vlc_value_t
previous
,
vlc_value_t
value
,
void
*
data
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
dialog_login_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
NSDictionary
*
dict
=
[
sys
->
displayer
displayLogin
:
DictFromDialogLogin
(
dialog
)];
if
(
dict
)
{
NSString
*
username
=
[
dict
objectForKey
:
@"username"
];
if
(
username
!=
NULL
&&
username
.
length
>
0
)
*
dialog
->
username
=
strdup
([
username
UTF8String
]);
NSString
*
password
=
[
dict
objectForKey
:
@"password"
];
if
(
password
!=
NULL
&&
password
.
length
>
0
)
*
dialog
->
password
=
strdup
([
password
UTF8String
]);
@autoreleasepool
{
dialog_login_t
*
dialog
=
value
.
p_address
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
sys
=
p_intf
->
p_sys
;
NSDictionary
*
dict
=
[
sys
->
displayer
displayLogin
:
DictFromDialogLogin
(
dialog
)];
if
(
dict
)
{
NSString
*
username
=
[
dict
objectForKey
:
@"username"
];
if
(
username
!=
NULL
&&
username
.
length
>
0
)
*
dialog
->
username
=
strdup
([
username
UTF8String
]);
NSString
*
password
=
[
dict
objectForKey
:
@"password"
];
if
(
password
!=
NULL
&&
password
.
length
>
0
)
*
dialog
->
password
=
strdup
([
password
UTF8String
]);
}
return
VLC_SUCCESS
;
}
[
pool
release
];
return
VLC_SUCCESS
;
}
@implementation
VLCDialogDisplayer
...
...
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