Review Request 128884: Disable QWebView's object cache when the "disableStyleCache" option is set

Mariusz Glebocki mglb at arccos-1.net
Sat Sep 10 22:16:16 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128884/
-----------------------------------------------------------

(Updated Sept. 10, 2016, 10:16 p.m.)


Status
------

This change has been marked as submitted.


Review request for Telepathy.


Changes
-------

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


Repository: ktp-text-ui


Description
-------

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


Diffs
-----

  lib/adium-theme-view.cpp 26e6d50 

Diff: https://git.reviewboard.kde.org/r/128884/diff/


Testing
-------

- 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


File Attachments
----------------

Companion patch: Rename "KopeteStyleDebug" to "KTpStyleDebug"
  https://git.reviewboard.kde.org/media/uploaded/files/2016/09/10/bfd8608a-f528-43c7-9905-1b2a018a455a__0001-lib-Rename-KopeteStyleDebug-to-KTpStyleDebug.patch


Thanks,

Mariusz Glebocki

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20160910/38a06dac/attachment.html>


More information about the KDE-Telepathy mailing list