summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-13 11:17:24 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-13 11:17:24 +0200
commit363147061d4aa8146008d4363ee8f583cf3e88dc (patch)
treebe75932223aa81b7aced8bb4b082b2e689d06d5f /src
parentcosmetic... (diff)
parentSmall fixes (const issue, single char issue, file not ending with a new line)... (diff)
downloadrekonq-363147061d4aa8146008d4363ee8f583cf3e88dc.tar.xz
Merge commit 'refs/merge-requests/1772' of git://gitorious.org/rekonq/mainline into proxy
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/homepage.cpp2
-rw-r--r--src/mainwindow.cpp2
-rw-r--r--src/networkaccessmanager.cpp39
-rw-r--r--src/rekonq.kcfg24
-rw-r--r--src/settings.cpp15
-rw-r--r--src/settings_proxy.ui145
-rw-r--r--src/webview.cpp2
8 files changed, 32 insertions, 198 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 11fc5c6b..8b7e6f78 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,7 +34,6 @@ KDE4_ADD_UI_FILES( rekonq_SRCS
proxy.ui
settings_general.ui
settings_fonts.ui
- settings_proxy.ui
settings_webkit.ui
cleardata.ui
)
diff --git a/src/homepage.cpp b/src/homepage.cpp
index 4f1fdb44..80d0d3b6 100644
--- a/src/homepage.cpp
+++ b/src/homepage.cpp
@@ -223,7 +223,7 @@ QString HomePage::fillHistory()
{
QModelIndex son = model->index(j, 0, index );
history += son.data(HistoryModel::DateTimeRole).toDateTime().toString("hh:mm");
- history += " ";
+ history += ' ';
history += QString("<a href=\"") + son.data(HistoryModel::UrlStringRole).toString() + QString("\">") +
son.data().toString() + QString("</a>");
history += "<br />";
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 3b836186..c0008cba 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1037,7 +1037,7 @@ void MainWindow::clearPrivateData()
kDebug() << path;
QDir cacheDir(path);
QStringList fileList = cacheDir.entryList();
- foreach(QString str, fileList)
+ foreach(const QString &str, fileList)
{
kDebug() << str;
QFile file(path + str);
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index fd975062..1cdc6700 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -42,6 +42,7 @@
// KDE Includes
#include <KMessageBox>
#include <KStandardDirs>
+#include <KProtocolManager>
// Qt Includes
#include <QtCore/QPointer>
@@ -69,7 +70,7 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
// load AccessManager Settings
loadSettings();
-
+
// resetting disk cache
resetDiskCache();
}
@@ -77,23 +78,31 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
void NetworkAccessManager::loadSettings()
{
- if (ReKonfig::isProxyEnabled())
+ // Grab proxy settings from KDE settings
+ if (KProtocolManager::useProxy())
{
- QNetworkProxy proxy;
- if (ReKonfig::proxyType() == 0)
- {
- proxy.setType(QNetworkProxy::Socks5Proxy);
- }
- else
+ QString proxyAddress = KProtocolManager::proxyFor("http");
+
+ if(!proxyAddress.isEmpty())
{
- proxy.setType(QNetworkProxy::HttpProxy);
+ KUrl proxyUrl(proxyAddress);
+ QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy;
+
+ // See what kind of proxy we have here
+ if(proxyUrl.protocol() == "socks")
+ {
+ proxyType = QNetworkProxy::Socks5Proxy;
+ }
+ else
+ {
+ proxyType = QNetworkProxy::HttpProxy;
+ }
+
+ QNetworkProxy proxy(proxyType, proxyUrl.host(), (quint16)proxyUrl.port(),
+ proxyUrl.user(), proxyUrl.pass());
+
+ setProxy(proxy);
}
- proxy.setHostName(ReKonfig::proxyHostName());
- proxy.setPort(ReKonfig::proxyPort());
- proxy.setUser(ReKonfig::proxyUserName());
- proxy.setPassword(ReKonfig::proxyPassword());
-
- setProxy(proxy);
}
}
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index 0a63922f..c55fce9c 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
-<kcfg>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<!-- Includes -->
<include>QtWebKit</include>
@@ -75,25 +78,6 @@
</entry>
</group>
-<!-- Proxy Settings -->
- <group name="Proxy">
- <entry name="isProxyEnabled" type="Bool">
- <default>false</default>
- </entry>
- <entry name="proxyType" type="Int">
- <default>0</default>
- </entry>
- <entry name="proxyHostName" type="String">
- </entry>
- <entry name="proxyPort" type="Int">
- <default>8080</default>
- </entry>
- <entry name="proxyUserName" type="String">
- </entry>
- <entry name="proxyPassword" type="Password">
- </entry>
- </group>
-
<!-- WebKit Settings -->
<group name="Webkit">
<entry name="autoLoadImages" type="Bool">
diff --git a/src/settings.cpp b/src/settings.cpp
index 9711d250..9b12ef3a 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -42,7 +42,6 @@
//Ui Includes
#include "ui_settings_general.h"
#include "ui_settings_fonts.h"
-#include "ui_settings_proxy.h"
#include "ui_settings_webkit.h"
// KDE Includes
@@ -63,7 +62,6 @@ class Private
private:
Ui::general generalUi;
Ui::fonts fontsUi;
- Ui::proxy proxyUi;
Ui::webkit webkitUi;
KCModuleProxy *ebrowsingModule;
KCModuleProxy *cookiesModule;
@@ -85,7 +83,7 @@ Private::Private(SettingsDialog *parent)
widget->layout()->setMargin(0);
pageItem = parent->addPage(widget , i18n("General"));
pageItem->setIcon(KIcon("rekonq"));
-
+
widget = new QWidget;
fontsUi.setupUi(widget);
widget->layout()->setMargin(0);
@@ -98,12 +96,6 @@ Private::Private(SettingsDialog *parent)
pageItem->setIcon(KIcon(cookiesInfo.icon()));
widget = new QWidget;
- proxyUi.setupUi(widget);
- widget->layout()->setMargin(0);
- pageItem = parent->addPage(widget , i18n("Proxy"));
- pageItem->setIcon(KIcon("preferences-system-network"));
-
- widget = new QWidget;
webkitUi.setupUi(widget);
widget->layout()->setMargin(0);
pageItem = parent->addPage(widget , i18n("WebKit"));
@@ -187,11 +179,6 @@ void SettingsDialog::readConfig()
// ======= Fonts
d->fontsUi.kcfg_fixedFont->setOnlyFixed(true);
-
- // ======= Proxy
- bool proxyEnabled = ReKonfig::isProxyEnabled();
- d->proxyUi.groupBox->setEnabled(proxyEnabled);
- connect(d->proxyUi.kcfg_isProxyEnabled, SIGNAL(clicked(bool)), d->proxyUi.groupBox, SLOT(setEnabled(bool)));
}
diff --git a/src/settings_proxy.ui b/src/settings_proxy.ui
deleted file mode 100644
index 938529b0..00000000
--- a/src/settings_proxy.ui
+++ /dev/null
@@ -1,145 +0,0 @@
-<ui version="4.0" >
- <class>proxy</class>
- <widget class="QWidget" name="proxy" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>440</width>
- <height>223</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Proxy</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout" >
- <item>
- <widget class="QCheckBox" name="kcfg_isProxyEnabled" >
- <property name="text" >
- <string>Enable proxy</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
- <string>Proxy Settings</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_6" >
- <item row="1" column="0" >
- <widget class="QLabel" name="label_9" >
- <property name="text" >
- <string>Type:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1" colspan="2" >
- <widget class="KComboBox" name="kcfg_proxyType" >
- <item>
- <property name="text" >
- <string>SOCKS 5</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>HTTP</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_10" >
- <property name="text" >
- <string>Host:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1" colspan="2" >
- <widget class="KLineEdit" name="kcfg_proxyHostName" />
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="label_11" >
- <property name="text" >
- <string>Port:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <widget class="QSpinBox" name="kcfg_proxyPort" >
- <property name="maximum" >
- <number>10000</number>
- </property>
- <property name="value" >
- <number>1080</number>
- </property>
- </widget>
- </item>
- <item row="3" column="2" >
- <spacer name="horizontalSpacer_2" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>293</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="0" >
- <widget class="QLabel" name="label_12" >
- <property name="text" >
- <string>Username:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="4" column="1" colspan="2" >
- <widget class="KLineEdit" name="kcfg_proxyUserName" />
- </item>
- <item row="5" column="0" >
- <widget class="QLabel" name="label_13" >
- <property name="text" >
- <string>Password:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="5" column="1" colspan="2" >
- <widget class="KLineEdit" name="kcfg_proxyPassword" />
- </item>
- <item row="6" column="0" >
- <spacer name="verticalSpacer_2" >
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>20</width>
- <height>8</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/src/webview.cpp b/src/webview.cpp
index a2662399..9e06c9da 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -432,4 +432,4 @@ void WebView::keyPressEvent(QKeyEvent *event)
return;
}
QWebView::keyPressEvent(event);
-} \ No newline at end of file
+}