[Marble-commits] branches/KDE/4.3/kdeedu/marble/src

Torsten Rahn tackat at kde.org
Sun Jul 12 23:43:11 CEST 2009


SVN commit 995513 by rahn:

BUG 995244: Backport of the fix.



 M  +11 -4     QtMarbleConfigDialog.cpp  
 M  +1 -2      QtMarbleConfigDialog.h  
 M  +12 -18    lib/MarbleCacheSettingsWidget.ui  
 M  +8 -0      lib/global.h  
 M  +8 -1      marble.kcfg  
 M  +11 -4     marble_part.cpp  


--- branches/KDE/4.3/kdeedu/marble/src/QtMarbleConfigDialog.cpp #995512:995513
@@ -122,10 +122,17 @@
     // Make sure that no proxy is used for an empty string or the default value: 
     if ( proxyUrl().isEmpty() || proxyUrl() == "http://" ) {
         proxy.setType( QNetworkProxy::NoProxy );
-    } else if ( proxyHttp() ) {
-        proxy.setType( QNetworkProxy::HttpProxy );
-    } else if ( proxySocks5() ) {
-        proxy.setType( QNetworkProxy::Socks5Proxy );
+    } else {
+        if ( proxyType() == Marble::Socks5Proxy ) {
+            proxy.setType( QNetworkProxy::Socks5Proxy );
+        }
+        else if ( proxyType() == Marble::HttpProxy ) {
+            proxy.setType( QNetworkProxy::HttpProxy );
+        }
+        else {
+            qDebug() << "Unknown proxy type! Using Http Proxy instead.";
+            proxy.setType( QNetworkProxy::HttpProxy );
+        }
     }
     
     proxy.setHostName( proxyUrl() );
--- branches/KDE/4.3/kdeedu/marble/src/QtMarbleConfigDialog.h #995512:995513
@@ -60,8 +60,7 @@
 
     QString proxyUser() const;
     QString proxyPass() const;
-    bool proxyHttp() const;
-    bool proxySocks5() const;
+    bool proxyType() const;
     bool proxyAuth() const;
 
     Q_SIGNALS:
--- branches/KDE/4.3/kdeedu/marble/src/lib/MarbleCacheSettingsWidget.ui #995512:995513
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>459</width>
-    <height>398</height>
+    <height>380</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -250,26 +250,20 @@
          </widget>
         </item>
         <item>
-         <widget class="QRadioButton" name="kcfg_proxyHttp">
-          <property name="text">
-           <string>Http</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
+         <widget class="QComboBox" name="kcfg_proxyType">
+          <item>
+           <property name="text">
+            <string>Http</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string>Socks5</string>
+           </property>
+          </item>
          </widget>
         </item>
         <item>
-         <widget class="QRadioButton" name="kcfg_proxySocks5">
-          <property name="text">
-           <string>Socks5</string>
-          </property>
-          <property name="checked">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
          <spacer name="horizontalSpacer">
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
--- branches/KDE/4.3/kdeedu/marble/src/lib/global.h #995512:995513
@@ -101,6 +101,14 @@
 };
 
 /**
+ * @brief This enum is used to specify the proxy that is used.
+ */
+enum ProxyType {
+    HttpProxy,          ///< Uses an Http proxy
+    Socks5Proxy         ///< Uses a Socks5Proxy
+};
+
+/**
  * @brief This enum is used to choose the localization of the labels.
  */
 enum LabelPositionFlag {
--- branches/KDE/4.3/kdeedu/marble/src/marble.kcfg #995512:995513
@@ -127,7 +127,7 @@
  <group name="Navigation" >
   <entry key="dragLocation" type="Enum" >
    <label>The behaviour of the planet's axis on mouse dragging.</label>
-   <choices name="Marble::DragLocation">
+    <choices name="Marble::DragLocation">
     <choice name="DragLocation::KeepAxisVertically"/>
     <choice name="DragLocation::FollowMousePointer"/>
    </choices>
@@ -179,6 +179,13 @@
    <label>Proxy type is HTTP</label>
    <default>true</default>
   </entry>
+  <entry name="proxyType" type="Enum">
+   <choices name="Marble::ProxyType">
+    <choice name="HttpProxy"/>
+    <choice name="Socks5Proxy"/>
+   </choices>
+   <default>Marble::HttpProxy</default>
+  </entry>
   <entry name="proxySocks5" type="Bool">
    <label>Proxy type is Socks5</label>
    <default>false</default>
--- branches/KDE/4.3/kdeedu/marble/src/marble_part.cpp #995512:995513
@@ -1024,10 +1024,17 @@
     // Make sure that no proxy is used for an empty string or the default value: 
     if ( MarbleSettings::proxyUrl().isEmpty() || MarbleSettings::proxyUrl() == "http://" ) {
         proxy.setType( QNetworkProxy::NoProxy );
-    } else if ( MarbleSettings::proxyHttp() ) {
-        proxy.setType( QNetworkProxy::HttpProxy );
-    } else if ( MarbleSettings::proxySocks5 ) {
-        proxy.setType( QNetworkProxy::Socks5Proxy );
+    } else {
+        if ( MarbleSettings::proxyType() == Marble::Socks5Proxy ) {
+            proxy.setType( QNetworkProxy::Socks5Proxy );
+        }
+        else if ( MarbleSettings::proxyType() == Marble::HttpProxy ) {
+            proxy.setType( QNetworkProxy::HttpProxy );
+        }
+        else {
+            qDebug() << "Unknown proxy type! Using Http Proxy instead.";
+            proxy.setType( QNetworkProxy::HttpProxy );
+        }
     }
     
     proxy.setHostName( MarbleSettings::proxyUrl() );


More information about the Marble-commits mailing list