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

List:       kde-devel
Subject:    Re: Problem with KIO, it seems no signals are emetted
From:       Giuseppe Torelli <lcdn () inwind ! it>
Date:       2003-07-21 7:00:25
[Download RAW message or body]

Alle 15:16, venerd́ 18 luglio 2003, Kevin Krammer ha scritto:

> Do you get any warning about inknown singals or slots on the console you
> start your program from?

Unfortunately not. This is a snip of the code:

void GetAddress::RetrieveAddress ( QListView *view )
{
	/*static const QString *URL[3] =	{
		{ new QString("www.libero.it")},
		{ new QString("www.google.it")},
							};*/

			//for (int i = 0; i < 3; i++) {
				job [ 0 ] = KIO::get ( Page [ 0 ]->latin1(), true );
				job [ 0 ]->addMetaData ("User Agent" , "Mizio 0.1" );
				connect (job [ 0 ], SIGNAL (data( KIO::Job*, const QByteArray & )) , SLOT 
(slotData ( KIO::Job*, const QByteArray & )) );
				connect (job [ 0 ], SIGNAL (result( KIO::Job*)) , SLOT (slotResult 
(KIO::Job*)) );
				connect (job [ 0 ], SIGNAL (canceled( KIO::Job*)) , SLOT (slotResult 
(KIO::Job*)) );

				/*
			if ( (Address_Socket[i]= new KSocket ( URL[i]->latin1(), 80,2 ) ) !=NULL && 
Address_Socket[i]->socket()!=-1 )	{
					printf ("Connected, sending %s",Page[i]->latin1() );
					send(Address_Socket[ i 
]->socket(),Page[i]->latin1(),Page[i]->length(),0);
					while ( (length = recv(Address_Socket[ i ]->socket(),buffer, 80 , 0 ) ) > 
0 )	{
						QString temp(buffer);
						QString No_HTML = temp.insert( length, buffer );
						int nl = No_HTML.contains( "\n" );
						if (nl)
						{
							int a = No_HTML.contains( "<" );
							int b = No_HTML.contains( ">" );
							//printf ("%d %d",a,b);
							if ( a !=0 && b !=0 )
							{
								//printf ("%s",No_HTML.latin1() );
								//sleep (1);
								//No_HTML.replace (QRegExp ("<[^>]*>"), "" );
								int pos1 = No_HTML.find( QRegExp("<"), 0 );
								int pos2 = No_HTML.find( QRegExp(">"), 0 );
								printf ("%d - %d - %s\n",pos1,pos2,No_HTML.latin1() );
								sleep (1);
							}
						}
																								}
					delete Address_Socket[ i ];
																															}*/
				/*else	{
					printf ("Can't connect to %s",URL[ i ]->latin1() );
						}
										}
												*///}

		//Proxy_List.close ();
}

void GetAddress::slotData (KIO::Job*, const QByteArray &data)
{
	if (data.size() == 0)
	{
		printf ("Non ci sono dati !");
	}

	else
	{
	QCString c_string(data.data(), data.size());
	 kdDebug() << "Data: \"" << c_string.data() << "\"" << endl;
	}
}

void GetAddress::slotResult ( KIO::Job* )
{
 if (job[0]->error())
      job[0]->showErrorDialog();
}

void GetAddress::dataReq ( KIO::Job *, QByteArray &data)
{
}

Is the KdDebug line correct ? Thank you for your help
-- 
Giuseppe Torelli

 
>> 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