Skip to content

Commit

Permalink
feat(app,core,ui): remove ads (fixes #779)
Browse files Browse the repository at this point in the history
  • Loading branch information
trollixx committed Apr 3, 2019
1 parent f3bdf52 commit 680a1ba
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 107 deletions.
2 changes: 1 addition & 1 deletion src/app/resources/browser/assets/css/welcome.min.css

Large diffs are not rendered by default.

81 changes: 0 additions & 81 deletions src/app/resources/browser/welcome-noad.html

This file was deleted.

6 changes: 0 additions & 6 deletions src/app/resources/browser/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
<span id="version" class="has-text-weight-light is-size-5"></span>
</p>
<p class="subtitle">Docs for everyone</p>
<div id="carboncontainer" style="margin-top: 75px;">
<div id="carbon" class="box">
<script async type="text/javascript" src="https://cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=zealdocsforwindowsorg"
onerror="document.getElementById('carboncontainer').style.display = 'none';" id="_carbonads_js"></script>
</div>
</div>
</div>
<div class="column">
<p class="subtitle is-5">Customize</p>
Expand Down
1 change: 0 additions & 1 deletion src/app/resources/zeal.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<file>browser/assets/fonts/fa-brands-400.woff</file>
<file>browser/assets/fonts/fa-solid-900.woff</file>
<file>browser/welcome.html</file>
<file>browser/welcome-noad.html</file>
<file>icons/type/Abbreviation.png</file>
<file>icons/type/[email protected]</file>
<file>icons/type/Alias.png</file>
Expand Down
2 changes: 0 additions & 2 deletions src/libs/core/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ void Settings::load()
externalLinkPolicy = settings->value(QStringLiteral("external_link_policy"),
QVariant::fromValue(ExternalLinkPolicy::Ask)).value<ExternalLinkPolicy>();
isSmoothScrollingEnabled = settings->value(QStringLiteral("smooth_scrolling"), false).toBool();
isAdDisabled = settings->value(QStringLiteral("disable_ad"), false).toBool();
settings->endGroup();

settings->beginGroup(GroupProxy);
Expand Down Expand Up @@ -227,7 +226,6 @@ void Settings::save()
settings->setValue(QStringLiteral("custom_css_file"), customCssFile);
settings->setValue(QStringLiteral("external_link_policy"), QVariant::fromValue(externalLinkPolicy));
settings->setValue(QStringLiteral("smooth_scrolling"), isSmoothScrollingEnabled);
settings->setValue(QStringLiteral("disable_ad"), isAdDisabled);
settings->endGroup();

settings->beginGroup(GroupProxy);
Expand Down
1 change: 0 additions & 1 deletion src/libs/core/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class Settings final : public QObject
bool highlightOnNavigateEnabled;
QString customCssFile;
bool isSmoothScrollingEnabled;
bool isAdDisabled;

// Network
enum ProxyType : unsigned int {
Expand Down
7 changes: 1 addition & 6 deletions src/libs/ui/browsertab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ using namespace Zeal::WidgetUi;

namespace {
const char WelcomePageUrl[] = "qrc:///browser/welcome.html";
const char WelcomePageNoAdUrl[] = "qrc:///browser/welcome-noad.html";
} // namespace

BrowserTab::BrowserTab(QWidget *parent)
Expand Down Expand Up @@ -195,11 +194,7 @@ SearchSidebar *BrowserTab::searchSidebar()

void BrowserTab::navigateToStartPage()
{
if (Core::Application::instance()->settings()->isAdDisabled) {
m_webControl->load(QUrl(WelcomePageNoAdUrl));
} else {
m_webControl->load(QUrl(WelcomePageUrl));
}
m_webControl->load(QUrl(WelcomePageUrl));
}

void BrowserTab::search(const Registry::SearchQuery &query)
Expand Down
2 changes: 0 additions & 2 deletions src/libs/ui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ void SettingsDialog::loadSettings()
}

ui->useSmoothScrollingCheckBox->setChecked(settings->isSmoothScrollingEnabled);
ui->disableAdCheckBox->setChecked(settings->isAdDisabled);

// Network Tab
switch (settings->proxyType) {
Expand Down Expand Up @@ -286,7 +285,6 @@ void SettingsDialog::saveSettings()
}

settings->isSmoothScrollingEnabled = ui->useSmoothScrollingCheckBox->isChecked();
settings->isAdDisabled = ui->disableAdCheckBox->isChecked();

// Network Tab
// Proxy settings
Expand Down
7 changes: 0 additions & 7 deletions src/libs/ui/settingsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="disableAdCheckBox">
<property name="text">
<string>Disable ad&amp;vertisement on the welcome page</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 680a1ba

Please sign in to comment.