[Okular-devel] [okular] [Bug 316802] New: okular crashes when adding a stamp

2013-03-15 Thread Giorgio
https://bugs.kde.org/show_bug.cgi?id=316802

Bug ID: 316802
   Summary: okular crashes when adding a stamp
Classification: Unclassified
   Product: okular
   Version: 0.15.3
  Platform: Ubuntu Packages
OS: Linux
Status: UNCONFIRMED
  Severity: crash
  Priority: NOR
 Component: general
  Assignee: okular-devel@kde.org
  Reporter: snove...@gmail.com

Application: okular (0.15.3)
KDE Platform Version: 4.9.5
Qt Version: 4.8.3
Operating System: Linux 3.5.7.2 x86_64
Distribution: Ubuntu 12.10

-- Information about the crash:
- What I was doing when the application crashed:

I was adding a stamp (F6 + 7). Sometimes it crashes while opening the
proprieties of the stamp.

The crash can be reproduced some of the time.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
[Current thread is 1 (Thread 0x7f0dbb6ce780 (LWP 5278))]

Thread 2 (Thread 0x7f0d9f7fe700 (LWP 5296)):
#0  0x7f0db8935303 in __GI___poll (fds=optimized out, nfds=optimized
out, timeout=optimized out) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x7f0db5534d84 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x7f0db5534ea4 in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x7f0db9330c16 in QEventDispatcherGlib::processEvents
(this=0x7f0d980013e0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x7f0db93012bf in QEventLoop::processEvents
(this=this@entry=0x7f0d9f7fddd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x7f0db9301548 in QEventLoop::exec (this=0x7f0d9f7fddd0, flags=...) at
kernel/qeventloop.cpp:204
#6  0x7f0db9202b10 in QThread::exec (this=optimized out) at
thread/qthread.cpp:501
#7  0x7f0db92e19af in QInotifyFileSystemWatcherEngine::run (this=0x1878bb0)
at io/qfilesystemwatcher_inotify.cpp:248
#8  0x7f0db9205aec in QThreadPrivate::start (arg=0x1878bb0) at
thread/qthread_unix.cpp:338
#9  0x7f0db5a03e9a in start_thread (arg=0x7f0d9f7fe700) at
pthread_create.c:308
#10 0x7f0db8940cbd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x in ?? ()

Thread 1 (Thread 0x7f0dbb6ce780 (LWP 5278)):
[KCrash Handler]
#5  QSortFilterProxyModelPrivate::updateChildrenMapping
(this=this@entry=0x15c47a0, source_parent=...,
parent_mapping=parent_mapping@entry=0x16245e0,
orient=orient@entry=Qt::Vertical, start=start@entry=10, end=end@entry=10,
delta_item_count=delta_item_count@entry=1, remove=remove@entry=false) at
itemviews/qsortfilterproxymodel.cpp:948
#6  0x7f0dba274dbe in QSortFilterProxyModelPrivate::source_items_inserted
(this=this@entry=0x15c47a0, source_parent=..., start=10, end=10,
orient=orient@entry=Qt::Vertical) at itemviews/qsortfilterproxymodel.cpp:745
#7  0x7f0dba2752bf in QSortFilterProxyModelPrivate::_q_sourceRowsInserted
(this=0x15c47a0, source_parent=..., start=optimized out, end=optimized out)
at itemviews/qsortfilterproxymodel.cpp:1281
#8  0x7f0db9317f5f in QMetaObject::activate (sender=0x15c4ca0, m=optimized
out, local_signal_index=optimized out, argv=0x7fffe2a0ff60) at
kernel/qobject.cpp:3547
#9  0x7f0db9361be4 in QAbstractItemModel::rowsInserted (this=optimized
out, _t1=..., _t2=10, _t3=10) at
.moc/release-shared/moc_qabstractitemmodel.cpp:197
#10 0x7f0db92fce6a in QAbstractItemModel::endInsertRows (this=0x15c4ca0) at
kernel/qabstractitemmodel.cpp:2433
#11 0x7f0da9877d80 in AnnotationModelPrivate::notifyPageChanged
(this=0x159b790, page=optimized out, flags=optimized out) at
../ui/annotationmodel.cpp:146
#12 0x7f0da959fd9f in Okular::DocumentPrivate::notifyAnnotationChanges
(this=optimized out, page=page@entry=20) at ../core/document.cpp:2480
#13 0x7f0da95aab48 in Okular::Document::addPageAnnotation (this=0x1567ff0,
page=20, annotation=0x1637090) at ../core/document.cpp:2505
#14 0x7f0da989cc31 in PageViewAnnotator::routeEvent (this=0x24b3400,
e=optimized out, item=0x1a70ce0) at ../ui/pageviewannotator.cpp:793
#15 0x7f0da98b2d6a in PageView::mouseReleaseEvent (this=0x1681780,
e=0x7fffe2a10f20) at ../ui/pageview.cpp:2164
#16 0x7f0db9d34850 in QWidget::event (this=0x1681780, event=0x7fffe2a10f20)
at kernel/qwidget.cpp:8371
#17 0x7f0dba0e3b66 in QFrame::event (this=0x1681780, e=0x7fffe2a10f20) at
widgets/qframe.cpp:557
#18 0x7f0da98a3c9d in PageView::viewportEvent (this=0x1681780,
e=0x7fffe2a10f20) at ../ui/pageview.cpp:2994
#19 0x7f0db93026d6 in
QCoreApplicationPrivate::sendThroughObjectEventFilters (this=optimized out,
receiver=0x1660490, event=0x7fffe2a10f20) at kernel/qcoreapplication.cpp:1025
#20 0x7f0db9ce4e6c in QApplicationPrivate::notify_helper
(this=this@entry=0x13c35d0, receiver=receiver@entry=0x1660490,
e=e@entry=0x7fffe2a10f20) at kernel/qapplication.cpp:4558
#21 0x7f0db9ce9b6b in QApplication::notify (this=optimized out,
receiver=0x1660490, 

