[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    GUI unresponsiveness
From:       Joris Guisson <joris.guisson () gmail ! com>
Date:       2006-02-04 19:38:53
Message-ID: 6bc528f40602041138k5119ec1k2601a8dae7683e6c () mail ! gmail ! com
[Download RAW message or body]

Hi,

I have the following problem, if you look at this code snippet of KTorrent :

	bool UPnPRouter::downloadXMLFile()
	{
		QString target;
		// download the contents
		if (KIO::NetAccess::download(location,target,0))
		{
			// load in the file (target is always local)
			UPnPDescriptionParser desc_parse;
			bool ret = desc_parse.parse(target,this);
			if (!ret)
			{
				Out() << "Error parsing router description !" << endl;
				QString dest = KGlobal::dirs()->saveLocation("data","ktorrent") +
"upnp_failure";
				if (bt::Exists(dest))
					bt::Delete(dest,true);
				bt::CopyFile(target,dest,true);
			}
			// and remove the temp file
			KIO::NetAccess::removeTempFile(target);
			return ret;
		}
		else
		{
			return false;
		}
		return true;
	}

When the UPnPDescritionParser fails and we enter the if (!ret)
section. The GUI of KTorrent becomes totally unresponsive. It draws
fine, and ktorrent just keeps on running and dowloads everything fine.
Any user input just does not get responded to. The only thing you can
do is minimize the application. The GUI does get updated, this is not
an infinite loop where the GUI does not get redrawn anymore.

These function calls are wrappers around KIO::NetAccess calls :
bt::Delete(dest,true);
bt::CopyFile(target,dest,true);

I have seen this before and this only happens when KIO::NetAccess is
involved. I think nested KIO::NetAccess calls are the problem, and
that GUI events get delivered to the wrong event loop (that is
assuming that the KIO::NetAccess call starts it own event loop, which
seems to me is the way to make asynchronous KIO::Job's synchronous,
correct me if I'm wrong here)

So does anybody know a solution for this problem ? The code in the if
is just for debugging purposes, and I can just throw it out. But I
would like to keep it in.

Joris,
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic