diff --git a/src/basketlistview.cpp b/src/basketlistview.cpp --- a/src/basketlistview.cpp +++ b/src/basketlistview.cpp @@ -505,18 +505,13 @@ if (drawRoundRect) { QPixmap roundRectBmp; QColor background = basket->backgroundColor(); - int textWidth = m_basketTree->fontMetrics().width(basketInTree->text(/*column=*/0)); + int textWidth = m_basketTree->fontMetrics().horizontalAdvance(basketInTree->text(/*column=*/0)); int iconTextMargin = m_basketTree->style()->pixelMetric(QStyle::PM_FocusFrameHMargin); ///< Space between icon and text // Don't forget to update the key computation if parameters // affecting the rendering logic change QString key = QString("BLIRR::%1.%2.%3.%4").arg(option.rect.width()).arg(option.rect.size().height()).arg(textWidth).arg(background.rgb()); - - if (QPixmap *cached = QPixmapCache::find(key)) { - // Qt's documentation recommends copying the pointer - // into a QPixmap immediately - roundRectBmp = *cached; - } else { + if (!QPixmapCache::find(key, &roundRectBmp)) { // Draw first time roundRectBmp = QPixmap(option.rect.size()); @@ -562,8 +557,9 @@ QPixmap FoundCountIcon::circledTextPixmap(const QString &text, int height, const QFont &font, const QColor &color) const { QString key = QString("BLI-%1.%2.%3.%4").arg(text).arg(height).arg(font.toString()).arg(color.rgb()); - if (QPixmap *cached = QPixmapCache::find(key)) { - return *cached; + QPixmap cached; + if (QPixmapCache::find(key, &cached)) { + return cached; } // Compute the sizes of the image components: @@ -597,7 +593,7 @@ QImage resultImage = background.toImage(); // resultImage.setAlphaBuffer(true); - resultImage.convertToFormat(QImage::Format_ARGB32); + //resultImage.convertToFormat(QImage::Format_ARGB32); // Scale down the image smoothly to get anti-aliasing: QPixmap pmScaled = QPixmap::fromImage(resultImage.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); diff --git a/src/crashhandler.cpp b/src/crashhandler.cpp --- a/src/crashhandler.cpp +++ b/src/crashhandler.cpp @@ -129,7 +129,7 @@ bt.remove("(no debugging symbols found)..."); bt.remove("(no debugging symbols found)\n"); bt.replace(QRegExp("\n{2,}"), "\n"); // clean up multiple \n characters - bt.trimmed(); + bt = bt.trimmed(); /// analyze usefulness bool useful = true; diff --git a/src/variouswidgets.cpp b/src/variouswidgets.cpp --- a/src/variouswidgets.cpp +++ b/src/variouswidgets.cpp @@ -221,12 +221,13 @@ QListWidget *iconView = new UndraggableKIconView(page); - m_size16 = new QListWidgetItem(DesktopIcon(icon, 16), i18n("16 by 16 pixels"), iconView); - m_size22 = new QListWidgetItem(DesktopIcon(icon, 22), i18n("22 by 22 pixels"), iconView); - m_size32 = new QListWidgetItem(DesktopIcon(icon, 32), i18n("32 by 32 pixels"), iconView); - m_size48 = new QListWidgetItem(DesktopIcon(icon, 48), i18n("48 by 48 pixels"), iconView); - m_size64 = new QListWidgetItem(DesktopIcon(icon, 64), i18n("64 by 64 pixels"), iconView); - m_size128 = new QListWidgetItem(DesktopIcon(icon, 128), i18n("128 by 128 pixels"), iconView); + QIcon desktopIcon = QIcon::fromTheme(icon); + m_size16 = new QListWidgetItem(desktopIcon.pixmap(QSize(16, 16)), i18n("16 by 16 pixels"), iconView); + m_size22 = new QListWidgetItem(desktopIcon.pixmap(QSize(22, 2)), i18n("22 by 22 pixels"), iconView); + m_size32 = new QListWidgetItem(desktopIcon.pixmap(QSize(32, 32)), i18n("32 by 32 pixels"), iconView); + m_size48 = new QListWidgetItem(desktopIcon.pixmap(QSize(48, 48)), i18n("48 by 48 pixels"), iconView); + m_size64 = new QListWidgetItem(desktopIcon.pixmap(QSize(64, 64)), i18n("64 by 64 pixels"), iconView); + m_size128 = new QListWidgetItem(desktopIcon.pixmap(QSize(128, 128)), i18n("128 by 128 pixels"), iconView); iconView->setIconSize(QSize(128, 128)); iconView->setMinimumSize(QSize(128 * 6 + (6 + 2) * iconView->spacing() + 20, m_size128->sizeHint().height() + 2 * iconView->spacing() + 20)); topLayout->addWidget(iconView);