mirror of https://github.com/KDE/kasts.git
Kasts è un'applicazione per podcast che gira su Linux. È sincronizzabile con gpoddersync su cloud.mastodon.uno
https://castopod.it
58032dd560
This attempts to fix the issue described here: https://invent.kde.org/plasma-mobile/kasts/-/issues/20 There seemed to be a loop that occurs when setting an img width which causes the view to re-render which causes the window to grow which goes back to setting an img width causing an loop that keeps growing the img width and eventually crashing. There are a few ways to fix this but I believe not setting a width on an img without a width both fixes it and behaves as expected (see context section). I'm not sure if this is a solution Kasts wants to go with but at the very least it adds more details to the issue. ## Reproducing The gist of that issue is that a crash occurs when you visit https://feed.zugfunk-podcast.de/podcastrss.xml, episode 53 and this is reproducible. I was able to get to the bottom of why that particular podcast episode crashes and can be reproduced with the following content ```html <table style=\"width:30rem;\"><tbody><tr><td style=\"width:14rem;\">Some Text On Left </td><td><img src=\"https://invent.kde.org/plasma-mobile/kasts/-/raw/master/icons/128-apps-kasts.png\"></td></tr></tbody></table> ``` *(can repro by setting this string as a QStringLiteral in Entry.cpp, line 64 when the content is first set and then clicking on any episode) ## Context The problem seems to be with `<img`s that don't have a width set. In those cases the code tries to set the image to the width of the component. The problem with this seems to be that this assumes that these images are on their own horizontal line and that they should take the whole width. So to repro (see content I used to repro above as an example): * put an image tag next to some element that takes some width (like a table where there's a left column with some text and a right column in the right) * img tag without a width What ends up happening is that the `img width` gets updated to the size of the component width but because there's another element to the left of it, it will mean that the resulting view is bigger than the component width which causes `onWidthChanged`(`EntryPage.qml::88`) to be triggered and the `adjustedContent` function to be called again where this whole process happens again (img width is updated to component width -> rendered but it's larger than width -> causing onWidthChanged -> adjustedContent runs again -> rinse/repeat). There are other ways to try to solve this but the three I looked at are: 1. After `adjustedContent` is run, it should update the actual `m_content` so that the following runs can work off the last text update (this will mean that the problematic `else` wouldn't be run constantly). * You can do this by setting the content at the end of the function (`setContent(ret);`) 2. Checking for some reasonable width limit (if width > 10000 then width = 10000) 3. Not resizing an image without a width because we're not sure about the intention of the author * in this case these were small icons for social media that shouldn't be scaled up * I think we shouldn't scale any images because of the same reason but the PR is conservative and just stops it in the case of a img without a width For the PR I went with # 3 because the others led to the icons being scaled but it messed up the look of the page. Closes #20 |
||
---|---|---|
.reuse | ||
LICENSES | ||
android | ||
icons | ||
po | ||
src | ||
.editorconfig | ||
.gitignore | ||
.gitlab-ci.yml | ||
.kde-ci.yml | ||
CMakeLists.txt | ||
README.md | ||
kasts-android-square.svg | ||
kasts.svg | ||
logo.png | ||
org.kde.kasts.appdata.xml | ||
org.kde.kasts.desktop |
README.md
Kasts
Kasts is a convergent podcast application.
Get it
Nightly Android APKs are available at KDE's Binary Factory.
Building
Note: When using versions of kasts built from git-master, it's possible that the database format or the name of downloaded files change from one version to another without the necessary migrations to handle it. If you notice bugs after upgrading to a git-master version, export your feeds, delete ~/.local/share/KDE/kasts
and import the feeds again.
Requirements
- KCoreAddons
- KI18n
- KConfig
- Kirigami
- Syndication
- TagLib
- QtKeychain
- ThreadWeaver
On debian
apt install build-essential cmake extra-cmake-modules qtbase5-dev \
qtdeclarative5-dev qtquickcontrols2-5-dev qtmultimedia5-dev \
libkf5syndication-dev libkf5config-dev libkf5i18n-dev \
libkf5coreaddons-dev libtag1-dev qtkeychain-qt5-dev \
libkf5networkmanagerqt-dev libkf5threadweaver-dev
Linux
git clone https://invent.kde.org/plasma-mobile/kasts
cd kasts
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH=/usr
make
sudo make install
This assumes all dependencies are installed. If your distribution does not provide them, you can use kdesrc-build to build all of them.
Android
You can build Kasts for Android using KDE's Docker-based build environment.