[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp, 1.157.2.5, 1.157.2.6 eventlogwidget.cpp, 1.1.2.2, 1.1.2.3 eventlogwidget.h, 1.1.2.2, 1.1.2.3

[email protected] Mon, 8 Dec 2003 05:50:06 +0100 (CET)
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv2661/client

Modified Files:
      Tag: atlantik_3_3_branch
	atlantik.cpp eventlogwidget.cpp eventlogwidget.h 
Log Message:
Use EventLog::events() to populate widget

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.157.2.5
retrieving revision 1.157.2.6
diff -u -d -r1.157.2.5 -r1.157.2.6
--- atlantik.cpp	7 Dec 2003 23:31:50 -0000	1.157.2.5
+++ atlantik.cpp	8 Dec 2003 04:50:03 -0000	1.157.2.6
@@ -432,10 +432,7 @@
 void Atlantik::showEventLog()
 {
 	if (!m_eventLogWidget)
-	{
 		m_eventLogWidget = new EventLogWidget(m_eventLog, 0);
-		m_eventLog->emitAll();
-	}
 	m_eventLogWidget->show();
 }
 

Index: eventlogwidget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/Attic/eventlogwidget.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- eventlogwidget.cpp	8 Dec 2003 04:40:55 -0000	1.1.2.2
+++ eventlogwidget.cpp	8 Dec 2003 04:50:04 -0000	1.1.2.3
@@ -46,12 +46,6 @@
 	return m_events;
 }
  
-void EventLog::emitAll()
-{
-	for (QPtrListIterator<Event> it(m_events); (*it) ; ++it)
-		emit newEvent((*it));
-}
-
 EventLogWidget::EventLogWidget(EventLog *eventLog, QWidget *parent, const char *name)
 	: QWidget(parent, name,
 	  WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title |
@@ -80,6 +74,11 @@
 	actionBox->addWidget(m_saveButton);
 
 	connect(m_saveButton, SIGNAL(clicked()), this, SLOT(save()));
+
+	// Populate
+	QPtrList<Event> events = m_eventLog->events();
+	for (QPtrListIterator<Event> it( events ); (*it) ; ++it)
+		addEvent( (*it) );
 }
 
 void EventLogWidget::addEvent(Event *event)

Index: eventlogwidget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/Attic/eventlogwidget.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- eventlogwidget.h	8 Dec 2003 04:40:55 -0000	1.1.2.2
+++ eventlogwidget.h	8 Dec 2003 04:50:04 -0000	1.1.2.3
@@ -35,7 +35,6 @@
 public:
 	EventLog();
 	QPtrList<Event> events();
-	void emitAll();
 
 public slots:
 	void addEvent(const QString &description, const QString &icon = QString::null);