[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Html validator plugin crashes when compiled with gcc-4.0.3
From: Andreas Schlapbach <schlpbch () iam ! unibe ! ch>
Date: 2002-03-06 9:37:16
[Download RAW message or body]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Looks good, but I would set it m_part and m_configDialog to 0 int the Constructor<br>
<br>
PluginValidators::PluginValidators( QObject* parent, const char* name,<br>
&n \
bsp; \
const QStringList & )<br> : Plugin( parent, name ), m_part(0), \
m_configDialog(0)<br> <br>
so you can skip the 'else' -part.<br>
<br>
Andreas<br>
<br>
Andreas Simon wrote:<br>
<blockquote type="cite" cite="mid:1015383955.10672.60.camel@obsidian.localdomain">
<pre wrap="">On Wed, 2002-03-06 at 02:41, Aaron J. Seigo wrote:<br></pre>
<blockquote type="cite">
<pre wrap="">otherwise try using QObject::inherits()<br></pre>
</blockquote>
<pre wrap=""><!----><br>Although is looks like a little bit overkill to \
me<br>it's foolproof. Any objections?<br><br>Cheers,<br>Andreas<br></pre> <pre \
wrap=""><br><hr width="90%" size="4"><br>? p<br>Index: \
plugin_validators.cpp<br>===================================================================<br>RCS \
file: /home/kde/kdeaddons/konq-plugins/validators/plugin_validators.cpp,v<br>retrieving \
revision 1.9<br>diff -u -3 -p -r1.9 plugin_validators.cpp<br>--- \
plugin_validators.cpp 2002/02/04 08:46:28 1.9<br>+++ plugin_validators.cpp 2002/03/06 \
02:45:53<br>@@ -58,15 +58,23 @@ PluginValidators::PluginValidators( QObj<br> \
"cssvalidator", 0,<br> this, SLOT(slotValidateCSS()),<br> \
actionCollection(), "validateCSS") ); <br>- <br>- m_menu->insert( new KAction( \
i18n( "&Configure Validator..." ),<br>- "configure", 0,<br>- \
this, SLOT(slotConfigure()),<br>- actionCollection(), "configure") );<br>- \
<br>- m_part = dynamic_cast<KHTMLPart *>(this->parent());<br>- \
m_configDialog = new ValidatorsDialog(m_part->widget());<br>- \
this->setURLs();<br>+<br>+ if ( parent && parent->inherits( \
"KHTMLPart" ))<br>+ {<br>+ m_menu->insert( new KAction( i18n( \
"&Configure Validator..." ),<br>+ "configure", 0,<br>+ this, \
SLOT(slotConfigure()),<br>+ actionCollection(), "configure") );<br>+<br>+ \
m_part = static_cast<KHTMLPart *>( parent );<br>+ m_configDialog = new \
ValidatorsDialog( m_part->widget() );<br>+ this->setURLs();<br>+ }<br>+ \
else<br>+ {<br>+ m_part = 0;<br>+ m_configDialog = 0;<br>+ }<br> \
}<br> <br> PluginValidators::~PluginValidators()<br></pre> </blockquote>
<br>
</body>
</html>
> > 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