[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Fix for kfilewidget.cpp
From:       "David Boosalis" <david.boosalis () gmail ! com>
Date:       2008-10-17 4:39:12
Message-ID: 870c99310810162139n3e52ccap53c0edc8709be1f0 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


HI KKDE maintainers.
Lword & other koffice applications core dump on startup and it occurs in
kfilewidget.cpp.  I am talking about  building koffice and klibs out of the
svn repository

The change that fixes is to apply checks for null pointers in
KFileWidget::showEvent().  I don't know what these pointers are, and perhaps
it is an error in koffice applications, but a simple check as shown below
does catch the error and allow kword to come up.



void KFileWidget::showEvent(QShowEvent* event)
{

  if (d) {  // this is a new check
    if ( !d->hasView ) { // delayed view-creation
      if (d->ops) { // this is a new check
        d->ops->setView( KFile::Default );
        d->ops->view()->setSizePolicy( QSizePolicy( QSizePolicy::Maximum,
QSizePolicy::Maximum ) );
      }
        d->hasView = true;
    }
    if (d->ops) // this is a new check
      d->ops->clearHistory();
  }
  QWidget::showEvent(event);




-David

[Attachment #5 (text/html)]

<div dir="ltr">HI KKDE maintainers.<br>Lword &amp; other koffice applications core \
dump on startup and it occurs in kfilewidget.cpp.&nbsp; I am talking about&nbsp; \
building koffice and klibs out of the svn repository <br><br>The change that fixes is \
to apply checks for null pointers in KFileWidget::showEvent().&nbsp; I don&#39;t know \
what these pointers are, and perhaps it is an error in koffice applications, but a \
simple check as shown below does catch the error and allow kword to come up.&nbsp; \
<br> <br><br><br>void KFileWidget::showEvent(QShowEvent* event)<br>{<br><br>&nbsp; if \
(d) {&nbsp; // this is a new check<br>&nbsp;&nbsp;&nbsp; if ( !d-&gt;hasView ) { // \
delayed view-creation<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (d-&gt;ops) { // this is a \
new check<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;ops-&gt;setView( \
KFile::Default );<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
d-&gt;ops-&gt;view()-&gt;setSizePolicy( QSizePolicy( QSizePolicy::Maximum, \
QSizePolicy::Maximum ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;hasView = \
true;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; if (d-&gt;ops) // this is a new \
check<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;ops-&gt;clearHistory();<br> &nbsp; \
}<br>&nbsp; QWidget::showEvent(event);<br><br><br><br><br>-David<br><br><br><br><br></div>




>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic