Commit 868cc0e5 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: rename registry functions

parent e6b734ba
...@@ -1216,7 +1216,7 @@ void SPrefsPanel::saveLang() { ...@@ -1216,7 +1216,7 @@ void SPrefsPanel::saveLang() {
else else
{ {
QVLCRegistry qvReg( HKEY_CURRENT_USER ); QVLCRegistry qvReg( HKEY_CURRENT_USER );
qvReg.WriteRegistryString( "Software\\VideoLAN\\VLC\\", "Lang", lang ); qvReg.WriteRegistry( "Software\\VideoLAN\\VLC\\", "Lang", lang );
} }
} }
...@@ -1227,7 +1227,7 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current, ...@@ -1227,7 +1227,7 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
const char* psz_VLC = "VLC"; const char* psz_VLC = "VLC";
current = new QTreeWidgetItem( parent, QStringList( psz_ext ) ); current = new QTreeWidgetItem( parent, QStringList( psz_ext ) );
if( strstr( qvReg->ReadRegistryString( psz_ext, "", "" ), psz_VLC ) ) if( strstr( qvReg->ReadRegistry( psz_ext, "", "" ), psz_VLC ) )
{ {
current->setCheckState( 0, Qt::Checked ); current->setCheckState( 0, Qt::Checked );
b_temp = true; b_temp = true;
...@@ -1416,32 +1416,32 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext ) ...@@ -1416,32 +1416,32 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
QString s_path2 = s_path; QString s_path2 = s_path;
/* Save a backup if already assigned */ /* Save a backup if already assigned */
char *psz_value = qvReg->ReadRegistryString( psz_ext, "", "" ); char *psz_value = qvReg->ReadRegistry( psz_ext, "", "" );
if( !EMPTY_STR(psz_value) && strcmp( qtu(s_path), psz_value ) ) if( !EMPTY_STR(psz_value) && strcmp( qtu(s_path), psz_value ) )
qvReg->WriteRegistryString( psz_ext, "VLC.backup", psz_value ); qvReg->WriteRegistry( psz_ext, "VLC.backup", psz_value );
free( psz_value ); free( psz_value );
/* Put a "link" to VLC.EXT as default */ /* Put a "link" to VLC.EXT as default */
qvReg->WriteRegistryString( psz_ext, "", qtu( s_path ) ); qvReg->WriteRegistry( psz_ext, "", qtu( s_path ) );
/* Create the needed Key if they weren't done in the installer */ /* Create the needed Key if they weren't done in the installer */
if( !qvReg->RegistryKeyExists( qtu( s_path ) ) ) if( !qvReg->RegistryKeyExists( qtu( s_path ) ) )
{ {
qvReg->WriteRegistryString( psz_ext, "", qtu( s_path ) ); qvReg->WriteRegistry( psz_ext, "", qtu( s_path ) );
qvReg->WriteRegistryString( qtu( s_path ), "", "Media file" ); qvReg->WriteRegistry( qtu( s_path ), "", "Media file" );
qvReg->WriteRegistryString( qtu( s_path.append( "\\shell" ) ), "", "Play" ); qvReg->WriteRegistry( qtu( s_path.append( "\\shell" ) ), "", "Play" );
/* Get the installer path */ /* Get the installer path */
QVLCRegistry qvReg2( HKEY_LOCAL_MACHINE ); QVLCRegistry qvReg2( HKEY_LOCAL_MACHINE );
QString str_temp = qvReg2.ReadRegistryString( "Software\\VideoLAN\\VLC", "", "" ); QString str_temp = qvReg2.ReadRegistry( "Software\\VideoLAN\\VLC", "", "" );
if( str_temp.size() ) if( str_temp.size() )
{ {
qvReg->WriteRegistryString( qtu( s_path.append( "\\Play\\command" ) ), qvReg->WriteRegistry( qtu( s_path.append( "\\Play\\command" ) ),
"", qtu( str_temp.append(" --started-from-file \"%1\"" ) ) ); "", qtu( str_temp.append(" --started-from-file \"%1\"" ) ) );
qvReg->WriteRegistryString( qtu( s_path2.append( "\\DefaultIcon" ) ), qvReg->WriteRegistry( qtu( s_path2.append( "\\DefaultIcon" ) ),
"", qtu( str_temp.append(",0") ) ); "", qtu( str_temp.append(",0") ) );
} }
} }
...@@ -1450,14 +1450,14 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext ) ...@@ -1450,14 +1450,14 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
void delAsso( QVLCRegistry *qvReg, const char *psz_ext ) void delAsso( QVLCRegistry *qvReg, const char *psz_ext )
{ {
QString s_path( "VLC"); s_path += psz_ext; QString s_path( "VLC"); s_path += psz_ext;
char *psz_value = qvReg->ReadRegistryString( psz_ext, "", "" ); char *psz_value = qvReg->ReadRegistry( psz_ext, "", "" );
if( psz_value && !strcmp( qtu(s_path), psz_value ) ) if( psz_value && !strcmp( qtu(s_path), psz_value ) )
{ {
free( psz_value ); free( psz_value );
psz_value = qvReg->ReadRegistryString( psz_ext, "VLC.backup", "" ); psz_value = qvReg->ReadRegistry( psz_ext, "VLC.backup", "" );
if( psz_value ) if( psz_value )
qvReg->WriteRegistryString( psz_ext, "", psz_value ); qvReg->WriteRegistry( psz_ext, "", psz_value );
qvReg->DeleteValue( psz_ext, "VLC.backup" ); qvReg->DeleteValue( psz_ext, "VLC.backup" );
} }
......
...@@ -64,7 +64,7 @@ bool QVLCRegistry::RegistryValueExists( const char *path, const char *valueName ...@@ -64,7 +64,7 @@ bool QVLCRegistry::RegistryValueExists( const char *path, const char *valueName
return temp; return temp;
} }
void QVLCRegistry::WriteRegistryInt( const char *path, const char *valueName, int value ) void QVLCRegistry::WriteRegistry( const char *path, const char *valueName, int value )
{ {
HKEY keyHandle; HKEY keyHandle;
...@@ -77,7 +77,7 @@ void QVLCRegistry::WriteRegistryInt( const char *path, const char *valueName, in ...@@ -77,7 +77,7 @@ void QVLCRegistry::WriteRegistryInt( const char *path, const char *valueName, in
} }
} }
void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName, const char *value ) void QVLCRegistry::WriteRegistry( const char *path, const char *valueName, const char *value )
{ {
HKEY keyHandle; HKEY keyHandle;
...@@ -90,7 +90,7 @@ void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName, ...@@ -90,7 +90,7 @@ void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName,
} }
} }
void QVLCRegistry::WriteRegistryDouble( const char *path, const char *valueName, double value ) void QVLCRegistry::WriteRegistry( const char *path, const char *valueName, double value )
{ {
HKEY keyHandle; HKEY keyHandle;
if( RegCreateKeyExA( m_RootKey, path, 0, NULL, REG_OPTION_NON_VOLATILE, if( RegCreateKeyExA( m_RootKey, path, 0, NULL, REG_OPTION_NON_VOLATILE,
...@@ -101,7 +101,7 @@ void QVLCRegistry::WriteRegistryDouble( const char *path, const char *valueName, ...@@ -101,7 +101,7 @@ void QVLCRegistry::WriteRegistryDouble( const char *path, const char *valueName,
} }
} }
int QVLCRegistry::ReadRegistryInt( const char *path, const char *valueName, int default_value ) { int QVLCRegistry::ReadRegistry( const char *path, const char *valueName, int default_value ) {
HKEY keyHandle; HKEY keyHandle;
int tempValue; int tempValue;
DWORD size1; DWORD size1;
...@@ -124,7 +124,7 @@ int QVLCRegistry::ReadRegistryInt( const char *path, const char *valueName, int ...@@ -124,7 +124,7 @@ int QVLCRegistry::ReadRegistryInt( const char *path, const char *valueName, int
return default_value; return default_value;
} }
char * QVLCRegistry::ReadRegistryString( const char *path, const char *valueName, const char *default_value ) char * QVLCRegistry::ReadRegistry( const char *path, const char *valueName, const char *default_value )
{ {
HKEY keyHandle; HKEY keyHandle;
char *tempValue = NULL; char *tempValue = NULL;
...@@ -153,7 +153,7 @@ char * QVLCRegistry::ReadRegistryString( const char *path, const char *valueName ...@@ -153,7 +153,7 @@ char * QVLCRegistry::ReadRegistryString( const char *path, const char *valueName
return tempValue == NULL ? strdup( default_value ) : tempValue2; return tempValue == NULL ? strdup( default_value ) : tempValue2;
} }
double QVLCRegistry::ReadRegistryDouble( const char *path, const char *valueName, double default_value ) double QVLCRegistry::ReadRegistry( const char *path, const char *valueName, double default_value )
{ {
HKEY keyHandle; HKEY keyHandle;
double tempValue; double tempValue;
......
...@@ -33,13 +33,13 @@ public: ...@@ -33,13 +33,13 @@ public:
QVLCRegistry(HKEY rootKey); QVLCRegistry(HKEY rootKey);
~QVLCRegistry(void) {} ~QVLCRegistry(void) {}
void WriteRegistryInt( const char *path, const char *valueName, int value); void WriteRegistry( const char *path, const char *valueName, int value);
void WriteRegistryString( const char *path, const char *valueName, const char *value); void WriteRegistry( const char *path, const char *valueName, const char *value);
void WriteRegistryDouble( const char *path, const char *valueName, double value); void WriteRegistry( const char *path, const char *valueName, double value);
int ReadRegistryInt( const char *path, const char *valueName, int default_value); int ReadRegistry( const char *path, const char *valueName, int default_value);
char * ReadRegistryString( const char *path, const char *valueName, const char *default_value); char * ReadRegistry( const char *path, const char *valueName, const char *default_value);
double ReadRegistryDouble( const char *path, const char *valueName, double default_value); double ReadRegistry( const char *path, const char *valueName, double default_value);
bool RegistryKeyExists( const char *path); bool RegistryKeyExists( const char *path);
bool RegistryValueExists( const char *path, const char *valueName); bool RegistryValueExists( const char *path, const char *valueName);
......
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