X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5be4abc3a8c87203f33e3e4090ff204dd8a1e664..11289b4fc3efbc074b668d4516cd896f8ade9761:/src/tagcloud/tagcloud.cpp diff --git a/src/tagcloud/tagcloud.cpp b/src/tagcloud/tagcloud.cpp index a3fe2035e..2afd62e3b 100644 --- a/src/tagcloud/tagcloud.cpp +++ b/src/tagcloud/tagcloud.cpp @@ -464,7 +464,8 @@ void Nepomuk::TagCloud::Private::rebuildCloud() // binary search in row TagNode* Nepomuk::TagCloud::Private::findTagInRow( const QList& row, const QPoint& pos ) { - int x = row.count() * pos.x() / m_parent->width(); + int x = m_parent->width() ? row.count() * pos.x() / m_parent->width() : 0; + int i = 0; while ( 1 ) { if ( x-i >= 0 && x-i < row.count() && row[x-i]->zoomedRect.contains( pos ) ) { @@ -485,7 +486,7 @@ TagNode* Nepomuk::TagCloud::Private::findTagInRow( const QList& row, c // binary search in cloud TagNode* Nepomuk::TagCloud::Private::tagAt( const QPoint& pos ) { - int y = rows.count() * pos.y() / m_parent->height(); + int y = m_parent->height() ? rows.count() * pos.y() / m_parent->height() : 0; int i = 0; while ( 1 ) { @@ -611,6 +612,7 @@ void Nepomuk::TagCloud::setZoomEnabled( bool zoom ) void Nepomuk::TagCloud::setContextMenuEnabled( bool enabled ) { + Q_UNUSED(enabled); }