#include "placesitemlistwidget.h"
#include <QStyleOption>
-#include <QPainter>
#include <KColorScheme>
-#include <KIO/FileSystemFreeSpaceJob>
#include <Solid/Device>
#include <Solid/NetworkShare>
}
const QUrl url = data().value("url").toUrl();
- if (m_freeSpaceInfo.job || !m_freeSpaceInfo.lastUpdated.hasExpired()) {
- // Job running or cache is still valid.
+ if (url.isEmpty() || m_freeSpaceInfo.job || !m_freeSpaceInfo.lastUpdated.hasExpired()) {
+ // No url, job running or cache is still valid.
return;
}
{
KStandardItemListWidget::paint(painter, option, widget);
- if (m_drawCapacityBar) {
+ // We check if option=nullptr since it is null when the place is dragged (Bug #430441)
+ if (m_drawCapacityBar && option) {
const TextInfo* textInfo = m_textInfo.value("text");
if (textInfo) { // See KStandarItemListWidget::paint() for info on why we check textInfo.
painter->save();