Summary:
The copying/updating of the cache has been removed from the FetchSqlite class.
This allows the browsers to have handle the caching differently.
The firefox sqlite files are only copied if they changed. Before they were copied
for each match session.
The chrome favicon database is also only copied if needed
and the check is also made in the prepare method and not just when
the profile is initialized.
Test Plan:
For both firefox and chrome:
Plugin shows icons for results.
Add new bookmarks, close browser, the new bookmarks should show up with icons.
Reviewers: #plasma, ngraham, meven, broulik
Reviewed By: meven
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D29726
Summary:
QSqlDatabase connection instances are global reference counted objects which
can be crated using the QSqlDatabase::addDatabase(...) method and later
retrieved with QSqlDatabase::database(connectionname).
Connections should only be used from a single thread, and should be cleaned
up with QSD::removeDatabase(name), which implicitly closes the connection
when the last reference is removed.
Currently, the same connection (name) is reused over all threads, and
the connection is only removed implicitly by replacing it via addDatabase().
This leads to warnings, i.e.: "QSqlDatabasePrivate::addDatabase: duplicate
connection name '...', old connection removed."
As one reference is held by the m_db member, the implicit removal triggers
another warning: "QSqlDatabasePrivate::removeDatabase: connection '..."
is still in use, all queries will cease to work."
According to the documentation, "It is highly recommended that you do not
keep a copy of the QSqlDatabase around as a member of a class, as this
will prevent the instance from being correctly cleaned up on shutdown."
There is no need to keep a reference using a member variable, as retrieving
an open connection via QSqlDatabase::database(...) is cheap.
Create a per-thread DB connection on first use, and remove the connections
when the FetchSqlite instance is torn down.
Delaying the open is beneficial for the favicon instance, which may be
unused when the icon is already cached on disk.
See also T9626.
BUG: 400723
Test Plan:
execute a query in krunner
1. Results are as expected
2. The 'QSqlDatabasePrivate::removeDatabase: connection ... is still in use,
all queries will cease to work.' warning no longer appears
3. The 'QSqlDatabasePrivate::addDatabase: duplicate connection name ...,
old connection removed' warning no longer appears
Reviewers: #frameworks, mart
Reviewed By: mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16409
Summary:
Instead of constructing the query string on each favicon fetch just use
the (fixed) sql query string.
Test Plan:
make
Switch default "Web browser" in Applications to Chrome/Chromium
Query bookmark with krunner, or e.g.
qdbus-qt5 org.kde.krunner /App org.kde.krunner.App.querySingleRunner bookmarks Phabricator
Reviewers: #frameworks, davidedmundson
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15491
Summary:
The query is no longer initialized for each query, just once, thus there
no longer is a need for the database parameter.
Test Plan: make
Reviewers: #frameworks, davidedmundson
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15490
Summary: This is a preparatory patch required for further rework
Test Plan: make
Reviewers: #frameworks, davidedmundson
Reviewed By: davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15488
Summary:
Krunner::match is performed in potentially multiple overlapping threads
as a user presses each character. Qt SQL is not thread safe according to
the docs or according to the numerous reports.
It's a bit of a blind patch, ideally we should only use the database in
the thread that opened it.
This patch at least this means queries will be queued which I think will
be enough.
CCBUG: 363136
Test Plan: Restarted krunner. Still saw my firefox bookmarks
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: rempt, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D12683
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://community.kde.org/Frameworks/GitOldHistory
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo kde-workspace, frameworks branch, at commit
049113e719dd2fc4446d054fa1a3aada330094f0