[atlantik-cvs] CVS: kdegames/atlantik/client monopigator.cpp,1.11,1.12 monopigator.h,1.10,1.11 selectgame_widget.cpp,1.27,1.28 selectserver_widget.cpp,1.24,1.25

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

Modified Files:
	monopigator.cpp monopigator.h selectgame_widget.cpp 
	selectserver_widget.cpp 
Log Message:
fix for #54524 by Albert 'TSDgeos' Astals Cid

Index: monopigator.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/monopigator.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- monopigator.cpp	21 Jan 2003 02:44:31 -0000	1.11
+++ monopigator.cpp	27 May 2003 21:03:19 -0000	1.12
@@ -24,6 +24,11 @@
 	m_downloadData = 0;
 }
 
+Monopigator::~Monopigator()
+{
+	if (m_job != NULL) m_job -> kill();
+}
+
 void Monopigator::loadData(const KURL &url)
 {
 	if (m_downloadData)
@@ -32,11 +37,11 @@
 	m_downloadData->open(IO_WriteOnly);
 	m_downloadData->reset();
 
-	KIO::Job *job = KIO::get(url.url(), true, false);
-	job->addMetaData(QString::fromLatin1("UserAgent"), QString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING));
+	m_job = KIO::get(url.url(), true, false);
+	m_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 &)));
-	connect(job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *)));
+	connect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)), SLOT(slotData(KIO::Job *, const QByteArray &)));
+	connect(m_job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *)));
 }
 
 void Monopigator::slotData(KIO::Job *, const QByteArray &data)
@@ -47,6 +52,7 @@
 void Monopigator::slotResult(KIO::Job *job)
 {
 	processData(m_downloadData->buffer(), !job->error());
+	m_job = NULL;
 }
 
 void Monopigator::processData(const QByteArray &data, bool okSoFar)

Index: monopigator.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/monopigator.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- monopigator.h	21 Jan 2003 02:44:31 -0000	1.10
+++ monopigator.h	27 May 2003 21:03:19 -0000	1.11
@@ -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 *m_job;
 };
 
 #endif

Index: selectgame_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectgame_widget.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- selectgame_widget.cpp	25 Feb 2003 02:49:48 -0000	1.27
+++ selectgame_widget.cpp	27 May 2003 21:03:19 -0000	1.28
@@ -48,8 +48,7 @@
 	connect(m_gameList, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)), this, SLOT(validateConnectButton()));
 	connect(m_gameList, 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());
 
 	KPushButton *backButton = new KPushButton(SmallIcon("back"), i18n("Server List"), this);
 	buttonBox->addWidget(backButton);
@@ -63,7 +62,7 @@
 	buttonBox->addWidget(m_connectButton);
 
 	connect(m_connectButton, SIGNAL(clicked()), this, SLOT(connectClicked()));
-	
+
     // Status indicator
 	m_statusLabel = new QLabel(this);
 	m_statusLabel->setText(i18n("Retrieving game list..."));

Index: selectserver_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- selectserver_widget.cpp	6 Mar 2003 13:42:53 -0000	1.24
+++ selectserver_widget.cpp	27 May 2003 21:03:19 -0000	1.25
@@ -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
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.