Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
20dc6ced
Commit
20dc6ced
authored
Jun 18, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: use QString or QByteArray instead of strdup()/free()
parent
00eb305f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
26 deletions
+23
-26
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+14
-14
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+6
-7
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+3
-5
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
20dc6ced
...
...
@@ -615,15 +615,16 @@ void ExtVideo::updateFilterOptions()
}
else
if
(
i_type
==
VLC_VAR_STRING
)
{
char
*
psz_string
=
NULL
;
if
(
lineedit
)
psz_string
=
strdup
(
qtu
(
lineedit
->
text
()
)
);
else
if
(
combobox
)
psz_string
=
strdup
(
qtu
(
combobox
->
itemData
(
combobox
->
currentIndex
()
).
toString
()
)
);
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
config_PutPsz
(
p_intf
,
qtu
(
option
),
psz_string
);
QString
val
;
if
(
lineedit
)
val
=
lineedit
->
text
();
else
if
(
combobox
)
val
=
combobox
->
itemData
(
combobox
->
currentIndex
()
).
toString
();
else
msg_Warn
(
p_intf
,
"Oops %s %s %d"
,
__FILE__
,
__func__
,
__LINE__
);
config_PutPsz
(
p_intf
,
qtu
(
option
),
qtu
(
val
)
);
if
(
b_is_command
)
var_SetString
(
p_obj
,
qtu
(
option
),
psz_string
);
free
(
psz_string
);
var_SetString
(
p_obj
,
qtu
(
option
),
qtu
(
val
)
);
}
else
msg_Err
(
p_intf
,
...
...
@@ -828,8 +829,8 @@ void ExtV4l2::ValueChange( int value )
vlc_object_t
*
p_obj
=
(
vlc_object_t
*
)
vlc_object_find_name
(
pl_Get
(
p_intf
),
"v4l2"
);
if
(
p_obj
)
{
char
*
psz_var
=
strdup
(
qtu
(
s
->
objectName
()
)
);
int
i_type
=
var_Type
(
p_obj
,
psz_var
);
QString
var
=
s
->
objectName
(
);
int
i_type
=
var_Type
(
p_obj
,
qtu
(
var
)
);
switch
(
i_type
&
VLC_VAR_TYPE
)
{
case
VLC_VAR_INTEGER
:
...
...
@@ -838,16 +839,15 @@ void ExtV4l2::ValueChange( int value )
QComboBox
*
combobox
=
qobject_cast
<
QComboBox
*>
(
s
);
value
=
combobox
->
itemData
(
value
).
toInt
();
}
var_SetInteger
(
p_obj
,
psz_var
,
value
);
var_SetInteger
(
p_obj
,
qtu
(
var
)
,
value
);
break
;
case
VLC_VAR_BOOL
:
var_SetBool
(
p_obj
,
psz_var
,
value
);
var_SetBool
(
p_obj
,
qtu
(
var
)
,
value
);
break
;
case
VLC_VAR_VOID
:
var_TriggerCallback
(
p_obj
,
psz_var
);
var_TriggerCallback
(
p_obj
,
qtu
(
var
)
);
break
;
}
free
(
psz_var
);
vlc_object_release
(
p_obj
);
}
else
...
...
modules/gui/qt4/components/simple_preferences.cpp
View file @
20dc6ced
...
...
@@ -782,14 +782,13 @@ void SPrefsPanel::apply()
case
SPrefsInputAndCodecs
:
{
/* Device default selection */
char
*
psz_
devicepath
=
strdup
(
qtu
(
qobject_cast
<
QComboBox
*>
(
optionWidgets
[
inputLE
])
->
currentText
()
)
);
if
(
!
EMPTY_STR
(
psz_devicepath
)
)
QByteArray
devicepath
=
qobject_cast
<
QComboBox
*>
(
optionWidgets
[
inputLE
])
->
currentText
().
toUtf8
(
);
if
(
devicepath
.
size
()
>
0
)
{
config_PutPsz
(
p_intf
,
"dvd"
,
psz_devicepath
);
config_PutPsz
(
p_intf
,
"vcd"
,
psz_devicepath
);
config_PutPsz
(
p_intf
,
"cd-audio"
,
psz_devicepath
);
free
(
psz_devicepath
);
config_PutPsz
(
p_intf
,
"dvd"
,
devicepath
);
config_PutPsz
(
p_intf
,
"vcd"
,
devicepath
);
config_PutPsz
(
p_intf
,
"cd-audio"
,
devicepath
);
}
#define CaCi( name, int ) config_PutInt( p_intf, name, int * i_comboValue )
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
20dc6ced
...
...
@@ -726,12 +726,10 @@ void DialogsProvider::menuUpdateAction( QObject *data )
void
DialogsProvider
::
SDMenuAction
(
const
QString
&
data
)
{
char
*
psz_sd
=
strdup
(
qtu
(
data
)
);
if
(
!
playlist_IsServicesDiscoveryLoaded
(
THEPL
,
psz_sd
)
)
playlist_ServicesDiscoveryAdd
(
THEPL
,
psz_sd
);
if
(
!
playlist_IsServicesDiscoveryLoaded
(
THEPL
,
qtu
(
data
)
)
)
playlist_ServicesDiscoveryAdd
(
THEPL
,
qtu
(
data
)
);
else
playlist_ServicesDiscoveryRemove
(
THEPL
,
psz_sd
);
free
(
psz_sd
);
playlist_ServicesDiscoveryRemove
(
THEPL
,
qtu
(
data
)
);
}
/**
...
...
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