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

List:       kde-devel
Subject:    R: Help for KDirLister
From:       "Posta Leo" <lcento () ilmattino ! it>
Date:       2002-06-09 20:11:57
[Download RAW message or body]



-----Messaggio originale-----
Da: kde-devel-admin@mail.kde.org
[mailto:kde-devel-admin@mail.kde.org]Per conto di Björn Sahlström
Inviato: domenica 9 giugno 2002 1.28
A: kde-devel@kde.org
Oggetto: Re: Help for KDirLister


On Saturday 08 June 2002 23.15, Posta Leo wrote:
> Sorry, I am a beginner in the use of kdevelop.
>
> Can someone help me sending an example code about the use of kDirLister ?
>
> Thanks.
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<

I suggest that you take alook in KDirOperator source code.
--
Mvh
Björn Sahlström
kbjorn@users.sourceforge.net

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe
<<

Thanks for your help. I'm trying to use KDirWatch.

I have written the following source code for test:

#include <qapplication.h>
#include <qobject.h>
#include <qthread.h>
#include <kdirnotify.h>
#include <kdirwatch.h>
#include <qstring.h>



	class MyThread : public QThread {
	public:
		virtual void run();
	};


  	void MyThread::run()
  	{
      qDebug("Directory updated");
    	}


	class DirectoryLister : public QObject {
		Q_OBJECT

	public slots:
		void slotStartThread();
	};


	void DirectoryLister::slotStartThread()


		MyThread a;
		emit a.start();
		emit a.wait();
	}


	int main(int argc, char *argv[])


		DirectoryLister lister;

		KDirWatch *dirWatch = new KDirWatch();

   		QString My_Dir="/home/atex/test";

		DirectoryLister::connect(dirWatch, SIGNAL(dirty(My_Dir)), &lister,
SLOT(slotStartThread()));

      	dirWatch->addDir(My_Dir);
		dirWatch->startScan(true, false);

		dirWatch->stopScan();

	}

#include "dirlister.moc"

The compile process it's ok, but I see the following errors when it's
performed:

QObject::connect: No such signal KDirWatch::dirty(My_Dir)
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'unnaned')

Can you tell me why ?

Thanks.



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