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

List:       kde-devel
Subject:    KUniqueApplication returns DCOP errors
From:       David Jarvie <djarvie () lineone ! net>
Date:       2001-04-09 23:41:07
[Download RAW message or body]

I have tried to convert an application which previously used KApplication, to 
use KUniqueApplication (using KDE 2.1.1 - SuSE 7.0 RPMs). However, I get the 
following errors when I run it (although the first error doesn't appear every 
time):

	ERROR: KUniqueApplication: Registering failed!
	ERROR: KUniqueApplication: DCOP communication error!

My code virtually copies that given in the documentation for 
KUniqueApplication, and also is very similar to the source for Ark (in 
kdeutils). I have looked at the source code for KUniqueApplication, but I 
can't see why DCOP is causing problems. Is there some compile/link/make 
requirement for using DCOP which I have failed to fulfil? Can anyone help?

My code is as follows. It never gets to the line "KAlarmApp app;"  Note: I 
made sure that any existing instances of the application were killed each 
time before testing the application!



class KAlarmApp : public KUniqueApplication
{
public:
	KAlarmApp() : KUniqueApplication() { }
	virtual int newInstance();
};

int main(int argc, char *argv[])
{
	KAboutData aboutData("progname", I18N_NOOP("ProgName"),
		"0.1", description, KAboutData::License_GPL,
		"(c) 2001, author", 0, 0, "email");
	aboutData.addAuthor("author",0, "email");
	KCmdLineArgs::init(argc, argv, &aboutData);
	KCmdLineArgs::addCmdLineOptions(options);

	if (!KAlarmApp::start())
	{
		// An instance of the application is already running
		exit(0);
	}
	KAlarmApp app;

	. . .
}

int KAlarmApp::newInstance()
{
	. . .
}



David Jarvie

 
>> Visit http://master.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