Commit b2e5957d authored by David Faure's avatar David Faure

Fix pixmap of size 0,0 being requested; actually make the int arg explicit.

parent 1303a2d1
......@@ -35,6 +35,7 @@ set(konquerorprivate_SRCS
add_library(konquerorprivate SHARED ${konquerorprivate_SRCS})
target_link_libraries(konquerorprivate
KF5::IconThemes
KF5::Konq
KF5::Parts
KF5::KIOGui
......
......@@ -29,6 +29,7 @@
#include <kglobalsettings.h>
#include <QIcon>
#include <kiconeffect.h>
#include <kiconloader.h>
#include <konqpixmapprovider.h>
#include <kcolorscheme.h>
......@@ -74,7 +75,7 @@ KonqClosedTabItem::~KonqClosedTabItem()
QPixmap KonqClosedTabItem::icon() const
{
return KonqPixmapProvider::self()->pixmapFor(m_url);
return KonqPixmapProvider::self()->pixmapFor(m_url, KIconLoader::SizeSmall);
}
KonqClosedWindowItem::KonqClosedWindowItem(const QString &title, quint64 serialNumber, int numTabs)
......
......@@ -218,7 +218,7 @@ void KonqCombo::setURL(const QString &url)
void KonqCombo::setTemporary(const QString &text)
{
setTemporary(text, KonqPixmapProvider::self()->pixmapFor(text));
setTemporary(text, KonqPixmapProvider::self()->pixmapFor(text, KIconLoader::SizeSmall));
}
void KonqCombo::setTemporary(const QString &url, const QPixmap &pix)
......@@ -284,7 +284,7 @@ void KonqCombo::applyPermanent()
}
QString item = temporaryItem();
insertItem(KonqPixmapProvider::self()->pixmapFor(item), item, 1, titleOfURL(item));
insertItem(KonqPixmapProvider::self()->pixmapFor(item, KIconLoader::SizeSmall), item, 1, titleOfURL(item));
//qDebug() << url;
// Remove all duplicates starting from index = 2
......@@ -350,7 +350,7 @@ void KonqCombo::updatePixmaps()
setUpdatesEnabled(false);
KonqPixmapProvider *prov = KonqPixmapProvider::self();
for (int i = 1; i < count(); i++) {
setItemIcon(i, prov->pixmapFor(itemText(i)));
setItemIcon(i, prov->pixmapFor(itemText(i), KIconLoader::SizeSmall));
}
setUpdatesEnabled(true);
repaint();
......
......@@ -4994,7 +4994,7 @@ void KonqMainWindow::addClosedWindowToUndoList()
void KonqMainWindow::updateWindowIcon()
{
const QString url = m_combo->currentText();
const QPixmap pix = KonqPixmapProvider::self()->pixmapFor(url);
const QPixmap pix = KonqPixmapProvider::self()->pixmapFor(url, KIconLoader::SizeSmall);
KParts::MainWindow::setWindowIcon(pix);
QPixmap big = pix;
......
......@@ -20,13 +20,14 @@
#include "konqpixmapprovider.h"
#include <QMimeDatabase>
#include <QMimeType>
#include <QIcon>
#include <KIO/FavIconRequestJob>
#include <kio/global.h>
#include <QMimeType>
#include <QIcon>
#include <kprotocolinfo.h>
#include <kconfiggroup.h>
#include <kiconloader.h>
class KonqPixmapProviderSingleton
{
......@@ -182,6 +183,9 @@ void KonqPixmapProvider::clear()
QPixmap KonqPixmapProvider::loadIcon(const QString &icon, int size)
{
if (size == 0) {
size = KIconLoader::SizeSmall;
}
return QIcon::fromTheme(icon).pixmap(size);
}
......@@ -51,7 +51,7 @@ public:
/**
* Looks up a pixmap for @p url. Uses a cache for the iconname of url.
*/
virtual QPixmap pixmapFor(const QString &url, int size = 0);
virtual QPixmap pixmapFor(const QString &url, int size);
/**
* Loads the cache to @p kc from key @p key.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment