WebBrowser/Network/SslErrorExceptionsDialog.py

branch
QtWebEngine
changeset 4820
f38e4fb83ecd
parent 4817
0a4e2fb0e93c
child 5201
21601e86a3f5
diff -r cb0672f0fc15 -r f38e4fb83ecd WebBrowser/Network/SslErrorExceptionsDialog.py
--- a/WebBrowser/Network/SslErrorExceptionsDialog.py	Sun Mar 06 17:45:24 2016 +0100
+++ b/WebBrowser/Network/SslErrorExceptionsDialog.py	Sun Mar 06 18:54:18 2016 +0100
@@ -9,7 +9,7 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import pyqtSlot, QPoint
+from PyQt5.QtCore import pyqtSlot, Qt, QPoint
 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QMenu
 from PyQt5.QtWebEngineWidgets import QWebEngineCertificateError
 
@@ -83,6 +83,7 @@
         self.errorsTree.expandAll()
         for i in range(self.errorsTree.columnCount()):
             self.errorsTree.resizeColumnToContents(i)
+        self.errorsTree.sortItems(0, Qt.AscendingOrder)
         
         self.__setRemoveButtons()
     
@@ -139,6 +140,13 @@
                 index = self.errorsTree.indexOfTopLevelItem(itm)
                 self.errorsTree.takeTopLevelItem(index)
             del itm
+        
+        # remove all hosts without an exception
+        for index in range(self.errorsTree.topLevelItemCount() - 1, -1, -1):
+            itm = self.errorsTree.topLevelItem(index)
+            if itm.childCount() == 0:
+                self.errorsTree.takeTopLevelItem(index)
+                del itm
     
     @pyqtSlot()
     def on_removeAllButton_clicked(self):

eric ide

mercurial