mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Make sure mConfig is properly initialized even when the part does not support
the HtmlSettingsInterface extension.
BUG: 300198
FIXED-IN: 4.8.4
(cherry picked from commit c54c6cac39
)
This commit is contained in:
parent
35b9438a1d
commit
0a71e5a4b4
1 changed files with 11 additions and 12 deletions
|
@ -120,26 +120,25 @@ static KParts::HtmlSettingsInterface* settingsInterfaceFor(QObject* obj)
|
|||
|
||||
void SettingsPlugin::showPopup()
|
||||
{
|
||||
KParts::ReadOnlyPart* part = qobject_cast<KParts::ReadOnlyPart*>(parent());
|
||||
KParts::HtmlSettingsInterface* settings = settingsInterfaceFor(part);
|
||||
if (!settings) {
|
||||
return;
|
||||
if (!mConfig) {
|
||||
mConfig = new KConfig("settingspluginrc", KConfig::NoGlobals);
|
||||
}
|
||||
|
||||
if (!mConfig)
|
||||
mConfig = new KConfig("settingspluginrc", KConfig::NoGlobals);
|
||||
|
||||
KParts::ReadOnlyPart* part = qobject_cast<KParts::ReadOnlyPart*>(parent());
|
||||
|
||||
KProtocolManager::reparseConfiguration();
|
||||
const bool cookies = cookiesEnabled( part->url().url() );
|
||||
actionCollection()->action(QLatin1String("cookies"))->setChecked(cookies);
|
||||
actionCollection()->action(QLatin1String("useproxy"))->setChecked(KProtocolManager::useProxy());
|
||||
actionCollection()->action(QLatin1String("usecache"))->setChecked(KProtocolManager::useCache());
|
||||
actionCollection()->action(QLatin1String("java"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::JavaEnabled).toBool());
|
||||
actionCollection()->action(QLatin1String("javascript"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::JavascriptEnabled).toBool());
|
||||
actionCollection()->action(QLatin1String("plugins"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::PluginsEnabled).toBool());
|
||||
actionCollection()->action(QLatin1String("imageloading"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::AutoLoadImages).toBool());
|
||||
|
||||
|
||||
KParts::HtmlSettingsInterface* settings = settingsInterfaceFor(part);
|
||||
if (settings) {
|
||||
actionCollection()->action(QLatin1String("java"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::JavaEnabled).toBool());
|
||||
actionCollection()->action(QLatin1String("javascript"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::JavascriptEnabled).toBool());
|
||||
actionCollection()->action(QLatin1String("plugins"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::PluginsEnabled).toBool());
|
||||
actionCollection()->action(QLatin1String("imageloading"))->setChecked(settings->htmlSettingsProperty(KParts::HtmlSettingsInterface::AutoLoadImages).toBool());
|
||||
}
|
||||
|
||||
KIO::CacheControl cc = KProtocolManager::cacheControl();
|
||||
switch ( cc )
|
||||
|
|
Loading…
Reference in a new issue