]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/mainwindow.cpp
Add ProxyType setting in preparation of SOCKS5 proxy support.
[toast/confclerk.git] / src / gui / mainwindow.cpp
index 98a45c8e47a39b352ef554434cd1a502a531dc76..dbbcb2f275dffa6ddb96301c0468c8530022b8fb 100644 (file)
@@ -82,7 +82,7 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent) {
         AppSettings::setDirectConnection(true);
 
     QNetworkProxy proxy(
-            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
+            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : (QNetworkProxy::ProxyType)AppSettings::proxyType(),
             AppSettings::proxyAddress(),
             AppSettings::proxyPort(),
             PROXY_USERNAME,
@@ -310,7 +310,8 @@ void MainWindow::useConference(int conferenceId)
 
         // end of optimization
         // initTabs();
-    } catch (OrmException& e) {
+    } catch (const OrmException& e) {
+        qDebug() << "OrmException:" << e.text();
         // cannon set an active conference
         unsetConference();   // TODO: as no active conference is now correctly managed this should be handled as a fatal error
         return;
@@ -362,7 +363,7 @@ void MainWindow::on_settingsAction_triggered()
     if (dialog.exec() == QDialog::Accepted) {
         dialog.saveDialogData();
         QNetworkProxy proxy(
-                AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
+                AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : (QNetworkProxy::ProxyType)AppSettings::proxyType(),
                 AppSettings::proxyAddress(),
                 AppSettings::proxyPort(),
                 PROXY_USERNAME,
@@ -405,7 +406,8 @@ void MainWindow::on_conferencesAction_triggered()
     // optimization, see useConference() code
     try {
         initTabs();
-    } catch (OrmException) {
+    } catch (const OrmException& e) {
+        qDebug() << "OrmException:" << e.text();
         clearTabs();
     }
 }