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
14034640
Commit
14034640
authored
Jul 06, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: use QVLCRegistry directly on the stack
parent
98f1ae98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+15
-19
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
14034640
...
...
@@ -1201,11 +1201,10 @@ void SPrefsPanel::configML()
#include "util/registry.hpp"
void
SPrefsPanel
::
cleanLang
()
{
QVLCRegistry
*
qvReg
=
new
QVLCRegistry
(
HKEY_CURRENT_USER
);
qvReg
->
DeleteValue
(
"Software
\\
VideoLAN
\\
VLC
\\
"
,
"Lang"
);
qvReg
->
DeleteKey
(
"Software
\\
VideoLAN
\\
"
,
"VLC"
);
qvReg
->
DeleteKey
(
"Software
\\
"
,
"VideoLAN"
);
delete
qvReg
;
QVLCRegistry
qvReg
(
HKEY_CURRENT_USER
);
qvReg
.
DeleteValue
(
"Software
\\
VideoLAN
\\
VLC
\\
"
,
"Lang"
);
qvReg
.
DeleteKey
(
"Software
\\
VideoLAN
\\
"
,
"VLC"
);
qvReg
.
DeleteKey
(
"Software
\\
"
,
"VideoLAN"
);
}
void
SPrefsPanel
::
saveLang
()
{
...
...
@@ -1216,8 +1215,8 @@ void SPrefsPanel::saveLang() {
}
else
{
QVLCRegistry
*
qvReg
=
new
QVLCRegistry
(
HKEY_CURRENT_USER
);
qvReg
->
WriteRegistryString
(
"Software
\\
VideoLAN
\\
VLC
\\
"
,
"Lang"
,
lang
);
QVLCRegistry
qvReg
(
HKEY_CURRENT_USER
);
qvReg
.
WriteRegistryString
(
"Software
\\
VideoLAN
\\
VLC
\\
"
,
"Lang"
,
lang
);
}
}
...
...
@@ -1287,7 +1286,7 @@ void SPrefsPanel::assoDialog()
assoLayout
->
addWidget
(
filetypeList
,
0
,
0
,
1
,
4
);
filetypeList
->
header
()
->
hide
();
QVLCRegistry
*
qvReg
=
new
QVLCRegistry
(
HKEY_CLASSES_ROOT
);
QVLCRegistry
qvReg
(
HKEY_CLASSES_ROOT
);
QTreeWidgetItem
*
audioType
=
new
QTreeWidgetItem
(
QStringList
(
qtr
(
"Audio Files"
)
)
);
QTreeWidgetItem
*
videoType
=
new
QTreeWidgetItem
(
QStringList
(
qtr
(
"Video Files"
)
)
);
...
...
@@ -1304,9 +1303,9 @@ void SPrefsPanel::assoDialog()
QTreeWidgetItem
*
currentItem
=
NULL
;
int
i_temp
=
0
;
#define aTa( name ) i_temp += addType( name, currentItem, audioType, qvReg )
#define aTv( name ) i_temp += addType( name, currentItem, videoType, qvReg )
#define aTo( name ) i_temp += addType( name, currentItem, otherType, qvReg )
#define aTa( name ) i_temp += addType( name, currentItem, audioType,
&
qvReg )
#define aTv( name ) i_temp += addType( name, currentItem, videoType,
&
qvReg )
#define aTo( name ) i_temp += addType( name, currentItem, otherType,
&
qvReg )
aTa
(
".3ga"
);
aTa
(
".669"
);
aTa
(
".a52"
);
aTa
(
".aac"
);
aTa
(
".ac3"
);
aTa
(
".adt"
);
aTa
(
".adts"
);
aTa
(
".aif"
);
aTa
(
".aifc"
);
aTa
(
".aiff"
);
...
...
@@ -1367,7 +1366,6 @@ void SPrefsPanel::assoDialog()
CONNECT
(
clearButton
,
clicked
(),
d
,
reject
()
);
d
->
resize
(
300
,
400
);
d
->
exec
();
delete
qvReg
;
listAsso
.
clear
();
}
...
...
@@ -1435,8 +1433,8 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
qvReg
->
WriteRegistryString
(
qtu
(
s_path
.
append
(
"
\\
shell"
)
),
""
,
"Play"
);
/* Get the installer path */
QVLCRegistry
*
qvReg2
=
new
QVLCRegistry
(
HKEY_LOCAL_MACHINE
);
QString
str_temp
=
qvReg2
->
ReadRegistryString
(
"Software
\\
VideoLAN
\\
VLC"
,
""
,
""
);
QVLCRegistry
qvReg2
(
HKEY_LOCAL_MACHINE
);
QString
str_temp
=
qvReg2
.
ReadRegistryString
(
"Software
\\
VideoLAN
\\
VLC"
,
""
,
""
);
if
(
str_temp
.
size
()
)
{
...
...
@@ -1446,7 +1444,6 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
qvReg
->
WriteRegistryString
(
qtu
(
s_path2
.
append
(
"
\\
DefaultIcon"
)
),
""
,
qtu
(
str_temp
.
append
(
",0"
)
)
);
}
delete
qvReg2
;
}
}
...
...
@@ -1469,21 +1466,20 @@ void delAsso( QVLCRegistry *qvReg, const char *psz_ext )
void
SPrefsPanel
::
saveAsso
()
{
QVLCRegistry
*
qvReg
=
new
QVLCRegistry
(
HKEY_CLASSES_ROOT
);
QVLCRegistry
qvReg
(
HKEY_CLASSES_ROOT
);
for
(
int
i
=
0
;
i
<
listAsso
.
size
();
i
++
)
{
if
(
listAsso
[
i
]
->
checkState
(
0
)
>
0
)
{
addAsso
(
qvReg
,
qtu
(
listAsso
[
i
]
->
text
(
0
)
)
);
addAsso
(
&
qvReg
,
qtu
(
listAsso
[
i
]
->
text
(
0
)
)
);
}
else
{
delAsso
(
qvReg
,
qtu
(
listAsso
[
i
]
->
text
(
0
)
)
);
delAsso
(
&
qvReg
,
qtu
(
listAsso
[
i
]
->
text
(
0
)
)
);
}
}
/* Gruik ? Naaah */
qobject_cast
<
QDialog
*>
(
listAsso
[
0
]
->
treeWidget
()
->
parent
())
->
accept
();
delete
qvReg
;
}
#endif
/* _WIN32 */
...
...
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