[vlc-commits] Qt: rename registry functions

Jean-Baptiste Kempf git at videolan.org
Mon Jul 6 19:02:19 CEST 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jul  6 18:56:05 2015 +0200| [868cc0e54b41965a3bacf977ec1c9c201fb427f5] | committer: Jean-Baptiste Kempf

Qt: rename registry functions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=868cc0e54b41965a3bacf977ec1c9c201fb427f5
---

 modules/gui/qt4/components/simple_preferences.cpp |   28 ++++++++++-----------
 modules/gui/qt4/util/registry.cpp                 |   12 ++++-----
 modules/gui/qt4/util/registry.hpp                 |   12 ++++-----
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 526d94a..7dcff7d 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -1216,7 +1216,7 @@ void SPrefsPanel::saveLang() {
     else
     {
         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,
     const char* psz_VLC = "VLC";
     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 );
         b_temp = true;
@@ -1416,32 +1416,32 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
     QString s_path2 = s_path;
 
     /* 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 ) )
-        qvReg->WriteRegistryString( psz_ext, "VLC.backup", psz_value );
+        qvReg->WriteRegistry( psz_ext, "VLC.backup", psz_value );
     free( psz_value );
 
     /* 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 */
     if( !qvReg->RegistryKeyExists( qtu( s_path ) ) )
     {
-        qvReg->WriteRegistryString( psz_ext, "", qtu( s_path ) );
-        qvReg->WriteRegistryString( qtu( s_path ), "", "Media file" );
-        qvReg->WriteRegistryString( qtu( s_path.append( "\\shell" ) ), "", "Play" );
+        qvReg->WriteRegistry( psz_ext, "", qtu( s_path ) );
+        qvReg->WriteRegistry( qtu( s_path ), "", "Media file" );
+        qvReg->WriteRegistry( qtu( s_path.append( "\\shell" ) ), "", "Play" );
 
         /* Get the installer path */
         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() )
         {
-            qvReg->WriteRegistryString( qtu( s_path.append( "\\Play\\command" ) ),
+            qvReg->WriteRegistry( qtu( s_path.append( "\\Play\\command" ) ),
                 "", 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") ) );
         }
     }
@@ -1450,14 +1450,14 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
 void delAsso( QVLCRegistry *qvReg, const char *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 ) )
     {
         free( psz_value );
-        psz_value = qvReg->ReadRegistryString( psz_ext, "VLC.backup", "" );
+        psz_value = qvReg->ReadRegistry( psz_ext, "VLC.backup", "" );
         if( psz_value )
-            qvReg->WriteRegistryString( psz_ext, "", psz_value );
+            qvReg->WriteRegistry( psz_ext, "", psz_value );
 
         qvReg->DeleteValue( psz_ext, "VLC.backup" );
     }
diff --git a/modules/gui/qt4/util/registry.cpp b/modules/gui/qt4/util/registry.cpp
index 496a797..dfee779 100644
--- a/modules/gui/qt4/util/registry.cpp
+++ b/modules/gui/qt4/util/registry.cpp
@@ -64,7 +64,7 @@ bool QVLCRegistry::RegistryValueExists( const char *path, const char *valueName
     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;
 
@@ -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;
 
@@ -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;
     if( RegCreateKeyExA( m_RootKey, path, 0, NULL, REG_OPTION_NON_VOLATILE,
@@ -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;
     int tempValue;
     DWORD size1;
@@ -124,7 +124,7 @@ int QVLCRegistry::ReadRegistryInt( const char *path, const char *valueName, int
     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;
     char *tempValue = NULL;
@@ -153,7 +153,7 @@ char * QVLCRegistry::ReadRegistryString( const char *path, const char *valueName
     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;
     double tempValue;
diff --git a/modules/gui/qt4/util/registry.hpp b/modules/gui/qt4/util/registry.hpp
index 9cf1d3e..dcf75a4 100644
--- a/modules/gui/qt4/util/registry.hpp
+++ b/modules/gui/qt4/util/registry.hpp
@@ -33,13 +33,13 @@ public:
     QVLCRegistry(HKEY rootKey);
     ~QVLCRegistry(void) {}
 
-    void WriteRegistryInt( const char *path, const char *valueName, int value);
-    void WriteRegistryString( 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, int value);
+    void WriteRegistry( const char *path, const char *valueName, const char *value);
+    void WriteRegistry( const char *path, const char *valueName, double value);
 
-    int ReadRegistryInt( const char *path, const char *valueName, int default_value);
-    char * ReadRegistryString( const char *path, const char *valueName, const char *default_value);
-    double ReadRegistryDouble( const char *path, const char *valueName, double default_value);
+    int ReadRegistry( const char *path, const char *valueName, int default_value);
+    char * ReadRegistry( const char *path, const char *valueName, const char *default_value);
+    double ReadRegistry( const char *path, const char *valueName, double default_value);
 
     bool RegistryKeyExists( const char *path);
     bool RegistryValueExists( const char *path, const char *valueName);



More information about the vlc-commits mailing list