Babelfish plugin: Allow secure URLs to be translated
ClosedPublic

Authored by marten on Jul 8 2017, 1:30 PM.

Details

Summary

The plugin originally only allows HTTP URLs to be translated. With the increasing use of automatic redirection to HTTPS, this seriously restricts the utility of the plugin - neither www.kde.org nor Wikipedia can be translated.

This change enables the plugin for HTTPS URLs also. Since this can result in secure information being transmitted over the network in clear text and received by the online translation service, a warning dialogue (with the option to not ask again) is shown.

The change also removes some unused header files and ports KUrl -> QUrl, which eliminates the use of KDELibs4Support.

Test Plan

Built konqueror with this change, checked operation of Tools - Translate Web Page for www.kde.org and other secure pages.

Diff Detail

Repository
R226 Konqueror
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
marten created this revision.Jul 8 2017, 1:30 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 8 2017, 1:30 PM
Restricted Application added subscribers: Dolphin, plasma-devel. · View Herald Transcript
dfaure edited edge metadata.Jul 8 2017, 1:38 PM

Looks good, just some details.

plugins/babelfish/plugin_babelfish.cpp
225

This is missing WebEngine btw, but instead this should be generalized with something like
"the part has a browser extension", like this:

&& KParts::BrowserExtension::childObject(part)
273

the 0L should be part->widget() instead.

marten marked 2 inline comments as done.Jul 8 2017, 5:48 PM
marten updated this revision to Diff 16361.Jul 8 2017, 5:52 PM

Use KParts::BrowserExtension::childObject(part) to test for browser part (needs to be guarded by part!=NULL).
Split up the big conditional.
Use part->widget() as parent for message boxes.

dfaure accepted this revision.Jul 8 2017, 8:32 PM
This revision is now accepted and ready to land.Jul 8 2017, 8:32 PM
This revision was automatically updated to reflect the committed changes.