KPilot Developer's notes for february 4th 2001
==============================================

Nick Papadonis spent hours tracking down the vcal conduit crash and
we found at least one bug in kpilotlink. It's been removed and I
hope this quashes all the vcal crashes. Other than that there's simply 
not much we *can* do with the message and feature freeze and all.
This is why the todo-immediately-after-freeze list exists:

* Split KPilotLink into its separate functionalities: config management,
  local database management, and link from daemon to conduits.
* Make KPilot and KPilotDaemon communicate only through DCOP.
* Add an extra message concerning NULL user on hotsync.
* Sort out all the icon issues.
* Make the progress bar show something uring a conduit sync.



KPilot Developer's notes for january 6th 2001
=============================================

Happy Millennium. I ([ade]) am off on a two-week vacation to
Calgary, so no KPilot news from me till (almost) february. 

There have been several troublesome bugreports this week,
ranging from "all the conduits crash" to "daemon dies on
hotsync." That don't make me happy at all.


Done this week:

* Built POSE, the Palm Emulator, so this may help in testing
  stuff for the OS versions that I don't actually have.
  POSE is a real $#*%^ to build, but I can now actually use my
  PalmV on-screen (with a PalmIII skin, which is kinda weird).
* Replaced the addressEditor widget with something less stone-age.
* Added a nifty feature so that you can edit one address in two
  windows and they keep semi-in-sync. abbrowser doesn't have this
  (which means abbrowser has a bug :( ).
* #&$%#$ conduitApp doesn't turn the GUI on by default, so recent
  vcal crashes can be blamed on trying to create a KMessageBox without
  a GUI :( Changed the default values.
* Tried fixing some ugly icons. I'm no artist though.
* Teeny-tiny layout change in Address page of setup dialog.
* If you try to add records to the address book before you've done
  a HotSync / Backup KPilot has an empty AddressDB and doesn't deal
  with the address very well. Added a sorry() there.
* Added a doTest() to vcal-conduit.
* More cleanups in the debugging code. There's still a weird mix of
  code controlled by --debug and kdebugdialog style stuff. Functions
  kdWarning() and kdError() should be given __FUNCTION__ as their
  << argument, while kdDebug() should get fname as first argument.
  This will make all the debugs optimize away painlessly while keeping
  the warnings and error messages. Since messages may change status some
  time there's now a #define TEST_DEBUG that makes fname a weird object
  that can only be passed to kndbgstreams. So sensible combinations are:
  	production:	NDEBUG defined, DEBUG undefined, TEST_DEBUG undefined
  	test nodebug:	NDEBUG defined, DEBUG undefined, TEST_DEBUG defined
  	testing:	NDEBUG undefined, DEBUG defined, TEST_DEBUG defined
* Actually KPilotLink::doFullBackup wasn't all that bad. Still, all the
  code needs going-over for i18n yuckiness. doFullRestore() was worse;
  also fixed up directory yuckiness.
	  Note to self: text for user is i18n()ed, kdDebug() &c. is in 
	  english ('cause Dan or I have to read it :) )
* Finished integrating Heiko's patches. I believe that both HotSync and
  FastSync now do what the ought to do.
* Started adding a DCOP interface to the daemon.
  

Other stuff:

* It's a HotSync and a Pilot. I'll change strings in the source as
  I come across them. As for conjugations: I HotSynced, it HotSyncs.

Todo:

* Should just use the KPilotLink::config object to store all kinds
  of user settings instead of copying them from the config file to
  local variables, since this is just asking for inconsistency.
* Close bug 16457.html in some way.
* More vcal work
* Clean up more of the butt-ugly parts of the code base (less of this now!)
* Tell the KOrganizer docs people about KPilot
* KPilot is an i18n nightmare
  - The const char *s in the pilot databases can be addressed most
    easily, I think.
  - get rid of most of the strcpy, strcat, etc. But not all!
    We're stuck with pilot-link, after all.
* The password dialog in the popmail conduit is probably a very bad idea
  I think kdesud should come into play here. Anyway, a KMail conduit would
  be much cooler and safer. Sigh.


Things-to-be-considered:

* Splitting kpilotlink up into its various functionalities


KPilot Developer's notes for december 30th 2000
===============================================

Ho ho ho. Merry Christmas. Happy new year. Last week started out 
with Thomas Zander reporting that he *still* has the totally bizzarre 
and inexplicable crash in KPilot that he's had ever since KPilot was 
ported to KDE2 (+).  That pretty much colors this week's work. The rest 
of the week was used for the KNotes conduit. After a pleasant exchange 
of ideas with Wynn Wilkes (of KNotes) we got a DCOP interface working and
this make the KNotes conduit more useful. Talked to Greg about the
kab conduit and he's enthusiastic about the possibilities there,
we hope to have a framework in CVS soon.

Done:

* Claimed some debug areas (5510,5511,5512).
* KNotes rereads the notes dir after a sync, so new notes (which
  have come from Pilot memos) appear there.
* KNotes conduit --test now displays all the notes (on screen) that
  knotes shares with the pilot. This is a test (!) of the DCOP stuff,
  mostly.
* KNotes conduit now has a checksum function (md5) to reduce the
  number of notes that has to be copied between KNotes and the
  Pilot.
* Applied Dag Nygren's vcal patches so that repeating events now
  show up in KOrganizer properly.
* Fixed the button-enabling in the address app
* Added more debugging output for Thomas.
* Added more debugging output for Nick.

Todo:

* More vcal work
* Clean up more of the butt-ugly parts of the code base
* Tell the KOrganizer docs people about KPilot
* KPilot is an i18n nightmare
  - The const char *s in the pilot databases can be addressed most
    easily, I think.
  - KPilotLink::doFullBackup should cause i18n people to run away
  - get rid of most of the strcpy, strcat, etc. But not all!
    We're stuck with pilot-link, after all.
* The messages need validation - Pilot vs pilot, HotSync vs whatever
* The password dialog in the popmail conduit is probably a very bad idea

+ Thomas' crash produces the following (partial) backtrace:

#4  0x408960b7 in read_png_image () from /usr/kde2/source/qt-copy/lib/libqt.so.2
#5  0x40838dd9 in QImageIO::read () from /usr/kde2/source/qt-copy/lib/libqt.so.2
#6  0x40836cf1 in QImage::load () from /usr/kde2/source/qt-copy/lib/libqt.so.2
#7  0x408305b2 in QImage::QImage () from /usr/kde2/source/qt-copy/lib/libqt.so.2
#8  0x40483fcf in KIconLoader::loadIcon () from /usr/kde2/lib/libkdecore.so.3
#9  0x805a166 in KPilotInstaller::initIcons ()

  which is weird since the only possible png image being read is the 
  quit icon, which is standard in KDE2. Maybe some weird combo of options?

KPilot Developer's notes for december 18th 2000
===============================================

It looks like kdepim and KPilot aren't going to make the 2.1 release.
Darn. This does give us more time to deal with docs and bugfixes.
Every time I get something done though I find I've discovered two
new things to do :(. I hope Lukas will help out with a lot of the
i18n stuff though.

Done:

* Moved all the (english) docs to the correct place.
* More doc fixes: use &kpilot; and &pilot; properly, added screen shots for
  various conduit setups. The docs still aren't complete but they're a 
  darn sight better than they were.
* Modal dialogs need exec() instead of show()
* Changes in kdelibs caused some dialogs to hang in slotCancel()
* Changes in includes means we have to include kdebug.h ourselves
* Get rid of cerr and use kdDebug or kdWarning or kdError as appropriate.
  There are still a very few cerrs left in places where we can't rely on
  kdDebug().
* Added #ifdef DEBUG to the debug sections of code. So KPilot now compiles
  without debugging stuff. I realise now that I should have stuck to the
  KDE kdDebug() guidelines, but, um, I didn't know they existed when the
  port from KDE1 to KDE2 started. Darn.

ToDo:

* More vcal work
* Clean up more of the butt-ugly parts of the code base
* Detect memo-too-large in knotes conduit
* Try to reduce number of updates in knotes conduit
* Figure out a nice DCOP interface with Wynn (KNotes)
* Finally take a look at kab or whatever for the address book conduit. 
  Should probably talk to Greg about this one too.
* Tell the KOrganizer docs people about KPilot
* Fix the button-enabling in the address app
* KPilot is an i18n nightmare
  - The const char *s in the pilot databases can be addressed most
    easily, I think.
  - KPilotLink::doFullBackup should cause i18n people to run away
  - get rid of most of the strcpy, strcat, etc. But not all!
    We're stuck with pilot-link, after all.
* The messages need validation - Pilot vs pilot, HotSync vs whatever
* The password dialog in the popmail conduit is probably a very bad idea


KPilot Developer's notes for december 10th 2000
===============================================

Lots of internal stuff going on:

* The sense of the debugging flags was the wrong way around,
  so using --debug 4 gave you all the UI debugging messages
  as opposed to just the major and minor ones. This is what
  you get from suggesting debug 1023 all the time.
* BaseConduit had some weird debugging output -- not controlled
  by --debug -- so patched that up. And there was ugliness in the
  icon loading function. This changes the interface to BaseConduit
  slightly, 3rd party conduit authors beware.
* Finally fixed up the Makefile.ams for the standard conduits so
  that they run properly (without setting LD_LIBRARY_PATH).

Visible changes:

* Fixed up the documentation, the screenshots, the descriptions of the 
  conduits, etc. etc. It's still not complete but at least it matches
  what happens when you run KPilot.

Still on the todo-list:

* Really fix the vcal conduit. I've patched some things up and once
  again I hope it works, but since I can't reproduce the error I'm
  a little stuck here.

Still on the wish-list:

* Actually *doing* a fast sync for Heiko
* More and better information in the progress bar
* The PilotMemo class is butt-ugly and filled with weird C-string
  manipulations.
* KPilot should display the sync log as well, just like the Pilot
  does. This is useful for reporting the result of a sync to the
  user (who then doesn't need to look at the Pilot)
* I noticed Thomas Zander has submitted an official wishlist item:
  DateBk3 (the new date book format in PalmOS3.5) support. I think
  I'll get back to him on that when Mirko pans out with the free
  hardware goodies from Palm :)


KPilot Developer's notes for december 2nd 2000
===============================================

Almost Sinterklaas, so I'd like to wish all the KPilot users in
.nl a Happy Sinterklaas en Weg met de Kerstman. 

UI Changes:

* Added Heiko's Fast-Sync icon .. but it's ugly and hard to
  distinguish from the regular icon. This needs fixing by an artist.
* Added an ugly restore icon as well.
* Added an undocumented config-file option. You can now add the
  following line to kpilotrc in the null group if you really want to:

	ToolbarIcons=list

  where list is a comma-separated list of icons to appear on the
  KPilot toolbar. You can choose from HotSync,FastSync,Backup and
  Restore. The standard setting is:

	ToolbarIcons=HotSync,Backup

  That's not a lot but it should keep Heiko happy for a while and
  it reminds us that we should move towards a more modern method
  of setting up the UI -- or not?
* Tried to fix some UI weirdneses like:
	- Delete Memo button enabled when no memo selected
  but QListBox has the nasty habit of always having *something*
  selected, even if you can't see what it is.

  Now I know that the internal conduits -- memoWidget and addressWidget
  will probably die out soon when we have a real working kab2 conduit
  as well as a KNotes conduit, but till then it's nice to have something
  that at least obeys basic UI design rules.
* The following bugs in QListBox and QListView made me ditch the old
  two column layout with movement buttons for something else. Let me
  know which one you prefer.
	- There is some *bizzarre* behavior in the handling of 
	  conduits being selected: select the top item in
	  the left column, the top item in the right column
	  (um, so install a conduit first) and then the top
	  item in the left column again.
  The new layout allows you to drag conduits from one state (available)
  to another (active). Click on a conduit to set it up -- you may have
  to doubleclick depending on you KDE settings.


Internal Changes:

* Conduits that crash no longer hang KPilot and the entire sync.
* Made a lot of static const int members of various classes 
  enum values instead, and added a function write() to CStatusMessages
  for a clean way to write status messages to the link.
* Replaced several if else if ... constructions with switch() 
* Added a sensibleTitle() and shortTitle() to PilotMemo for use 
  by the KNotes conduit (and maybe others)

Documentation:

* Spent a little time on the (english) documentation and brought a few
  parts of it back up-to-date. It needs up-to-date URL's, probably we
  should move the mailing list to kde-pim@kde.org, and we need new 
  screenshots.

Wishlist:

* More and better information in the progress bar
* The PilotMemo class is butt-ugly and filled with weird C-string
  manipulations.
* KPilot should display the sync log as well, just like the Pilot
  does. This is useful for reporting the result of a sync to the
  user (who then doesn't need to look at the Pilot)

KPilot Developer's notes for november 25th 2000
===============================================

Spent most of the week at a conference, but managed to get
the KNotes conduit almost fully functional. New memos (KNotes)
are copied to the desktop (Pilot). Memos changed on the pilot
are changed on the desktop. However, not all deleted memos are
deleted on the other side, nor are modified memos copied
from the desktop to the Pilot.

I don't know what the desired action for KPilot is in the
cases of deleted memos. Any suggestions? There's now a config
option in the KNotes conduit setup, but maybe that should be
subsumed by the global Local Overrides Pilot setting. Anyway,
if a memo is deleted on the Pilot the corresponding KNote is
deleted as well.

If KNotes is running and the KNotes conduit makes changes,
these aren't picked up by KNotes. There are also some
obvious race conditions caused by the conduit writing KNotes
config files. This basically means that we need to talk to 
the KNotes maintainer to resolve these coordination problems.

As for the code, I wrote this:
	class KNotesOptions : public setupDialog { Q_OBJECT
	protected: static const QString KNotesGroup; };
[with better layout, of course] But there's a static QString
there, and I read somewhere that Static Objects Are Evil (tm).
I could use a const char * there, since it's just the name of
a group in the config file, but what's the consensus on things
like this?

I did handle some more of Heiko's patches. From last week's list:
	- Some phone number magic I don't understand yet
	- Some changes in the address import function
	- getShowPhone() -- don't understand that yet either
	- Fix bad repeat-n-times handling in vcal-conduit
This leaves just the Fast Sync capability still unimplemented.

Given the release schedule that has been discussed recently
(and we really do want to have KPilot in KDE 2.1, so as to add
a nifty feature to the desktop as a whole) I think feature creep
should be abandoned for the time being and we should try to
fix as many bugs in what we have before the release (around the
middle of december, IIRC). This means testing, lots of it. So
people, take the plunge, give it a try, compile the latest kdepim
CVS stuff with KPilot in it and then complain when your Pilot
catches fire, OK? O yeah .. when you *do* give it a try, make
sure you do something like:

	$ export LD_LIBRARY_PATH=$QTDIR/lib:
	$ kpilot --debug 1023

To make sure none of the conduits crashes with library loading 
problems and with all the debugging messages turned on.


KPilot Developer's notes for november 19th 2000
===============================================

Fixes:

* Added most of Heiko's patches to the vcal-conduit
* Added convention to conduits --info handling: return "<none>" for
  no databases. Handled in conduitSetup as well.
* Made some minor changes to the info page presented in dialogs
  (generally the setup dialog of a conduit) so that it gracefully
  handles weird settings and handles its own resizing properly.
* Added some const-qualifiers to various char *s
* Add a "kill daemon on exit" feature -- there was already some code
  for this, but not complete.
* Changed all the boolean config entries to booleans as opposed to
  0-or-1 ints.
* Removed all the "const char * id defined but not used" warnings
* Added some extra robustness in PilotDaemon::setupConnections
* Made the daemon obey the "show in system tray" setting -- this was
  broken during the first port to KDE2
* Handle reconfiguration through the settings dialog properly -- 
  at least KPilot picks up the changes to "Kill Daemon on Exit"
* (re)Added --test option to conduits, though not all of them
  will support actual tests.
* KNotes conduit is now functional in the sense that notes you write
  on your desktop are in fact copied to the Pilot. 

Some general comments:

* Suggestion: call the desktop files for conduits
	conduit-pilot-appname.desktop
  and the conduit executables themselves
  	conduit-pilot-Appname
  This at least gives conduits some consistent naming scheme and
  the addition of -pilot leaves some namespace for conduits for
  other PDA's.

  Well, actually this naming scheme isn't much good. But we *do*
  need to think about how to handle sync-programs for various
  PDA's in a nice fashion -- I can imagine having a Nokia phone,
  a Psion and a Pilot and wanting to sync them all.

Still on the todo-list:

* Fix bad repeat-n-times handling in vcal-conduit
* Dealing with the rest of Heiko's patches
	- Some phone number magic I don't understand yet
	- Some changes in the address import function
	- Fast-sync capability (this is different from SyncLast)
	- getShowPhone() -- don't understand that yet either
* More and better information in the progress bar
* The PilotMemo class is butt-ugly and filled with weird C-string
  manipulations.


KPilot Developer's notes for november 14th 2000
===============================================

Lots of things have changed in the class hierarchy.

* Jorg's bug in the memo-import function was handled OK in addressWidget,
  but it seemed clumsy to deal with the same problem in two different
  places. Moved findSelectedCategory() to PilotComponent. Added some
  other convenience functions there for the category combo box.

* The getConfig() change was very poorly done, sorry about that.
  Added some (semi-) bizarre debugging functions into options.{h,cc}
  that are #ifdeffed out.

* Ditched all the #ifdef KDE2 stuff and dropped the KDE1 backport.

* Added a .desktop file for the NULL conduit (with some translations
  of my own)

* Added Qt2 layout code to the address and memo widgets so that they 
  become easier to i18n() (ie. they display properly when the string
  lengths change).

* Adopted some of Heiko's patches:
	- New feature ForceFirst causes every conduit to behave 
	  as if FirstTime=true every time (this is off by default,
	  which matches previous behavior)
	- New feature SyncLastPC causes a slow sync if the Pilot
	  is synced with a different PC than the last time it
	  was synced (this is on by default, matching old behavior)
	- "fixed" font in address and memo editor replaced by the
	  user's system preference
	- In some cases the title (first name+last name or something
	  similar) in an address was empty. This now gives the title 
	  [unknown]
	- Similar for memos

Let's sum up the current wishlist:

* KNotes conduit
* Dealing with the rest of Heiko's patches
	- Proper multi-day appointments in the vcal conduit
	- Some phone number magic I don't understand yet
	- Some changes in the address import function
	- Fast-sync capability (this is different from SyncLast)
	- getShowPhone() -- don't understand that yet either
  These patches are quite useful but it takes a lot of work to
  unsnarl them, which is why they're taking so long.



Developer's notes for november 9th 2000
=======================================

What's new? Lots of little bugs found by code review, some new (trivial?)
features. KPilot 4 is in Mandrake cooker so it receives a little more 
attention now than before.

* Jorg Habenicht found a bug in the memo-import function. It causes
  array-bounds overruns. The same bug was present in many other parts
  of the memo widget. I think I got them all.

* Added some robustness checking in the daemon to cover weird cases
  like running conduits by hand.

* Added better handling of the "first time" dialog in the vcal conduit.

* The NULL-conduit now has an extra configuration field "Databases" which
  you can attach it to. This allows you to do a bogus conduit sync with
  a database (almost equivalent to putting it in the "backup only" entry
  of the global KPilot settings, except you run the external conduit.

* Made KPilotLink::getConfig return a reference instead of a pointer, to
  avoid new()ing and delete()ing the config data structure all the time.
  I hope this increases consistency as well. This has caused lots of
  little type changes throughout the conduit system, so third-party
  conduit authors beware :) -- all the changes cause compile failures though.

* Jorg brought in a patch so that KPilot uses the pilot-link environment
  variables to set initial values.


Some wishlist-style items:

* The memo and address internal conduits are (a) ugly and (b) impossible
  to i18n properly, because they have hard-coded sizes. Need to spend some
  time cleaning that up.

* Really, it's time to write a conduit that syncs with KNotes. It's
  not that hard, but KNotes has some silly bugs that need fixing first :(

* A patch to introduce a notion of "fast sync" has been produced for 
  KPilot 3.2.1 -- we're now looking into how to integrate that into
  the KPilot 4.x series. The idea is you only run a sync on the databases
  you have a conduit for.

Developer's notes for october 29th 2000
=======================================

* Thomas Zander pointed out that KPilot doesn't write a config file
  the first time it is run, leading it to *still* believe it's the
  first time it's run the next time. Fixed.

* In PilotDaemon::setupConnections() things have been reorganized so that
  a failure on opening the Pilot device will not allow KPilot to start.

* Added an undocumented Debug= entry to conduit's configuration, to
  ease debugging. Conduits will have to read this themselves.

* Added a "Run KPilot" menu item to the daemon.

And there's some really strange behavior that I've noticed: when I run
the setup for an external conduit -- which is a separate process --
KPilot always "jumps in front" of that conduits setup dialog when I 
give KPilot the focus. This is very irritating.

Bugs noted still remaining:

* Much weirdness in conduit startup (mode must be set before running
  the conduit's constructor, but mode wasn't set till after) has been 
  looked at but not repaired.

* The vcal-conduit had trouble running a sync the first time (you really
  should do a backup instead). We're working on this one.

  

Developer's notes for october 26th 2000
=======================================

OK, I admit it:

	code,commit,announce,test

is the *wrong* way to do things. I made some mistakes in the code that
looks up conduits in the .desktop files, so conduits *still* won't run
with this morning's commits. This has been fixed now, and the conduits
run. Of course, vcalconduit just SIGSEGV'ed on me, so ...

This brings me to a couple of wishlist items for KPilot:

* A "Cancel" button. I just clicked on Backup when I was aiming for
  HotSync, and there's nothing I can do about it.

* A timeout when running conduits so that badly behaved conduits don't
  hang up the KPilot system.

Some other minor issues have been fixed as well:

* Boatloads of compiler warnings in the included .xpm files
* Some i18n stuff

And new questions raised for people who know the code (I'm thinking
Preston or Cornelius may be able to explain):

* vcal-conduit.cc line 522, what's the purpose of voStatus there?               



Developer's notes for october 23rd 2000
=======================================

It's been a week where I couldn't bring myself to tackle
really big problems, like an address-book conduit for
kab or pine. So I sat back and polished things, wandered
through the code finding little bugs (if I was an OpenBSD
kinda guy I'd call it a proactive code audit). This has
led to:

A whole slew of minor fixes:

* Updated Help menu in main menu bar
* Removed superfluous about tab in kpilot setup dialog
* Fixed config-doesn't-change bug
* Disable autostart-daemon option if .desktop file unavailable
* Added quit icon into file menu
* Added hotsync and backup icons into file menu
* Cleaned up include files in conduitSetup.h
* Cleaned up dialog code in conduitSetup.cc for KDE2 compliance
* Fixed conduits-not-running-during-sync bug in kpilotlink.cc
* Fixed a minor Qt2 incompatibility in messageDialog.cc
* Fixed some i18n issues in kpilotlink.cc
* Replaced sprintf stuff with QString operations in kpilotlink.cc
* Added hot-sync to file menu for consistency (it's in the toolbar)
* Added logic in showTitlePage in kpilot.cc to reduce flicker

Some remaining issues:

* The icon for "About KPilot" in the help menu is the wrong one
* We still need pretty icons for various things (like external conduits)

Some questions:

* Is there a memory leak with the config file in kpilotOptions.cc?
* Do we really want to be new() and delete()ing the config file so
  often? Perhaps getConfig() should do some caching.
* Should we add icons for the other menu items?
* Is there an entry iterator in KConfig so that you can iterate over
  entries in a certain group (and possibly delete them?)

Some philosophical stuff:

* Maybe it's time to ditch the internal conduits altogether and work
  on external conduits for kab and knotes? Although that would still
  leave the file installer. Maybe a splash of the kpilot logo and then
  an icon view of what has been dropped into the file installer?



As far as I can tell KPilot 4 now has the same functionality and bugs
as KPilot 3.2.1 did (with some polishing). So you still have to be
careful with KOrganizer. But I think the framework is sufficiently 
OK to make it worthwhile to really write some conduits for various
KDE 2 apps. Like a kab conduit and a knotes conduit.
