Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Amarok
Commits
8c15258b
Commit
8c15258b
authored
Jun 21, 2016
by
Olivier Churlaud
Browse files
Disable non SSL connections in wikipedia applet.
REVIEW: 128248 BUG: 348313
parent
05f0defd
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
8c15258b
...
...
@@ -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:
...
...
src/context/applets/wikipedia/WikipediaApplet.cpp
View file @
8c15258b
...
...
@@ -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
(
"http
s
"
);
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
())
);
...
...
src/context/applets/wikipedia/WikipediaApplet_p.h
View file @
8c15258b
...
...
@@ -143,7 +143,6 @@ public:
bool
isForwardHistory
;
bool
isBackwardHistory
;
bool
useMobileWikipedia
;
bool
useSSL
;
};
class
WikipediaSearchLineEdit
:
public
Plasma
::
LineEdit
...
...
src/context/applets/wikipedia/wikipediaGeneralSettings.ui
View file @
8c15258b
...
...
@@ -32,13 +32,6 @@
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QCheckBox"
name=
"sslCheckBox"
>
<property
name=
"text"
>
<string>
Use
&
SSL
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
...
...
src/context/engines/wikipedia/WikipediaEngine.cpp
View file @
8c15258b
...
...
@@ -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"
)
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment