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

List:       kde-devel
Subject:    Porting questions
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2000-07-18 21:03:30
[Download RAW message or body]

Hi folks, sorry if these have been asked time and time again, but I
couldn't find them in the (pretty good) porting guide nor -- after a quick
scan -- in the style guides. My questions concern coding style, really. As
in "I have this gruesome KDE 1 app I want to port to KDE 2 and make nice."

I'm trying to port KPilot (3.2.0) to KDE2. So is Dan. Cornelius may be
helping as well. That leaves me very much the the junior member of the
effort, in terms of KDE 2 experience [ maybe other experiences too, I've
never met either one of them :) ]

(1) I've got a page in a tabbed dialog I used to put an icon on, with code
like this:

	infoPixmap->setPixmap(l.loadIcon("information.xpm"));

In KDE2, loadIcon() requires a group. I could use Desktop, but would that
be the right one? Or is it just not kosher anymore to place decorative
icons in a window?

(2) KPilot is split into several distinct processes. There's:

KPilot - the UI end of things
KPilotDaemon - which talks to the serial port
conduits - which talk to the daemon and to applications like korganizer

All three of these need to read the same configuration file - for example,
the UI sets hardware parameters the daemon needs to know about, the UI
tells the conduits what files to sync with, etc. This communication goes
through the config file. Maybe question (2a) is: is this the right way to
do things in KDE 2?

So far I've been using code like this:

KConfig *c = new KConfig ( kde_localdir() + QString("kpilotrc") ) ;

to get to the config file (from ~/.kde/share/apps/kpilotrc). In KPilot
itself this is just new KConfig() of course. With the disappearance of
kde_*dir from KDE, this should become locate(sort,"kpilotrc"), but I'm not
sure what sort should be (the porting guide suggests "local"), and I need
the per-user settings. Question (2b) what is the code that ought to go
here?

(3) Similarly, KPilot looks for the installed conduits with 

	QString conduitPath = kapp->kde_datadir() + "/kpilot/conduits";
	QDir availableDir(conduitPath);

(because the conduits have traditionally gone into /usr/share/apps +
/kpilot/conduits/, and we need to know that the processes we start are in
fact conduits (which we assume based on their location)). Now I really
don't know what to fill in in locate(). Any hints?


All in all, you can tell that I'm working with a (seriously outdated) KDE1
mindset here; maybe this has all been discussed to death already and I
should go back and read all the design discussions in the list
archives. But really, my main concern is getting KPilot into some
semblance of order so that it might, just might, be the Palm Pilot sync
software of choice for KDE 2.

ade [ using the porting guide to wade semi-successfully though all that
code, but without knowing if he's really doing The Right Thing (tm) ]

-- 
To UNSUBSCRIBE from the KPilot mailing list, send a message
with subject "unsubscribe kpilot-list" and an empty body
to majordomo@slac.com.
 
Adriaan de Groot -- KPilot 3.1 (for KDE 1.x) maintainer
http://www.cs.kun.nl/~adridg/kpilot/kpilot-bugs.html

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