comparison demos/browser/networkaccessmanager.d @ 74:37caa90ce503

more porting
author mandel
date Fri, 22 May 2009 23:43:58 +0000
parents 7bfd46c330dc
children 0654fc9bac95
comparison
equal deleted inserted replaced
73:7bfd46c330dc 74:37caa90ce503
65 65
66 66
67 class NetworkAccessManager : public QNetworkAccessManager 67 class NetworkAccessManager : public QNetworkAccessManager
68 { 68 {
69 public: 69 public:
70
70 this(QObject parent = null) 71 this(QObject parent = null)
71 { 72 {
72 super(parent); 73 super(parent);
73 74
74 this.authenticationRequired.connect(&authenticationRequired); 75 this.authenticationRequired.connect(&authenticationRequired);
83 diskCache.setCacheDirectory(location); 84 diskCache.setCacheDirectory(location);
84 setCache(diskCache); 85 setCache(diskCache);
85 } 86 }
86 87
87 private: 88 private:
88 QList<QString> sslTrustedHostList; 89
90 QString[] sslTrustedHostList;
89 91
90 public: 92 public:
91 93
92 void loadSettings() 94 void loadSettings()
93 { 95 {
155 auth.setUser(proxyDialog.userNameLineEdit.text()); 157 auth.setUser(proxyDialog.userNameLineEdit.text());
156 auth.setPassword(proxyDialog.passwordLineEdit.text()); 158 auth.setPassword(proxyDialog.passwordLineEdit.text());
157 } 159 }
158 } 160 }
159 161
160 version(QT_NO_OPENSSL) { 162 version(QT_NO_OPENSSL)
161 void sslErrors(QNetworkReply reply, QList<QSslError> error) 163 {
164 void sslErrors(QNetworkReply reply, QSslError[] error)
162 { 165 {
163 // check if SSL certificate has been trusted already 166 // check if SSL certificate has been trusted already
164 QString replyHost = reply.url().host() + ":" + reply.url().port(); 167 QString replyHost = reply.url().host() ~ ":" ~ reply.url().port();
165 if(! sslTrustedHostList.contains(replyHost)) { 168 if(! sslTrustedHostList.contains(replyHost)) {
166 BrowserMainWindow mainWindow = BrowserApplication.instance().mainWindow(); 169 BrowserMainWindow mainWindow = BrowserApplication.instance().mainWindow();
167 170
168 QStringList errorStrings; 171 QStringList errorStrings;
169 for (int i = 0; i < error.count(); ++i) 172 for (int i = 0; i < error.count(); ++i)