summaryrefslogtreecommitdiff
path: root/src/webpage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-09-29 17:02:39 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-09-29 17:04:28 +0200
commited9d2b80aa3fa7a190a2be2989215935cdf09b8d (patch)
tree26013ecf1ac11f2c2af983fc8025c540016a2672 /src/webpage.cpp
parentMerge branch 'master' of gitorious.org:rekonq/mainline (diff)
downloadrekonq-ed9d2b80aa3fa7a190a2be2989215935cdf09b8d.tar.xz
HACK: fix Chinese sites encoding, as suggested by Weng Xuetian in bug #251264
and by... Wikipedia!! ;) CCBUG: 251264 Xeng, does this fix your issue?
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r--src/webpage.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 07f961c5..9be0d3c9 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -207,6 +207,7 @@ WebPage::WebPage(QWidget *parent)
// ----- last stuffs
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*)));
+ connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
// protocol handler signals
@@ -471,17 +472,29 @@ 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)
{
Q_UNUSED(ok);
- Application::iconManager()->provideIcon(this, _loadingUrl);
+ // Provide site icon. Can this be moved to loadStarted??
+ Application::iconManager()->provideIcon(this, _loadingUrl);
+ // Apply adblock manager hiding rules
Application::adblockManager()->applyHidingRules(this);
- QStringList list = ReKonfig::walletBlackList();
-
// KWallet Integration
+ QStringList list = ReKonfig::walletBlackList();
if (wallet()
&& !list.contains(mainFrame()->url().toString())
)