Re: [Okular-devel] Review Request 107442: Add undo/redo support for annotations

2013-03-15 Thread Jon Mease


 On March 14, 2013, 7:43 p.m., Albert Astals Cid wrote:
 

Thanks for the feedback.  I have a couple questions inline below


 On March 14, 2013, 7:43 p.m., Albert Astals Cid wrote:
  ui/annotationpropertiesdialog.cpp, line 209
  http://git.reviewboard.kde.org/r/107442/diff/6/?file=119429#file119429line209
 
  Maybe we could not modify the annot in ::slotapply but modify it in 
  Document::modifyPageAnnotationProperties? And then you wouldn't need the 
  map in there either because you would get the old annotation as parameter?

The difficulty here is that most of the work in modifying the annotation's 
properties is actually performed in the applyChanges() method of the 
AnnotationWidget (m_annotWidget).  And we can't pass the AnnotationWidget into 
the Document::modifyPageAnnotationProperties method because of the GUI 
dependency.  So I'm not really sure how this could be done (but I'm open to 
suggestions).


 On March 14, 2013, 7:43 p.m., Albert Astals Cid wrote:
  core/document.cpp, line 3282
  http://git.reviewboard.kde.org/r/107442/diff/6/?file=119425#file119425line3282
 
  I am wondering why do we need this map for the prev contents, as far as 
  i can see annotwindow does not modify the annotation anymore, so the 
  annotation * you get here should have the old values still no?

Yes, we could assume that the old contents are still in the annotation but this 
makes me a little nervous because there's nothing stopping a user of Okular 
core from modifying the annotation's contents as well which would then break 
the undo stack.  But we could do it this way and just add API documentation 
specifying that the annotation's contents should not be updated.  

If we do go this route I have a question.  The AnnotationWindow class uses the 
function GuiUtils::contents rather than Annotation::contents when retrieving 
the contents of an annotation.  Would the Document class need to use this 
GuiUtils version as well in order to grab the old contents (rather than 
Annotation::contents?).  I'm not really clear from the source what conditions 
the GuiUtils version is handling.  If so we'll need to move this function out 
of GuiUtils (because of the GUI dependency) and into some other core class.  
Let me know if you have a preference of where to move it to.


 On March 14, 2013, 7:43 p.m., Albert Astals Cid wrote:
  core/document.h, line 394
  http://git.reviewboard.kde.org/r/107442/diff/6/?file=119424#file119424line394
 
  Do we need the bool? Seems it's only called once with true, no?

Yes, it looks like we're only ever setting it to true now.  I will get rid of 
it.


 On March 14, 2013, 7:43 p.m., Albert Astals Cid wrote:
  ui/annotwindow.h, line 38
  http://git.reviewboard.kde.org/r/107442/diff/6/?file=119430#file119430line38
 
  We don't seem to use it anymore, or maybe we didn't already, but can 
  you kill the annotation() method?

Will do


- Jon


---
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107442/#review29227
---


On March 12, 2013, 1:26 a.m., Jon Mease wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 http://git.reviewboard.kde.org/r/107442/
 ---
 
 (Updated March 12, 2013, 1:26 a.m.)
 
 
 Review request for Okular.
 
 
 Description
 ---
 
 This patch adds undo/redo support to Okular annotation manipulation commands.
 
 Functionality:
 The following actions can be undone and redone: creation and removal of 
 annotations, editing arbitrary annotation properties, relocating annotations 
 with Ctrl+drag, and editing the text contents of an annotation.
 
 This patch does not include support for undoing and redoing editing actions 
 on forms.
 
   
 
 
 This addresses bug 177501.
 http://bugs.kde.org/show_bug.cgi?id=177501
 
 
 Diffs
 -
 
   core/annotations.h 72abdff 
   core/annotations.cpp 49ab5bd 
   core/annotations_p.h 221572d 
   core/document.h 6ff6536 
   core/document.cpp 5ab759e 
   core/document_p.h fb3aec6 
   core/page.cpp 1db2763 
   part.rc 39c1571 
   ui/annotationpropertiesdialog.cpp 4b02258 
   ui/annotwindow.h f7df9f6 
   ui/annotwindow.cpp c1bafb9 
   ui/pageview.cpp b018dfe 
 
 Diff: http://git.reviewboard.kde.org/r/107442/diff/
 
 
 Testing
 ---
 
 I have tested the undoing and redoing of the specified annotation actions 
 using .dvi and .pdf documents.
 
 
 Thanks,
 
 Jon Mease
 


___
Okular-devel mailing list
Okular-devel@kde.org
https://mail.kde.org/mailman/listinfo/okular-devel