Commit 5796854f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Basic implementation of the extensions. Seem to work :D Just .avi now,...

Qt4 - Basic implementation of the extensions. Seem to work :D Just .avi now, because we have no good list of extensions in the source code... :D
Ref #763
parent 5d9c12fb
...@@ -667,26 +667,41 @@ void SPrefsPanel::assoDialog() ...@@ -667,26 +667,41 @@ void SPrefsPanel::assoDialog()
delete d; delete d;
} }
void addAsso( char *psz_ext ) void addAsso( QVLCRegistry *qvReg, char *psz_ext )
{ {
char psz_VLC[] = "VLC";
char *psz_value = qvReg->ReadRegistryString( psz_ext, "", "" );
if( strlen( psz_value ) > 0 )
qvReg->WriteRegistryString( psz_ext, "VLC.backup", psz_value );
qvReg->WriteRegistryString( psz_ext, "", strcat( psz_VLC, psz_ext ) );
} }
void delAsso( char *psz_ext ) void delAsso( QVLCRegistry *qvReg, char *psz_ext )
{ {
char psz_VLC[] = "VLC";
char *psz_value = qvReg->ReadRegistryString( psz_ext, "", "" );
if( !strcmp( strcat( psz_VLC, psz_ext ), psz_value ) )
{
qvReg->WriteRegistryString( psz_ext, "",
qvReg->ReadRegistryString( psz_ext, "VLC.backup", "" ) );
// qvReg->DeletKey( psz_ext, "VLC.backup" );
}
} }
void SPrefsPanel::saveAsso() void SPrefsPanel::saveAsso()
{ {
for( int i = 0; i < listAsso.size(); i ++ ) for( int i = 0; i < listAsso.size(); i ++ )
{ {
QVLCRegistry * qvReg = new QVLCRegistry( HKEY_CLASSES_ROOT );
if( listAsso[i]->checkState() > 0 ) if( listAsso[i]->checkState() > 0 )
{ {
addAsso( qtu( listAsso[i]->text() ) ); addAsso( qvReg, qtu( listAsso[i]->text() ) );
} }
else else
{ {
delAsso( qtu( listAsso[i]->text() ) ); delAsso( qvReg, qtu( listAsso[i]->text() ) );
} }
} }
/* Gruik ? Naaah */ /* Gruik ? Naaah */
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
#include "ui/sprefs_video.h" #include "ui/sprefs_video.h"
#include "ui/sprefs_subtitles.h" #include "ui/sprefs_subtitles.h"
#include "ui/sprefs_interface.h" #include "ui/sprefs_interface.h"
#ifdef WIN32
#include "util/registry.hpp"
#endif
enum { enum {
SPrefsInterface = 0, SPrefsInterface = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment