<table><tr><td style="">dvratil created this revision.<br />dvratil added a project: KDE PIM.<br />Restricted Application added a subscriber: KDE PIM.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5577" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Instead make LocalDatabaseManager an instance-based interface for a singleton backend. The reason is that when running Kontact, both Akregator, KMail and possibly others who use WebEngineViewer would share the same instance of LocalDataBaseManager and connect to its signal. This means that when you click on a link in KMail, KMail requests URL check from LocalDataBaseManager singleton and the singleton emits a signal, the signal is delivered to all applications that are connected to it, not just KMail. This results in each application opening the link. Currently you can reproduce when you enable phishing checks in both KMail and Akregator, launch Kontact, open KMail, then switch to Akregator and click any link. The link will get opened twice, once by KMail and once by Akregator.</p>
<p>This patch removes the singleton from LocalDataBaseManager and makes each WebEngineView own its own instance of LocalDataBaseManager. Internally, the actual implementation is still a singleton, however the public interface is non-singleton, which means that each application is connected to its own LocalDataBaseManager instance, thus avoiding the issue described above.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Ported Akregator to the new API, links no longer open twice.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R94 PIM: Message Library</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5577" rel="noreferrer">https://phabricator.kde.org/D5577</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>CMakeLists.txt<br />
messageviewer/autotests/viewergrantleethemesupporttest.cpp<br />
messageviewer/autotests/viewertest.cpp<br />
messageviewer/src/viewer/viewer_p.cpp<br />
messageviewer/src/viewer/viewer_p.h<br />
webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.cpp<br />
webengineviewer/src/checkphishingurl/localdatabasemanager.cpp<br />
webengineviewer/src/checkphishingurl/localdatabasemanager.h<br />
webengineviewer/src/checkphishingurl/localdatabasemanager_p.h<br />
webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.cpp<br />
webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.h<br />
webengineviewer/src/checkphishingurl/tests/webengineviewwithsafebrowsingsupport.cpp<br />
webengineviewer/src/webengineview.cpp<br />
webengineviewer/src/webengineview.h</div></div></div><br /><div><strong>To: </strong>dvratil, mlaurent<br /><strong>Cc: </strong>KDE PIM, dvasin, ach, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>