summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/adblock/adblockmanager.h4
-rw-r--r--src/application.cpp26
2 files changed, 19 insertions, 11 deletions
diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h
index 1736b2f3..216764eb 100644
--- a/src/adblock/adblockmanager.h
+++ b/src/adblock/adblockmanager.h
@@ -64,7 +64,7 @@
// There are 3 kind of filter options:
//
// --- ### TYPE OPTIONS
-//
+//
// You can also specify a number of options to modify the behavior of a filter.
// You list these options separated with commas after a dollar sign ($) at the end of the filter
//
@@ -87,7 +87,7 @@
//
//
// --- ### INVERSE TYPE OPTIONS
-//
+//
// Inverse type options are allowed through the ~ sign, for example:
//
// RULE=*/ads/*~$script,match-case
diff --git a/src/application.cpp b/src/application.cpp
index 2d8cddb2..627536da 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -545,16 +545,19 @@ void Application::updateConfiguration()
// compute font size
// (I have to admit I know nothing about these DPI questions..: copied from kwebkitpart, as someone suggested)
// font size in pixels = font size in inches × screen dpi
- int defaultFontSize = ReKonfig::defaultFontSize();
- int minimumFontSize = ReKonfig::minFontSize();
+ if (mainWindow() && mainWindow()->currentTab())
+ {
+ int logDpiY = mainWindow()->currentTab()->view()->logicalDpiY();
+ float toPix = (logDpiY < 96.0)
+ ? 96.0 / 72.0
+ : logDpiY / 72.0 ;
- int logDpiY = mainWindow()->currentTab()->view()->logicalDpiY();
- float toPix = (logDpiY < 96.0)
- ? 96.0 / 72.0
- : logDpiY / 72.0 ;
+ int defaultFontSize = ReKonfig::defaultFontSize();
+ int minimumFontSize = ReKonfig::minFontSize();
- defaultSettings->setFontSize(QWebSettings::DefaultFontSize, qRound(defaultFontSize * toPix));
- defaultSettings->setFontSize(QWebSettings::MinimumFontSize, qRound(minimumFontSize * toPix));
+ defaultSettings->setFontSize(QWebSettings::DefaultFontSize, qRound(defaultFontSize * toPix));
+ defaultSettings->setFontSize(QWebSettings::MinimumFontSize, qRound(minimumFontSize * toPix));
+ }
// encodings
QString enc = ReKonfig::defaultEncoding();
@@ -599,6 +602,12 @@ void Application::updateConfiguration()
// ====== load Settings on main classes
historyManager()->loadSettings();
+
+ defaultSettings = 0;
+
+ if (!mainWindow())
+ return;
+
if (!ReKonfig::useFavicon())
mainWindow()->setWindowIcon(KIcon("rekonq"));
else
@@ -634,7 +643,6 @@ void Application::updateConfiguration()
break;
}
- defaultSettings = 0;
}