Mercurial > projects > qtd
comparison demos/browser/networkaccessmanager.d @ 80:85c59c4e5f19
remove QLatin1String and other fixes
author | mandel |
---|---|
date | Sun, 24 May 2009 15:25:41 +0000 |
parents | 0654fc9bac95 |
children | a8d76a9a85aa |
comparison
equal
deleted
inserted
replaced
79:957f549cfc65 | 80:85c59c4e5f19 |
---|---|
92 public: | 92 public: |
93 | 93 |
94 void loadSettings() | 94 void loadSettings() |
95 { | 95 { |
96 auto settings = new QSettings; | 96 auto settings = new QSettings; |
97 settings.beginGroup(QLatin1String("proxy")); | 97 settings.beginGroup("proxy"); |
98 QNetworkProxy proxy; | 98 QNetworkProxy proxy; |
99 if (settings.value(QLatin1String("enabled"), false).toBool()) { | 99 if (settings.value("enabled", false).toBool()) { |
100 if (settings.value(QLatin1String("type"), 0).toInt() == 0) | 100 if (settings.value("type", 0).toInt() == 0) |
101 proxy = QNetworkProxy.Socks5Proxy; | 101 proxy = QNetworkProxy.Socks5Proxy; |
102 else | 102 else |
103 proxy = QNetworkProxy.HttpProxy; | 103 proxy = QNetworkProxy.HttpProxy; |
104 proxy.setHostName(settings.value(QLatin1String("hostName")).toString()); | 104 proxy.setHostName(settings.value("hostName").toString()); |
105 proxy.setPort(settings.value(QLatin1String("port"), 1080).toInt()); | 105 proxy.setPort(settings.value("port", 1080).toInt()); |
106 proxy.setUser(settings.value(QLatin1String("userName")).toString()); | 106 proxy.setUser(settings.value("userName").toString()); |
107 proxy.setPassword(settings.value(QLatin1String("password")).toString()); | 107 proxy.setPassword(settings.value("password").toString()); |
108 } | 108 } |
109 setProxy(proxy); | 109 setProxy(proxy); |
110 } | 110 } |
111 | 111 |
112 private: | 112 private: |
167 BrowserMainWindow mainWindow = BrowserApplication.instance().mainWindow(); | 167 BrowserMainWindow mainWindow = BrowserApplication.instance().mainWindow(); |
168 | 168 |
169 string[] errorStrings; | 169 string[] errorStrings; |
170 for (int i = 0; i < error.count(); ++i) | 170 for (int i = 0; i < error.count(); ++i) |
171 errorStrings += error[i].errorString(); | 171 errorStrings += error[i].errorString(); |
172 string errors = errorStrings ~ QLatin1String("\n")); | 172 string errors = errorStrings ~ "\n"; |
173 int ret = QMessageBox.warning(mainWindow, QCoreApplication.applicationName(), | 173 int ret = QMessageBox.warning(mainWindow, QCoreApplication.applicationName(), |
174 Format(tr("SSL Errors:\n\n{}\n\n{}\n\n" | 174 Format(tr("SSL Errors:\n\n{}\n\n{}\n\n" |
175 "Do you want to ignore these errors for this host?"), reply.url().toString(), errors), | 175 "Do you want to ignore these errors for this host?"), reply.url().toString(), errors), |
176 QMessageBox.Yes | QMessageBox.No, QMessageBox.No); | 176 QMessageBox.Yes | QMessageBox.No, QMessageBox.No); |
177 if (ret == QMessageBox.Yes) { | 177 if (ret == QMessageBox.Yes) { |