Summary: | Crash when using file search and trying to copy all files found afterwards | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Oliver Weber <almoeli> |
Component: | general | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Oliver Weber
2003-06-02 13:34:50 UTC
Subject: kdebase/libkonq CVS commit by waba: CCMAIL: 59250-done@bugs.kde.org Don't crash on copy without a currentItem() (BR59250) M +12 -4 konq_iconviewwidget.cc 1.240 --- kdebase/libkonq/konq_iconviewwidget.cc #1.239:1.240 @@ -1087,11 +1087,10 @@ KonqIconDrag * KonqIconViewWidget::konqD KonqIconDrag * drag = new KonqIconDrag( dragSource ); - // Position of the item clicked in the view - QPoint itempos = currentItem()->pixmapRect( FALSE ).topLeft(); - // Set pixmap, with the correct offset - drag->setPixmap( *currentItem()->pixmap(), m_mousePos - itempos ); + QIconViewItem *primaryItem = currentItem(); // Append all items to the drag object for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) { if ( it->isSelected() ) { + if (!primaryItem) + primaryItem = it; KURL url = (static_cast<KFileIVI *>(it))->item()->url(); QString itemURL = KURLDrag::urlToString(url); @@ -1107,4 +1106,13 @@ KonqIconDrag * KonqIconViewWidget::konqD } } + + if (primaryItem) + { + // Position of the item clicked in the view + QPoint itempos = primaryItem->pixmapRect( FALSE ).topLeft(); + // Set pixmap, with the correct offset + drag->setPixmap( *primaryItem->pixmap(), m_mousePos - itempos ); + } + return drag; } |