Fixed a porting bug in NetworkAccessManager.

Wed, 10 Mar 2010 18:16:31 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 10 Mar 2010 18:16:31 +0000
changeset 140
64f805e1f105
parent 139
5c4f1a9ae0bb
child 141
c76f1ec28766

Fixed a porting bug in NetworkAccessManager.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Preferences.__init__.html file | annotate | diff | comparison | revisions
Helpviewer/Network/NetworkAccessManager.py file | annotate | diff | comparison | revisions
Preferences/__init__.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Wed Mar 10 17:35:26 2010 +0000
+++ b/APIs/Python3/eric5.api	Wed Mar 10 18:16:31 2010 +0000
@@ -3754,6 +3754,7 @@
 eric5.Preferences.shouldResetLayout?4(prefClass = Prefs)
 eric5.Preferences.syncPreferences?4(prefClass = Prefs)
 eric5.Preferences.toBool?4(value)
+eric5.Preferences.toByteArray?4(value)
 eric5.Preferences.toList?4(value)
 eric5.Project.AddDirectoryDialog.AddDirectoryDialog.getData?4()
 eric5.Project.AddDirectoryDialog.AddDirectoryDialog.on_filterComboBox_highlighted?4(fileType)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Wed Mar 10 17:35:26 2010 +0000
+++ b/Documentation/Help/source.qhp	Wed Mar 10 18:16:31 2010 +0000
@@ -3027,6 +3027,7 @@
       <keyword name="shouldResetLayout" id="shouldResetLayout" ref="eric5.Preferences.__init__.html#shouldResetLayout" />
       <keyword name="syncPreferences" id="syncPreferences" ref="eric5.Preferences.__init__.html#syncPreferences" />
       <keyword name="toBool" id="toBool" ref="eric5.Preferences.__init__.html#toBool" />
+      <keyword name="toByteArray" id="toByteArray" ref="eric5.Preferences.__init__.html#toByteArray" />
       <keyword name="toList" id="toList" ref="eric5.Preferences.__init__.html#toList" />
       <keyword name="PreferencesLexer (Module)" id="PreferencesLexer (Module)" ref="eric5.Preferences.PreferencesLexer.html" />
       <keyword name="PreferencesLexer" id="PreferencesLexer" ref="eric5.Preferences.PreferencesLexer.html#PreferencesLexer" />
--- a/Documentation/Source/eric5.Preferences.__init__.html	Wed Mar 10 17:35:26 2010 +0000
+++ b/Documentation/Source/eric5.Preferences.__init__.html	Wed Mar 10 18:16:31 2010 +0000
@@ -314,6 +314,9 @@
 <td><a href="#toBool">toBool</a></td>
 <td>Module function to convert a value to bool.</td>
 </tr><tr>
+<td><a href="#toByteArray">toByteArray</a></td>
+<td>Module function to convert a value to a byte array.</td>
+</tr><tr>
 <td><a href="#toList">toList</a></td>
 <td>Module function to convert a value to a list.</td>
 </tr>
@@ -2011,6 +2014,24 @@
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr /><hr />
+<a NAME="toByteArray" ID="toByteArray"></a>
+<h2>toByteArray</h2>
+<b>toByteArray</b>(<i>value</i>)
+<p>
+    Module function to convert a value to a byte array.
+</p><dl>
+<dt><i>value</i></dt>
+<dd>
+value to be converted
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+converted data
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
 <a NAME="toList" ID="toList"></a>
 <h2>toList</h2>
 <b>toList</b>(<i>value</i>)
--- a/Helpviewer/Network/NetworkAccessManager.py	Wed Mar 10 17:35:26 2010 +0000
+++ b/Helpviewer/Network/NetworkAccessManager.py	Wed Mar 10 18:16:31 2010 +0000
@@ -63,8 +63,8 @@
         if SSL_AVAILABLE:
             sslCfg = QSslConfiguration.defaultConfiguration()
             caList = sslCfg.caCertificates()
-            caNew = QSslCertificate.fromData(Preferences.Prefs.settings\
-                .value("Help/CaCertificates"))
+            caNew = QSslCertificate.fromData(Preferences.toByteArray(
+                Preferences.Prefs.settings.value("Help/CaCertificates")))
             for cert in caNew:
                 caList.append(cert)
             sslCfg.setCaCertificates(caList)
@@ -235,8 +235,8 @@
         @param reply reference to the reply object (QNetworkReply)
         @param errors list of SSL errors (list of QSslError)
         """
-        caMerge = QSslCertificate.fromData(Preferences.Prefs.settings\
-            .value("Help/CaCertificates"))
+        caMerge = QSslCertificate.fromData(Preferences.toByteArray(
+            Preferences.Prefs.settings.value("Help/CaCertificates")))
         caNew = []
         
         errorStrings = []
--- a/Preferences/__init__.py	Wed Mar 10 17:35:26 2010 +0000
+++ b/Preferences/__init__.py	Wed Mar 10 18:16:31 2010 +0000
@@ -2114,6 +2114,18 @@
         return [value]
     else:
         return value
+
+def toByteArray(value):
+    """
+    Module function to convert a value to a byte array.
+    
+    @param value value to be converted
+    @return converted data
+    """
+    if value is None:
+        return QtCore.QByteArray()
+    else:
+        return value
     
 initPreferences()
 initRecentSettings()

eric ide

mercurial