Disable QWebView's object cache when the "disableStyleCache" option is set

Review Request #128884 - Created Sept. 10, 2016 and submitted

Information
Mariusz Glebocki
ktp-text-ui
master
Reviewers
telepathy

The patch disables QWebView's object cache when the "disableStyleCache" option is set.

When the style cache is disabled (see https://github.com/KDE/ktp-text-ui/blob/master/lib/chat-window-style-manager.cpp#L310) all style files should be reloaded on a style change. This is done for at least all .html files. However, .css (and possibly .js) files are cached in QWebView, so they are read from the cache when referenced by @import.

How to reproduce the problem

  • Append following setting to ~/.config/ktp-text-uirc:
[KopeteStyleDebug]
disableStyleCache=true

  • Run ktp-text-ui, open any chat

  • optionally, change the chat style to one which uses main.css file (like SimKete)

  • without closing the chat window, backup the style's main.css file (~/.local/share/ktelepathy/styles/<style-name>.AdiumMessageStyle/Contents/Resources/main.css or /usr/share/ktelepathy/styles/<style-name>.AdiumMessageStyle/Contents/Resources/main.css) and modify it in some noticeable way. Example modification for SimKete:

body {
    font-size: 12px;
    /* background-color: #e3e3e3; */
    background-color: red;
}

  • reload the style in ktp-text-ui by changing it to another one and back in the settings

  • the result is visible in a chat preview

  • optionally, click apply/ok to verify results in real chat window

Results:

  • without patch: the style looks like before; ktp-text-ui needs restart to use a new stylesheet

  • with patch: the style uses changed main.css file (red background for SimKete example)

NOTE: Don't forget to restore original main.css

  • compile/run: OK
  • use case from the description gives expected result: OK
  • multiple similar tests with own style: OK
  • the cache is not disabled when "disableStyleCache" is not set: OK

Files


Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Alexandr Akulich
Alexandr Akulich
Alexandr Akulich
Mariusz Glebocki
Mariusz Glebocki
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 6b93b6fdf3bc0d095e4746815623571506f47c77 by Alexandr Akulich on behalf of Mariusz Glebocki to branch master.
Loading...