Commit 8c15258b authored by Olivier Churlaud's avatar Olivier Churlaud
Browse files

Disable non SSL connections in wikipedia applet.

REVIEW: 128248
BUG: 348313
parent 05f0defd
......@@ -70,7 +70,8 @@ VERSION 2.8.90
* Check for QtBindings at runtime instead. Disable scripts and display error message
if missing. (BR 325006)
* Print playlist download errors to the debug log. (BR 325120)
* Wikipedia Applet only connect with SSL, so that redirects are handled
correctly. (BR 349313)
VERSION 2.8
FEATURES:
......
......@@ -250,14 +250,11 @@ WikipediaAppletPrivate::_loadSettings()
}
langList = list;
useMobileWikipedia = (generalSettingsUi.mobileCheckBox->checkState() == Qt::Checked);
useSSL = (generalSettingsUi.sslCheckBox->checkState() == Qt::Checked);
Amarok::config("Wikipedia Applet").writeEntry( "PreferredLang", list );
Amarok::config("Wikipedia Applet").writeEntry( "UseMobile", useMobileWikipedia );
Amarok::config( "Wikipedia Applet" ).writeEntry( "UseSSL", useSSL );
_paletteChanged( App::instance()->palette() );
dataContainer->setData( "lang", langList );
dataContainer->setData( "mobile", useMobileWikipedia );
dataContainer->setData( "ssl", useSSL );
scheduleEngineUpdate();
}
......@@ -414,7 +411,7 @@ WikipediaAppletPrivate::_getLangMap()
languageSettingsUi.progressBar->setValue( 0 );
KUrl url;
url.setScheme( "http" );
url.setScheme( "https" );
url.setHost( "en.wikipedia.org" );
url.setPath( "/w/api.php" );
url.addQueryItem( "action", "query" );
......@@ -663,7 +660,6 @@ WikipediaApplet::init()
d->_paletteChanged( App::instance()->palette() );
d->dataContainer->setData( "lang", d->langList );
d->dataContainer->setData( "mobile", d->useMobileWikipedia );
d->dataContainer->setData( "ssl", d->useSSL );
d->scheduleEngineUpdate();
updateConstraints();
......@@ -792,7 +788,6 @@ WikipediaApplet::createConfigurationInterface( KConfigDialog *parent )
QWidget *genSettings = new QWidget;
d->generalSettingsUi.setupUi( genSettings );
d->generalSettingsUi.mobileCheckBox->setCheckState( d->useMobileWikipedia ? Qt::Checked : Qt::Unchecked );
d->generalSettingsUi.sslCheckBox->setCheckState( d->useSSL ? Qt::Checked : Qt::Unchecked );
connect( d->languageSettingsUi.downloadButton, SIGNAL(clicked()), this, SLOT(_getLangMap()) );
connect( parent, SIGNAL(okClicked()), this, SLOT(_loadSettings()) );
......
......@@ -143,7 +143,6 @@ public:
bool isForwardHistory;
bool isBackwardHistory;
bool useMobileWikipedia;
bool useSSL;
};
class WikipediaSearchLineEdit : public Plasma::LineEdit
......
......@@ -32,13 +32,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="sslCheckBox">
<property name="text">
<string>Use &amp;SSL</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......
......@@ -45,7 +45,6 @@ public:
: q_ptr( parent )
, currentSelection( Artist )
, useMobileVersion( false )
, useSSL( true )
, dataContainer( 0 )
{}
~WikipediaEnginePrivate() {}
......@@ -89,7 +88,6 @@ public:
}
} m_previousTrackMetadata;
bool useMobileVersion;
bool useSSL;
Plasma::DataContainer *dataContainer;
......@@ -171,16 +169,6 @@ WikipediaEnginePrivate::_dataContainerUpdated( const QString &source, const Plas
}
}
if( data.contains( QLatin1String("ssl") ) )
{
const bool ssl = data.value( QLatin1String("ssl") ).toBool();
if( ssl != useSSL )
{
useSSL = ssl;
updateEngine();
}
}
if( data.contains( QLatin1String("lang") ) )
{
QStringList langList = data.value( QLatin1String("lang") ).toStringList();
......@@ -544,7 +532,7 @@ WikipediaEnginePrivate::fetchWikiUrl( const QString &title, const QString &urlPr
Q_Q( WikipediaEngine );
KUrl pageUrl;
QString host( ".wikipedia.org" );
pageUrl.setScheme( useSSL ? QLatin1String( "https" ) : QLatin1String( "http" ) );
pageUrl.setScheme( QLatin1String( "https" ) );
if( useMobileVersion )
{
......@@ -582,7 +570,7 @@ WikipediaEnginePrivate::fetchLangLinks( const QString &title,
{
Q_Q( WikipediaEngine );
KUrl url;
url.setScheme( useSSL ? QLatin1String( "https" ) : QLatin1String( "http" ) );
url.setScheme( QLatin1String( "https" ) );
url.setHost( hostLang + QLatin1String(".wikipedia.org") );
url.setPath( QLatin1String("/w/api.php") );
url.addQueryItem( QLatin1String("action"), QLatin1String("query") );
......@@ -604,7 +592,7 @@ WikipediaEnginePrivate::fetchListing( const QString &title, const QString &hostL
{
Q_Q( WikipediaEngine );
KUrl url;
url.setScheme( useSSL ? QLatin1String( "https" ) : QLatin1String( "http" ) );
url.setScheme( QLatin1String( "https" ) );
url.setHost( hostLang + QLatin1String(".wikipedia.org") );
url.setPath( QLatin1String("/w/api.php") );
url.addQueryItem( QLatin1String("action"), QLatin1String("query") );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment