Summary: | Segfaults on Flickr export | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Alexios Chouchoulas <alexios-kdebugs> |
Component: | Plugin-WebService-Flickr | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | caulier.gilles, eva, trisroger |
Priority: | NOR | ||
Version: | 5.6.0 | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 1.2.0 | |
Sentry Crash Report: |
Description
Alexios Chouchoulas
2010-01-04 23:04:47 UTC
Which kipi-plugins version you use ? Gilles Caulier kipi-plugins is at 1.0.0-1, and libkipi6 is 4:4.3.4-1 (these are Debian versions, FYI). digikam is reported as 2:1.0.0-1, although this is clearly a kipi issue as you imply. ~Alexios #6 QBasicAtomicInt::ref (this=0xc054f00) at ../../include/QtCore/../../src/corelib/arch/qatomic_i386.h:120 #7 QString (this=0xc054f00) at ../../include/QtCore/../../src/corelib/tools/qstring.h:712 #8 QLineEdit::text (this=0xc054f00) at widgets/qlineedit.cpp:391 #9 0xa4c65f58 in ?? () from /usr/lib/kde4/kipiplugin_flickrexport.so This is strange trace from Qt4 in Qstring. Why it crash here. which Qt4 you use ? Gilles Caulier Debian lists this as 4:4.5.3-4, so it's Qt 4.5.3. I was seeing this as well, but it seems to have stopped with kipi-plugins 1.1.0. Alexios, can you update to kipi-plugins 1.1.0 and try again ? Gilles Caulier Giles, apologies for the delay — I haven't been on a 32bit machine for a while, and I wanted to use the same computer I saw this on. I can confirm the issue is FIXED in kipi-plugins 1.1.0. *** Bug 237818 has been marked as a duplicate of this bug. *** I still see this crash here (using trunk of Jun 5). I had it all the time since several months. How to reproduce: add 2 images for upload move up the second image upload => crash in FlickrListViewItem::extraTags() it seems, something happens to m_tagLineEdit during the move (ImagesList::slotMoveUpItems) one idea: I am using kde 4.4 libs here. Maybe something in kdelibs trunk was fixed for KLineEdit? Alexios: which kdelibs did you use? commited a quickfix, see revision 1135123. Not perfect, but at least it fixes the crash and makes moving items working for flickr at all. Should be revisisted though (see commit message) SVN commit 1135123 by eva: This is a quickfix for Bug 221298 - Digikam segfaults on Flickr export ** Analysis: - ImagesList::slotMoveUpItems() uses takeTopLevelItem(aboveIndex.row() and then reinserts the item at new position - FlickrListViewItem constructor creates a KLineEdit as a special widget and sets it using view->setItemWidget(...) - Issue: view takes ownership of itemwidget. Thus KLineEdit widget is broken after calling takeTopLevelItem on the item - same issue for slotMoveDownItems() ** QuickFix: - add new virtual function updateItemWidgets to ImagesListViewItem and implement it in FlickrListViewItem. Create a new KlineEdit in there and call setItemWidget - call updateItemWidget after having used takeTopLevelItem ** Remaining Issue: we can't preserve the content of KLineEdit (extra tags in case of flickr) However, this feature has to be actively activated by the user, so it is not being used by default. And at least we don't get crashes now ** Real fix ideas: - implement a QItemDelegate (changing the model...) - there might be a solution based on QLineEdit (needs to be investigated) M +12 -0 common/libkipiplugins/widgets/imageslist.cpp M +8 -0 common/libkipiplugins/widgets/imageslist.h M +12 -2 flickrexport/flickrlist.cpp M +2 -0 flickrexport/flickrlist.h --- trunk/extragear/graphics/kipi-plugins/common/libkipiplugins/widgets/imageslist.cpp #1135122:1135123 @@ -185,6 +185,12 @@ setIcon(ImagesListView::Thumbnail, QIcon(m_thumb)); } + +ImagesListView* ImagesListViewItem::view() +{ + return m_view; +} + // --------------------------------------------------------------------------- ImagesListView::ImagesListView(ImagesList *parent) @@ -746,6 +752,7 @@ void ImagesList::slotMoveUpItems() { + // move above item down, then we don't have to fix the focus QModelIndex curIndex = listView()->currentIndex(); if (!curIndex.isValid()) return; @@ -756,12 +763,15 @@ QTreeWidgetItem* temp = listView()->takeTopLevelItem(aboveIndex.row()); listView()->insertTopLevelItem(curIndex.row(), temp); + // this is a quick fix. We loose the extra tags in flickr upload, but at list we don't get a crash + dynamic_cast<KIPIPlugins::ImagesListViewItem*>(temp)->updateItemWidgets(); emit signalImageListChanged(); } void ImagesList::slotMoveDownItems() { + // move below item up, then we don't have to fix the focus QModelIndex curIndex = listView()->currentIndex(); if (!curIndex.isValid()) return; @@ -772,6 +782,8 @@ QTreeWidgetItem* temp = listView()->takeTopLevelItem(belowIndex.row()); listView()->insertTopLevelItem(curIndex.row(), temp); + // this is a quick fix. We loose the extra tags in flickr upload, but at list we don't get a crash + dynamic_cast<KIPIPlugins::ImagesListViewItem*>(temp)->updateItemWidgets(); emit signalImageListChanged(); } --- trunk/extragear/graphics/kipi-plugins/common/libkipiplugins/widgets/imageslist.h #1135122:1135123 @@ -88,6 +88,14 @@ void updateInformation(); + // implement this, if you have special item widgets, e.g. an edit line + // they will be set automatically when adding items, changing order, etc. + virtual void updateItemWidgets() {}; + +protected: + + ImagesListView* view(); + private: int m_rating; // Image Rating from Kipi host. --- trunk/extragear/graphics/kipi-plugins/flickrexport/flickrlist.cpp #1135122:1135123 @@ -421,12 +421,22 @@ FlickrList::TAGS), i18n("Add extra tags per image or use Upload Options tab to " "add tags for all images")); - m_tagLineEdit = new KLineEdit(view); + //m_tagLineEdit = new KLineEdit(view); + //m_tagLineEdit->setToolTip(i18n("Enter extra tags, separated by commas.")); + //view->setItemWidget(this, static_cast<KIPIPlugins::ImagesListView::ColumnType>( + // FlickrList::TAGS), m_tagLineEdit); + updateItemWidgets(); +} + +void FlickrListViewItem::updateItemWidgets() +{ + m_tagLineEdit = new KLineEdit(view()); m_tagLineEdit->setToolTip(i18n("Enter extra tags, separated by commas.")); - view->setItemWidget(this, static_cast<KIPIPlugins::ImagesListView::ColumnType>( + view()->setItemWidget(this, static_cast<KIPIPlugins::ImagesListView::ColumnType>( FlickrList::TAGS), m_tagLineEdit); } + QStringList FlickrListViewItem::extraTags() { return m_tagLineEdit->text().split(',', QString::SkipEmptyParts); --- trunk/extragear/graphics/kipi-plugins/flickrexport/flickrlist.h #1135122:1135123 @@ -151,6 +151,8 @@ /* This method should be called when one of the checkboxes is clicked. */ void toggled(); + virtual void updateItemWidgets(); + private: bool m_is23; Thanks Eva to visiting digiKam/Kipi-plugins source code and fix. I see your commits. Great to see you in this area. Don't forget to CCBUGS or BUGS in right bugzilla entry for AQ. Thanks in advance All the best Gilles Caulier |