Kill KUrlPixmapProvider and KPixmapProvider
Open, Needs TriagePublic

Description

KUrlPixmapProvider is a weird little thing. The only thing it does is getting a pixmap for a given URL. It therefore uses KIO::pixmapForUrl, which uses KIO::iconNameForUrl and then loads a pixmap by this name.

The only place where this is actually used is KDirSelectDialog to feed it into KHistoryComboBox to give the history nice little icons.

This is also the only place where setPixmapProvider() from KHistoryCombobox is actually used.

Given that the icons are loaded by name anyway and QCombobox takes a QIcon (and thus QIcon::fromTheme) we should find a way to feed the icon name directly into the combobox without the pixmap madness in between.

KUrlPixmapProvider and KonqPixmapProvider are also the only users of KPixmapProvider, which then can be killed as well

nicolasfella renamed this task from Kill-ish KUrlPixmapProvider to Kill KUrlPixmapProvider.

Besides that KPixmapProvider is used only in konqueror for KonqPixmapProvider, so it might be worth looking into killing that as well

nicolasfella added a comment.EditedDec 2 2019, 10:09 PM

For the KHistoryComboBox case I can imagine to replace the setPixmapProvider with a method that takes a function/lambda that takes a QString and returns a QIcon. No need to define a class for that.

nicolasfella moved this task from Backlog to In Progress on the KF6 board.Dec 3 2019, 8:24 PM
nicolasfella renamed this task from Kill KUrlPixmapProvider to Kill KUrlPixmapProvider and KPixmapProvider.Dec 8 2019, 11:18 PM
nicolasfella updated the task description. (Show Details)