[Kde-games-devel] Another small patch

Albert 'TSDgeos' Astals Cid tsdgeos at terra.es
Wed Apr 30 19:31:17 CEST 2003


This time it is for atlantik

It removes another command line layout warning 
QLayout "unnamed" added to SelectServer "selectServer", which already has a 
layout
and makes the program exit when downloading the server list 'hangs' (for 
example you are not connected to the internet) and you click on [x], 
previously the prompt didn't return.

The patch:

Index: monopigator.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/monopigator.cpp,v
retrieving revision 1.11
diff -u -r1.11 monopigator.cpp
--- monopigator.cpp	21 Jan 2003 02:44:31 -0000	1.11
+++ monopigator.cpp	30 Apr 2003 16:24:19 -0000
@@ -24,6 +24,11 @@
 	m_downloadData = 0;
 }

+Monopigator::~Monopigator()
+{
+	job -> kill();
+}
+
 void Monopigator::loadData(const KURL &url)
 {
 	if (m_downloadData)
@@ -32,7 +37,7 @@
 	m_downloadData->open(IO_WriteOnly);
 	m_downloadData->reset();

-	KIO::Job *job = KIO::get(url.url(), true, false);
+	job = KIO::get(url.url(), true, false);
 	job->addMetaData(QString::fromLatin1("UserAgent"), 
QString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING));

 	connect(job, SIGNAL(data(KIO::Job *, const QByteArray &)), 
SLOT(slotData(KIO::Job *, const QByteArray &)));
Index: monopigator.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/monopigator.h,v
retrieving revision 1.10
diff -u -r1.10 monopigator.h
--- monopigator.h	21 Jan 2003 02:44:31 -0000	1.10
+++ monopigator.h	30 Apr 2003 16:24:19 -0000
@@ -29,6 +29,7 @@

 public:
 	Monopigator();
+	~Monopigator();
 	void loadData(const KURL &);

 signals:
@@ -43,6 +44,7 @@
 	void processData(const QByteArray &, bool = true);
 
 	QBuffer *m_downloadData;
+	KIO::Job *job;
 };

 #endif
Index: selectserver_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.cpp,v
retrieving revision 1.24
diff -u -r1.24 selectserver_widget.cpp
--- selectserver_widget.cpp	6 Mar 2003 13:42:53 -0000	1.24
+++ selectserver_widget.cpp	30 Apr 2003 16:24:19 -0000
@@ -49,9 +49,7 @@
 	connect(m_serverList, SIGNAL(rightButtonClicked(QListViewItem *, const 
QPoint &, int)), this, SLOT(validateConnectButton()));
 	connect(m_serverList, SIGNAL(selectionChanged(QListViewItem *)), this, 
SLOT(validateConnectButton()));
 
-	QHBoxLayout *buttonBox = new QHBoxLayout(this, 0, KDialog::spacingHint());
-	m_mainLayout->addItem(buttonBox);
-
+	QHBoxLayout *buttonBox = new QHBoxLayout(m_mainLayout, 
KDialog::spacingHint());
 	buttonBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, 
QSizePolicy::Minimum));

 	// Add Server



More information about the kde-games-devel mailing list