Spot the guaranteed crash:

assert( aAccount->metaObject()->className() == "KMAcctCachedImap" );

svn path=/trunk/KDE/kdepim/; revision=631760
wilder-work
David Faure 19 years ago
parent 6927810ea8
commit a179288583
  1. 6
      kmcomposewin.cpp
  2. 2
      kmfoldercachedimap.cpp
  3. 2
      kmfoldertree.cpp
  4. 6
      kmheaders.cpp
  5. 16
      kmkernel.cpp
  6. 4
      kmmimeparttree.cpp
  7. 4
      kmreaderwin.cpp

@ -194,7 +194,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id )
mAutoSaveTimer( 0 ), mLastAutoSaveErrno( 0 )
{
(void) new MailcomposerAdaptor( this );
QDBusConnection::sessionBus().registerObject("/Composer", this);
QDBusConnection::sessionBus().registerObject("/Composer", this);
mClassicalRecipients = GlobalSettings::self()->recipientsEditorType() ==
GlobalSettings::EnumRecipientsEditorType::Classic;
@ -770,9 +770,9 @@ void KMComposeWin::slotView(void)
//This sucks awfully, but no, I cannot get an activated(int id) from
// actionContainer()
if ( sender()->metaObject()->className() != "KToggleAction")
KToggleAction *act = ::qobject_cast<KToggleAction *>( sender() );
if ( !act )
return;
KToggleAction *act = (KToggleAction *) sender();
if (act == mAllFieldsAction)
id = 0;

@ -1572,7 +1572,7 @@ void KMFolderCachedImap::slotProgress(unsigned long done, unsigned long total)
void KMFolderCachedImap::setAccount(KMAcctCachedImap *aAccount)
{
assert( aAccount->metaObject()->className() == "KMAcctCachedImap" );
assert( ::qobject_cast<KMAcctCachedImap *>(aAccount) );
mAccount = aAccount;
if( imapPath()=="/" ) aAccount->setFolder( folder() );

@ -1648,7 +1648,7 @@ bool KMFolderTree::eventFilter( QObject *o, QEvent *e )
{
if ( e->type() == QEvent::MouseButtonPress &&
static_cast<QMouseEvent*>(e)->button() == Qt::RightButton &&
QString(o->metaObject()->className()) == "Q3Header" )
::qobject_cast<Q3Header *>(o) )
{
mPopup->popup( static_cast<QMouseEvent*>(e)->globalPos() );
return true;

@ -254,7 +254,7 @@ bool KMHeaders::eventFilter ( QObject *o, QEvent *e )
{
if ( e->type() == QEvent::MouseButtonPress &&
static_cast<QMouseEvent*>(e)->button() == Qt::RightButton &&
QString(o->metaObject()->className()) == "Q3Header" )
::qobject_cast<Q3Header *>(o) )
{
// if we currently only show one of either sender/receiver column
// modify the popup text in the way, that it displays the text of the other of the two
@ -1321,9 +1321,11 @@ void KMHeaders::setStyleDependantFrameWidth()
{
// set the width of the frame to a reasonable value for the current GUI style
int frameWidth;
if( style()->metaObject()->className() == "KeramikStyle" )
#if 0 // is this hack still needed with kde4?
if( !qstrcmp( style()->metaObject()->className(), "KeramikStyle" ) )
frameWidth = style()->pixelMetric( QStyle::PM_DefaultFrameWidth ) - 1;
else
#endif
frameWidth = style()->pixelMetric( QStyle::PM_DefaultFrameWidth );
if ( frameWidth < 0 )
frameWidth = 0;

@ -349,7 +349,7 @@ void KMKernel::openReader( bool onlyCheck )
for ( QList<KMainWindow*>::const_iterator it = KMainWindow::memberList().begin();
it != KMainWindow::memberList().end(); ++it ) {
if ( (*it)->metaObject()->className() == "KMMainWin" ) {
if ( ::qobject_cast<KMMainWin *>(*it) ) {
ktmw = (*it);
break;
}
@ -882,7 +882,7 @@ QStringList KMKernel::folderList() const
QDBusObjectPath KMKernel::getFolder( const QString& vpath )
{
#if 0
#if 0
QString adaptorName;
const QString localPrefix = "/Local";
if ( the_folderMgr->getFolderByURL( vpath ) )
@ -899,7 +899,7 @@ QDBusObjectPath KMKernel::getFolder( const QString& vpath )
QDBusConnection::sessionBus().registerObject( vpath, this );
return QDBusObjectPath(vpath);
}
#endif
#endif
#ifdef __GNUC__
#warning Port DCOPRef usage!
#endif
@ -924,10 +924,10 @@ void KMKernel::raise()
if (!iface.isValid() || !(reply = iface.call("newInstance")).isValid())
{
QDBusError err = iface.lastError();
kError() << "Communication problem with kmail"
kError() << "Communication problem with kmail"
<< "Error message was: " << err.name() << ": \"" << err.message() << "\"" << endl;
}
}
bool KMKernel::showMail( quint32 serialNumber, QString /* messageId */ )
@ -1489,8 +1489,8 @@ void KMKernel::closeAllKMailWindows()
KMainWindow *window = 0;
while ( it.hasNext() ) {
window = it.next();
if ( window && ( window->metaObject()->className() == "KMMainWindow" ||
window->inherits("KMail::SecondaryWindow") ) )
if ( ::qobject_cast<KMMainWin *>(window) ||
::qobject_cast<KMail::SecondaryWindow *>(window) )
{
window->setAttribute(Qt::WA_DeleteOnClose);
window->close(); // close and delete the window
@ -1918,7 +1918,7 @@ KMainWindow* KMKernel::mainWin()
// First look for a KMMainWin.
for ( QList<KMainWindow*>::const_iterator it = KMainWindow::memberList().begin();
it != KMainWindow::memberList().end(); ++it )
if ( (*it)->metaObject()->className() == "KMMainWin" )
if ( ::qobject_cast<KMMainWin *>(*it) )
return kmWin;
// There is no KMMainWin. Use any other KMainWindow instead (e.g. in

@ -185,9 +185,11 @@ void KMMimePartTree::setStyleDependantFrameWidth()
{
// set the width of the frame to a reasonable value for the current GUI style
int frameWidth;
if( style()->metaObject()->className() == "KeramikStyle" )
#if 0 // is this hack still needed with kde4?
if( !qstrcmp( style()->metaObject()->className(), "KeramikStyle" ) )
frameWidth = style()->pixelMetric( QStyle::PM_DefaultFrameWidth ) - 1;
else
#endif
frameWidth = style()->pixelMetric( QStyle::PM_DefaultFrameWidth );
if ( frameWidth < 0 )
frameWidth = 0;

@ -1902,9 +1902,11 @@ void KMReaderWin::setStyleDependantFrameWidth()
return;
// set the width of the frame to a reasonable value for the current GUI style
int frameWidth;
if( style()->metaObject()->className() == "KeramikStyle" )
#if 0 // is this hack still needed with kde4?
if( !qstrcmp( style()->metaObject()->className(), "KeramikStyle" ) )
frameWidth = style()->pixelMetric( QStyle::PM_DefaultFrameWidth ) - 1;
else
#endif
frameWidth = style()->pixelMetric( QStyle::PM_DefaultFrameWidth );
if ( frameWidth < 0 )
frameWidth = 0;

Loading…
Cancel
Save