summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-02-14 23:33:39 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-02-14 23:33:39 +0100
commit9731934d1c45b7e6f27b58b9083b23ecbc084288 (patch)
tree20ee22f4b68b75ac54bac2afd09edc038019bf45 /src
parentAdded credit for Johannes Troscher (diff)
downloadrekonq-9731934d1c45b7e6f27b58b9083b23ecbc084288.tar.xz
This patch cleans up encoding management, moving code to
its real position: The appearance settings widget. In fact our code is actually changing "default" text encoding, not the page one "on the fly"
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp5
-rw-r--r--src/mainwindow.cpp86
-rw-r--r--src/mainwindow.h5
-rw-r--r--src/rekonq.kcfg3
-rw-r--r--src/settings/appearancewidget.cpp33
-rw-r--r--src/settings/appearancewidget.h11
-rw-r--r--src/settings/settings_appearance.ui587
-rw-r--r--src/webpage.cpp7
8 files changed, 372 insertions, 365 deletions
diff --git a/src/application.cpp b/src/application.cpp
index a49e1d80..9702c139 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -58,6 +58,8 @@
#include <ThreadWeaver/Weaver>
#include <KAction>
#include <KWindowSystem>
+#include <KGlobal>
+#include <KCharsets>
// Qt Includes
#include <QVBoxLayout>
@@ -491,6 +493,9 @@ void Application::updateConfiguration()
defaultSettings->setFontSize(QWebSettings::DefaultFontSize, qRound(defaultFontSize * toPix) );
defaultSettings->setFontSize(QWebSettings::MinimumFontSize, qRound(minimumFontSize * toPix) );
+ // encodings
+ QString enc = ReKonfig::defaultEncoding();
+ defaultSettings->setDefaultTextEncoding(enc);
// ================ WebKit ============================
defaultSettings->setAttribute(QWebSettings::AutoLoadImages, ReKonfig::autoLoadImages());
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9509e636..8744af1b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -105,7 +105,6 @@ MainWindow::MainWindow()
, m_analyzerPanel(0)
, m_historyBackMenu(0)
, m_historyForwardMenu(0)
- , m_encodingMenu(new KMenu(this))
, m_userAgentMenu(new KMenu(this))
, m_bookmarksBar(0)
, m_popup(new KPassivePopup(this))
@@ -180,7 +179,6 @@ MainWindow::~MainWindow()
delete m_stopReloadAction;
delete m_historyBackMenu;
delete m_historyForwardMenu;
- delete m_encodingMenu;
delete m_bookmarksBar;
@@ -248,7 +246,6 @@ void MainWindow::updateToolsMenu()
connect (m_zoomBar, SIGNAL(visibilityChanged(bool)), action, SLOT(setChecked(bool)));
m_toolsMenu->addAction(action);
- m_toolsMenu->addAction(actionByName(QL1S("encodings")));
m_toolsMenu->addAction(actionByName(QL1S("useragent")));
m_toolsMenu->addSeparator();
@@ -542,13 +539,6 @@ void MainWindow::setupActions()
bmMenu->setShortcut( KShortcut(Qt::ALT + Qt::Key_B) );
actionCollection()->addAction(QL1S("bookmarksActionMenu"), bmMenu);
- // ---------------- Encodings -----------------------------------
- a = new KAction(KIcon("character-set"), i18n("Set Encoding"), this);
- actionCollection()->addAction(QL1S("encodings"), a);
- a->setMenu(m_encodingMenu);
- connect(m_encodingMenu, SIGNAL(aboutToShow()), this, SLOT(populateEncodingMenu()));
- connect(m_encodingMenu, SIGNAL(triggered(QAction *)), this, SLOT(setEncoding(QAction *)));
-
// --- User Agent
a = new KAction(KIcon("preferences-web-browser-identification"), i18n("Browser Identification"), this);
actionCollection()->addAction(QL1S("useragent"), a);
@@ -1421,24 +1411,6 @@ void MainWindow::openActionTab(QAction* action)
}
-void MainWindow::setEncoding(QAction *qa)
-{
- QString currentCodec = qa->text().toLatin1();
- currentCodec = currentCodec.remove('&');
- kDebug() << "Setting codec: " << currentCodec;
- if(currentCodec == QL1S("Default") )
- {
- kDebug() << "QWebSettings::globalSettings()->defaultTextEncoding() = " << QWebSettings::globalSettings()->defaultTextEncoding();
- currentTab()->view()->settings()->setDefaultTextEncoding( QWebSettings::globalSettings()->defaultTextEncoding() );
- currentTab()->view()->reload();
- return;
- }
-
- currentTab()->view()->settings()->setDefaultTextEncoding(currentCodec);
- currentTab()->view()->reload();
-}
-
-
void MainWindow::setUserAgent()
{
QAction *sender = static_cast<QAction *>(QObject::sender());
@@ -1455,64 +1427,6 @@ void MainWindow::setUserAgent()
}
-void MainWindow::populateEncodingMenu()
-{
- QStringList codecs;
- QList<int> mibs = QTextCodec::availableMibs();
- Q_FOREACH (const int &mib, mibs)
- {
- QString codec = QL1S(QTextCodec::codecForMib(mib)->name());
- codecs.append(codec);
- }
- codecs.sort();
-
- QString currentCodec = currentTab()->page()->settings()->defaultTextEncoding();
-
- m_encodingMenu->clear();
- KMenu *isoMenu = new KMenu( QL1S("ISO"), m_encodingMenu);
- KMenu *winMenu = new KMenu( QL1S("Windows"), m_encodingMenu);
- KMenu *isciiMenu = new KMenu( QL1S("ISCII"), m_encodingMenu);
- KMenu *uniMenu = new KMenu( QL1S("Unicode"), m_encodingMenu);
- KMenu *otherMenu = new KMenu( i18n("Other"), m_encodingMenu);
-
- QAction *a;
- bool isDefaultCodecUsed = true;
-
- Q_FOREACH(const QString &codec, codecs)
- {
-
- if( codec.startsWith( QL1S("ISO"), Qt::CaseInsensitive ) )
- a = isoMenu->addAction(codec);
- else if( codec.startsWith( QL1S("win") ) )
- a = winMenu->addAction(codec);
- else if( codec.startsWith( QL1S("Iscii") ) )
- a = isciiMenu->addAction(codec);
- else if( codec.startsWith( QL1S("UT") ) )
- a = uniMenu->addAction(codec);
- else
- a = otherMenu->addAction(codec);
-
- a->setCheckable(true);
- if (currentCodec == codec)
- {
- a->setChecked(true);
- isDefaultCodecUsed = false;
- }
- }
-
- a = new QAction( i18nc("Default website encoding", "Default"), this);
- a->setCheckable(true);
- a->setChecked(isDefaultCodecUsed);
-
- m_encodingMenu->addAction( a );
- m_encodingMenu->addMenu( isoMenu );
- m_encodingMenu->addMenu( winMenu );
- m_encodingMenu->addMenu( isciiMenu );
- m_encodingMenu->addMenu( uniMenu );
- m_encodingMenu->addMenu( otherMenu );
-}
-
-
void MainWindow::populateUserAgentMenu()
{
kDebug() << "populating user agent menu...";
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 00bd40a5..b3bce9d8 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -166,10 +166,6 @@ private Q_SLOTS:
void openActionUrl(QAction *action);
void openActionTab(QAction *action);
- // encodings
- void setEncoding(QAction *);
- void populateEncodingMenu();
-
// user agent
void setUserAgent();
void populateUserAgentMenu();
@@ -195,7 +191,6 @@ private:
KMenu *m_historyBackMenu;
KMenu *m_historyForwardMenu;
- KMenu *m_encodingMenu;
KMenu *m_tabListMenu;
KMenu *m_userAgentMenu;
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index 704d54b6..8795104c 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -155,6 +155,9 @@
<entry name="minFontSize" type="Int">
<default>7</default>
</entry>
+ <entry name="defaultEncoding" type="String">
+ <default>ISO 8859-1</default>
+ </entry>
</group>
diff --git a/src/settings/appearancewidget.cpp b/src/settings/appearancewidget.cpp
index c444f724..f07f7b8b 100644
--- a/src/settings/appearancewidget.cpp
+++ b/src/settings/appearancewidget.cpp
@@ -31,6 +31,9 @@
// Auto Includes
#include "rekonq.h"
+// KDE Includes
+#include <KGlobal>
+#include <KCharsets>
AppearanceWidget::AppearanceWidget(QWidget *parent)
: QWidget(parent)
@@ -53,6 +56,8 @@ AppearanceWidget::AppearanceWidget(QWidget *parent)
connect(sansSerifFontChooser, SIGNAL(currentFontChanged(const QFont &)), this, SLOT( hasChanged() ));
connect(cursiveFontChooser, SIGNAL(currentFontChanged(const QFont &)), this, SLOT( hasChanged() ));
connect(fantasyFontChooser, SIGNAL(currentFontChanged(const QFont &)), this, SLOT( hasChanged() ));
+
+ populateEncodingMenu();
}
@@ -83,8 +88,32 @@ void AppearanceWidget::hasChanged()
bool AppearanceWidget::isDefault()
{
bool def = true;
-
+
// TODO: implement me!!
-
+
return def;
}
+
+
+void AppearanceWidget::populateEncodingMenu()
+{
+ encodingCombo->setEditable(false);
+ QStringList encodings = KGlobal::charsets()->availableEncodingNames();
+ encodingCombo->addItems(encodings);
+
+ encodingCombo->setWhatsThis( i18n( "Select the default encoding to be used; normally, you will be fine with 'Use language encoding' "
+ "and should not have to change this.") );
+
+ connect(encodingCombo, SIGNAL(activated(const QString &)), this, SLOT(setEncoding(const QString &)));
+ connect(encodingCombo, SIGNAL(activated(const QString &)), this, SLOT(hasChanged()));
+
+ QString enc = ReKonfig::defaultEncoding();
+ int indexOfEnc = encodings.indexOf(enc);
+ encodingCombo->setCurrentIndex(indexOfEnc);
+}
+
+
+void AppearanceWidget::setEncoding(const QString &enc)
+{
+ ReKonfig::setDefaultEncoding(enc);
+}
diff --git a/src/settings/appearancewidget.h b/src/settings/appearancewidget.h
index e2696172..5dd78517 100644
--- a/src/settings/appearancewidget.h
+++ b/src/settings/appearancewidget.h
@@ -48,14 +48,17 @@ public:
void save();
bool changed();
bool isDefault();
-
-signals:
+
+Q_SIGNALS:
void changed(bool);
-private slots:
+private Q_SLOTS:
void hasChanged();
-
+ void setEncoding(const QString &);
+
private:
+ void populateEncodingMenu();
+
bool _changed;
};
diff --git a/src/settings/settings_appearance.ui b/src/settings/settings_appearance.ui
index b25af436..0a8692d9 100644
--- a/src/settings/settings_appearance.ui
+++ b/src/settings/settings_appearance.ui
@@ -6,277 +6,342 @@
<rect>
<x>0</x>
<y>0</y>
- <width>364</width>
- <height>457</height>
+ <width>494</width>
+ <height>472</height>
</rect>
</property>
<property name="windowTitle">
<string>Appearance</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
+ <layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>Fonts</string>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <widget class="QWidget" name="tabFont">
+ <attribute name="title">
+ <string>Fonts</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Fonts</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Standard font:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Fixed font:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Serif font:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KFontComboBox" name="standardFontChooser"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Sans Serif font:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KFontComboBox" name="fixedFontChooser"/>
+ </item>
+ <item row="2" column="1">
+ <widget class="KFontComboBox" name="serifFontChooser"/>
+ </item>
+ <item row="3" column="1">
+ <widget class="KFontComboBox" name="sansSerifFontChooser"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Cursive font:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="KFontComboBox" name="cursiveFontChooser"/>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Fantasy font:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="KFontComboBox" name="fantasyFontChooser"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Size</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Default font size:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KIntNumInput" name="kcfg_defaultFontSize"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Minimal font size:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KIntNumInput" name="kcfg_minFontSize"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>Encodings</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>Default Encodings</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KComboBox" name="encodingCombo"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>84</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabStyleSheet">
+ <attribute name="title">
+ <string>Stylesheets</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>User Style Sheet</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_3">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Standard font:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KFontComboBox" name="standardFontChooser"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Fixed font:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KFontComboBox" name="fixedFontChooser"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Serif font:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="KFontComboBox" name="serifFontChooser"/>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Sans Serif font:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="KFontComboBox" name="sansSerifFontChooser"/>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Cursive font:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="KFontComboBox" name="cursiveFontChooser"/>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>Fantasy font:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="KFontComboBox" name="fantasyFontChooser"/>
- </item>
- </layout>
- </item>
- <item>
- <widget class="Line" name="line">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label_9">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Default font size:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KIntNumInput" name="kcfg_defaultFontSize"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Minimal font size:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KIntNumInput" name="kcfg_minFontSize"/>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_3">
- <property name="title">
- <string>User Style Sheet</string>
- </property>
- <layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="label_5">
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>User CSS path:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KUrlRequester" name="kcfg_userCSS">
- <property name="filter">
- <string>*.css</string>
- </property>
- </widget>
- </item>
- </layout>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>User CSS path:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KUrlRequester" name="kcfg_userCSS">
+ <property name="filter">
+ <string>*.css</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>527</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabMisc">
+ <attribute name="title">
+ <string>Misc</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="kcfg_autoScroll">
+ <property name="toolTip">
+ <string>Toggle automatic scrolling on middle click in a web page</string>
+ </property>
+ <property name="text">
+ <string>Auto-scroll on middle-click</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="kcfg_smoothScrolling">
+ <property name="toolTip">
+ <string>Scroll pages with an eye candy effect</string>
+ </property>
+ <property name="text">
+ <string>Enable smooth scrolling</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="kcfg_useFavicon">
+ <property name="text">
+ <string>Use favicon of the open website</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>513</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="groupBox_5">
- <property name="title">
- <string>Misc</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QCheckBox" name="kcfg_autoScroll">
- <property name="toolTip">
- <string>Toggle automatic scrolling on middle click in a web page</string>
- </property>
- <property name="text">
- <string>Auto-scroll on middle-click</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="kcfg_smoothScrolling">
- <property name="toolTip">
- <string>Scroll pages with an eye candy effect</string>
- </property>
- <property name="text">
- <string>Enable smooth scrolling</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="kcfg_useFavicon">
- <property name="text">
- <string>Use favicon of the open website</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<customwidgets>
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 791bb367..b44b2e4d 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -532,13 +532,6 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply)
void WebPage::loadStarted()
{
- // HACK:
- // Chinese encoding Fix. See BUG: 251264
- // Use gb18030 instead of gb2312
- if(settings()->defaultTextEncoding() == QL1S("gb2312"))
- {
- settings()->setDefaultTextEncoding( QL1S("gb18030") );
- }
}
void WebPage::loadFinished(bool ok)