[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui board.cpp,1.106,1.107 estateview.cpp,1.70,1.71

[email protected]
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv6958/atlantik/libatlantikui

Modified Files:
	board.cpp estateview.cpp 
Log Message:
dynamic_cast fixes


Index: board.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/board.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- board.cpp	12 Feb 2003 03:05:29 -0000	1.106
+++ board.cpp	28 May 2003 03:29:34 -0000	1.107
@@ -105,7 +105,7 @@
 	for (QPtrListIterator<EstateView> i(m_estateViews); *i; ++i)
 	{
 		estateView = dynamic_cast<EstateView*>(*i);
-		if (estateView->estate() == estate)
+		if (estateView && estateView->estate() == estate)
 			return estateView;
 	}
 	return 0;

Index: estateview.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/estateview.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- estateview.cpp	2 Aug 2002 14:26:43 -0000	1.70
+++ estateview.cpp	28 May 2003 03:29:34 -0000	1.71
@@ -434,7 +434,10 @@
 				rmbMenu->insertItem(i18n("Request Trade with %1").arg(player->name()), 3);
 		}
 
-		connect(dynamic_cast<KPopupMenu *>(rmbMenu), SIGNAL(activated(int)), this, SLOT(slotMenuAction(int)));
+		KPopupMenu *pm = dynamic_cast<KPopupMenu *>(rmbMenu);
+		if (pm) {
+			connect(pm, SIGNAL(activated(int)), this, SLOT(slotMenuAction(int)));
+		}
 		QPoint g = QCursor::pos();
 		rmbMenu->exec(g);
 		delete rmbMenu;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.