package: kdepim-3.5.1.tar.bz2
kdemod: kdepim
svn di between /tags/KDE/3.5.1 and /branches/KDE//branches/KDE/3.5
Index: kmobile/devices/digicam/libkmobile_digicam.desktop
===================================================================
--- kmobile/devices/digicam/libkmobile_digicam.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kmobile/devices/digicam/libkmobile_digicam.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -6,7 +6,7 @@
 Name[br]=Kamera niverel
 Name[bs]=Digitalna kamera
 Name[ca]=Càmera digital
-Name[cs]=Digitální kamera
+Name[cs]=Digitální fotoaparát
 Name[cy]=Camera Digidol
 Name[da]=Digitalt kamera
 Name[de]=Digitalkamera
Index: wizards/groupwarewizard.desktop
===================================================================
--- wizards/groupwarewizard.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ wizards/groupwarewizard.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -12,6 +12,7 @@
 Name[eu]=KDE groupware morroia
 Name[fr]=Assistant KDE de travail collaboratif
 Name[ga]=Draoi Groupware KDE
+Name[hu]=KDE csoportmunka-varázsló
 Name[is]=KDE hópvinnukerfisálfur
 Name[it]=Assistente configurazione di KDE Groupware
 Name[ja]=KDE グループウェアウィザード
@@ -24,7 +25,7 @@
 Name[pt]=Assistente Groupware do KDE
 Name[pt_BR]=Assistente de Groupware do KDE
 Name[ru]=Мастер подключения к серверам совместной работы
-Name[sl]=KDEjev čarovnik za skupinsko delo
+Name[sl]=Čarovnik za KDE Groupware
 Name[sr]=KDE Groupware чаробњак
 Name[sr@Latn]=KDE Groupware čarobnjak
 Name[sv]=KDE-grupprogramguide
Index: kresources/tvanytime/kcal_tvanytime.desktop
===================================================================
--- kresources/tvanytime/kcal_tvanytime.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kresources/tvanytime/kcal_tvanytime.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -11,6 +11,7 @@
 Name[eu]=TB planifikazioak
 Name[fr]=Programmes TV
 Name[ga]=Sceidil Teilifíse
+Name[hu]=TV-műsorok
 Name[is]=Sjónvarpsdagskrár
 Name[it]=Programmi TV
 Name[ja]=TV スケジュール
Index: kresources/slox/kcal_ox.desktop
===================================================================
--- kresources/slox/kcal_ox.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kresources/slox/kcal_ox.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -9,6 +9,7 @@
 Name[eu]=OpenXchange zerbitzaria
 Name[fr]=Serveur OpenXchange
 Name[ga]=Freastalaí Openexchange
+Name[hu]=OpenXchange-kiszolgáló
 Name[is]=OpenXchange þjónn
 Name[ja]=OpenXchange サーバ
 Name[lt]=OpenXchange serveris
Index: kresources/slox/kabc_ox.desktop
===================================================================
--- kresources/slox/kabc_ox.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kresources/slox/kabc_ox.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -9,6 +9,7 @@
 Name[eu]=OpenXchange zerbitzaria
 Name[fr]=Serveur OpenXchange
 Name[ga]=Freastalaí Openexchange
+Name[hu]=OpenXchange-kiszolgáló
 Name[is]=OpenXchange þjónn
 Name[ja]=OpenXchange サーバ
 Name[lt]=OpenXchange serveris
Index: kmail/kmmainwin.rc
===================================================================
--- kmail/kmmainwin.rc	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kmail/kmmainwin.rc	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -148,7 +148,6 @@
    <Action name="addressbook"/>
    <Action name="tools_start_certman"/>
    <Action name="tools_start_kwatchgnupg"/>
-   <Action name="import"/>
    <Separator/>
    <Action name="tools_edit_vacation"/>
    <Separator/>
Index: kmail/kmail_part.rc
===================================================================
--- kmail/kmail_part.rc	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kmail/kmail_part.rc	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -142,7 +142,6 @@
    <text>&amp;Tools</text>
    <Action name="tools_start_certman"/>
    <Action name="tools_start_kwatchgnupg"/>
-   <Action name="import"/>
    <Separator/>
    <Action name="tools_edit_vacation"/>
    <Separator/>
Index: kmail/configuredialog.cpp
===================================================================
--- kmail/configuredialog.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kmail/configuredialog.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -2265,17 +2265,27 @@
   QStringList encodings = KMMsgBase::supportedEncodings( false );
   QStringList::ConstIterator it( encodings.begin() );
   QStringList::ConstIterator end( encodings.end() );
-  const QString &currentEncoding = GlobalSettings::self()->fallbackCharacterEncoding();
+  QString currentEncoding = GlobalSettings::self()->fallbackCharacterEncoding();
+  currentEncoding = currentEncoding.replace( "iso ", "iso-", false );
+  ///kdDebug(5006) << "Looking for encoding: " << currentEncoding << endl;
   int i = 0;
+  int indexOfLatin9 = 0;
+  bool found = false;
   for( ; it != end; ++it)
   {
-    if( KGlobal::charsets()->encodingForName(*it) == currentEncoding )
+    const QString encoding = KGlobal::charsets()->encodingForName(*it);
+    if ( encoding == "iso-8859-15" )
+        indexOfLatin9 = i;
+    if( false && encoding == currentEncoding )
     {
       mCharsetCombo->setCurrentItem( i );
+      found = true;
       break;
     }
     i++;
   }
+  if ( !found ) // nothing matched, use latin9
+    mCharsetCombo->setCurrentItem( indexOfLatin9 );
 }
 
 void AppearancePage::ReaderTab::readCurrentOverrideCodec()
Index: kalarm/alarmevent.cpp
===================================================================
--- kalarm/alarmevent.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/alarmevent.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1562,7 +1562,7 @@
 			endTime = reminderTime;
 			ltype = LIMIT_REMINDER;
 		}
-		else if (type == FIRST_OCCURRENCE  &&  !recurs)
+		else if (type == FIRST_OR_ONLY_OCCURRENCE  &&  !recurs)
 			ltype = LIMIT_REPETITION;
 		else
 			ltype = LIMIT_RECURRENCE;
@@ -1739,7 +1739,7 @@
 	else if (pre < mNextMainDateTime.dateTime())
 	{
 		result = mNextMainDateTime;
-		type = FIRST_OCCURRENCE;
+		type = FIRST_OR_ONLY_OCCURRENCE;
 	}
 	else
 	{
@@ -1804,7 +1804,7 @@
 	if (checkRecur() == KARecurrence::NO_RECUR)
 	{
 		result = mStartDateTime;
-		type = FIRST_OCCURRENCE;
+		type = FIRST_OR_ONLY_OCCURRENCE;
 	}
 	else
 	{
@@ -1817,7 +1817,7 @@
 		if (!dt.isValid())
 			return NO_OCCURRENCE;
 		if (dt == recurStart)
-			type = FIRST_OCCURRENCE;
+			type = FIRST_OR_ONLY_OCCURRENCE;
 		else if (mRecurrence->getNextDateTime(dt).isValid())
 			type = result.isDateOnly() ? RECURRENCE_DATE : RECURRENCE_DATE_TIME;
 		else
@@ -1857,7 +1857,7 @@
 KAEvent::OccurType KAEvent::setNextOccurrence(const QDateTime& preDateTime, bool includeRepetitions)
 {
 	if (preDateTime < mNextMainDateTime.dateTime())
-		return FIRST_OCCURRENCE;    // it might not be the first recurrence - tant pis
+		return FIRST_OR_ONLY_OCCURRENCE;    // it might not be the first recurrence - tant pis
 	QDateTime pre = preDateTime;
 	if (includeRepetitions)
 	{
@@ -1872,7 +1872,7 @@
 	if (pre < mNextMainDateTime.dateTime())
 	{
 		dt = mNextMainDateTime;
-		type = FIRST_OCCURRENCE;   // may not actually be the first occurrence
+		type = FIRST_OR_ONLY_OCCURRENCE;   // may not actually be the first occurrence
 	}
 	else if (checkRecur() != KARecurrence::NO_RECUR)
 	{
@@ -1880,7 +1880,7 @@
 		type = nextRecurrence(pre, dt, remainingCount);
 		if (type == NO_OCCURRENCE)
 			return NO_OCCURRENCE;
-		if (type != FIRST_OCCURRENCE  &&  dt != mNextMainDateTime)
+		if (type != FIRST_OR_ONLY_OCCURRENCE  &&  dt != mNextMainDateTime)
 		{
 			// Need to reschedule the next trigger date/time
 			mNextMainDateTime = dt;
@@ -1939,7 +1939,7 @@
 	if (dt == recurStart)
 	{
 		remainingCount = mRecurrence->duration();
-		return FIRST_OCCURRENCE;
+		return FIRST_OR_ONLY_OCCURRENCE;
 	}
 	remainingCount = mRecurrence->duration() - mRecurrence->durationTo(dt) + 1;
 	if (remainingCount == 1)
Index: kalarm/eventlistviewbase.cpp
===================================================================
--- kalarm/eventlistviewbase.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/eventlistviewbase.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -300,13 +300,24 @@
 		if (mw > lastColumnWidth)
 			lastColumnWidth = mw;
 	}
-	int x = header()->sectionPos(mLastColumn);
-	int width = visibleWidth() - x;
-	if (width < lastColumnWidth)
-		width = lastColumnWidth;
-	setColumnWidth(mLastColumn, width);
-	if (contentsWidth() > x + width)
-		resizeContents(x + width, contentsHeight());
+	QHeader* head = header();
+	int x = head->sectionPos(mLastColumn);
+	int availableWidth = visibleWidth() - x;
+	int rightColWidth = 0;
+	int index = head->mapToIndex(mLastColumn);
+	if (index < mLastColumn)
+	{
+		// The last column has been dragged by the user to a different position.
+		// Ensure that the columns now to the right of it are still shown.
+		for (int i = index + 1;  i <= mLastColumn;  ++i)
+			rightColWidth += columnWidth(head->mapToSection(i));
+		availableWidth -= rightColWidth;
+	}
+	if (availableWidth < lastColumnWidth)
+		availableWidth = lastColumnWidth;
+	setColumnWidth(mLastColumn, availableWidth);
+	if (contentsWidth() > x + availableWidth + rightColWidth)
+		resizeContents(x + availableWidth + rightColWidth, contentsHeight());
 }
 
 /******************************************************************************
Index: kalarm/alarmevent.h
===================================================================
--- kalarm/alarmevent.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/alarmevent.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  alarmevent.h  -  represents calendar alarms and events
  *  Program:  kalarm
- *  Copyright (c) 2001 - 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001-2005 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -281,12 +281,12 @@
 		enum OccurType     // what type of occurrence is due
 		{
 			NO_OCCURRENCE               = 0,      // no occurrence is due
-			FIRST_OCCURRENCE            = 0x01,   // the first occurrence (takes precedence over LAST_RECURRENCE)
+			FIRST_OR_ONLY_OCCURRENCE    = 0x01,   // the first occurrence (takes precedence over LAST_RECURRENCE)
 			RECURRENCE_DATE             = 0x02,   // a recurrence with only a date, not a time
 			RECURRENCE_DATE_TIME        = 0x03,   // a recurrence with a date and time
 			LAST_RECURRENCE             = 0x04,   // the last recurrence
 			OCCURRENCE_REPEAT = 0x10,    // (bitmask for a repetition of an occurrence)
-			FIRST_OCCURRENCE_REPEAT     = OCCURRENCE_REPEAT | FIRST_OCCURRENCE,     // a repetition of the first occurrence
+			FIRST_OR_ONLY_OCCURRENCE_REPEAT = OCCURRENCE_REPEAT | FIRST_OR_ONLY_OCCURRENCE,     // a repetition of the first occurrence
 			RECURRENCE_DATE_REPEAT      = OCCURRENCE_REPEAT | RECURRENCE_DATE,      // a repetition of a date-only recurrence
 			RECURRENCE_DATE_TIME_REPEAT = OCCURRENCE_REPEAT | RECURRENCE_DATE_TIME, // a repetition of a date/time recurrence
 			LAST_RECURRENCE_REPEAT      = OCCURRENCE_REPEAT | LAST_RECURRENCE       // a repetition of the last recurrence
Index: kalarm/kalarm.h
===================================================================
--- kalarm/kalarm.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarm.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -26,7 +26,7 @@
 #include <config.h>
 #endif
 
-#define KALARM_VERSION "1.3.6"
+#define KALARM_VERSION "1.3.8"
 
 #include <kdeversion.h>
 
Index: kalarm/mainwindow.cpp
===================================================================
--- kalarm/mainwindow.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/mainwindow.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -221,7 +221,7 @@
 			return *it;
 	if (tray)
 		return tray;
-	if (!mWindowList.count())
+	if (mWindowList.isEmpty())
 		return 0;
 	return mWindowList.first();
 }
Index: kalarm/kalarmd/alarmdaemoniface.h
===================================================================
--- kalarm/kalarmd/alarmdaemoniface.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmd/alarmdaemoniface.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  alarmdaemoniface.h  -  DCOP request interface
  *  Program:  KAlarm's alarm daemon (kalarmd)
- *  Copyright (C) 2001, 2004 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001, 2004, 2006 by David Jarvie <software@astrojar.org.uk>
  *  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
  *  Copyright (c) 1997-1999 Preston Brown <pbrown@kde.org>
  *
@@ -37,6 +37,7 @@
     virtual ASYNC registerApp(const QCString& appName, const QString& appTitle,
                               const QCString& dcopObject, const QString& calendarUrl, bool startClient) = 0;
     virtual ASYNC registerChange(const QCString& appName, bool startClient) = 0;
+    virtual ASYNC eventHandled(const QCString& appname, const QString& calendarURL, const QString& eventID, bool reload) = 0;
     virtual ASYNC quit() = 0;
 };
 
Index: kalarm/kalarmd/adcalendar.cpp
===================================================================
--- kalarm/kalarmd/adcalendar.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmd/adcalendar.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  adcalendar.cpp  -  calendar file access
  *  Program:  KAlarm's alarm daemon (kalarmd)
- *  Copyright (C) 2001, 2004, 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001, 2004-2006 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
 
 QValueList<ADCalendar*> ADCalendar::mCalendars;
 ADCalendar::EventsMap   ADCalendar::mEventsHandled;
+ADCalendar::EventsMap   ADCalendar::mEventsPending;
 QStringList             ADCalendar::mCalendarUrls;    // never delete or reorder anything in this list!
 
 
@@ -160,40 +161,75 @@
 }
 
 /******************************************************************************
+* Remember that the event with the given ID has been handled.
+* It must already be in the pending list.
+*/
+void ADCalendar::setEventHandled(const QString& eventID)
+{
+	kdDebug(5900) << "ADCalendar::setEventHandled(" << eventID << ")\n";
+	EventKey key(eventID, mUrlIndex);
+
+	// Remove it from the pending list, and add it to the handled list
+	EventsMap::Iterator it = mEventsPending.find(key);
+	if (it != mEventsPending.end())
+	{
+		setEventInMap(mEventsHandled, key, it.data().alarmTimes, it.data().eventSequence);
+		mEventsPending.remove(it);
+	}
+}
+
+/******************************************************************************
 * Remember that the specified alarms for the event with the given ID have been
-* handled.
+* notified to KAlarm, but no reply has come back yet.
 */
-void ADCalendar::setEventHandled(const KCal::Event* event, const QValueList<QDateTime>& alarmtimes)
+void ADCalendar::setEventPending(const KCal::Event* event, const QValueList<QDateTime>& alarmtimes)
 {
 	if (event)
 	{
-		kdDebug(5900) << "ADCalendar::setEventHandled(" << event->uid() << ")\n";
+		kdDebug(5900) << "ADCalendar::setEventPending(" << event->uid() << ")\n";
 		EventKey key(event->uid(), mUrlIndex);
-		EventsMap::Iterator it = mEventsHandled.find(key);
-		if (it != mEventsHandled.end())
-		{
-			// Update the existing entry for the event
-			it.data().alarmTimes = alarmtimes;
-			it.data().eventSequence = event->revision();
-		}
-		else
-			mEventsHandled.insert(key, EventItem(event->revision(), alarmtimes));
+		setEventInMap(mEventsPending, key, alarmtimes, event->revision());
 	}
 }
 
 /******************************************************************************
+* Add a specified entry to the events pending or handled list.
+*/
+void ADCalendar::setEventInMap(EventsMap& map, const EventKey& key, const QValueList<QDateTime>& alarmtimes, int sequence)
+{
+	EventsMap::Iterator it = map.find(key);
+	if (it != map.end())
+	{
+		// Update the existing entry for the event
+		it.data().alarmTimes = alarmtimes;
+		it.data().eventSequence = sequence;
+	}
+	else
+		map.insert(key, EventItem(sequence, alarmtimes));
+}
+
+/******************************************************************************
 * Clear all memory of events handled for the calendar.
 */
 void ADCalendar::clearEventsHandled(bool nonexistentOnly)
 {
-	for (EventsMap::Iterator it = mEventsHandled.begin();  it != mEventsHandled.end();  )
+	clearEventMap(mEventsPending, nonexistentOnly);
+	clearEventMap(mEventsHandled, nonexistentOnly);
+}
+
+/******************************************************************************
+* Clear the events pending or handled list of all events handled for the calendar.
+*/
+void ADCalendar::clearEventMap(EventsMap& map, bool nonexistentOnly)
+{
+	for (EventsMap::Iterator it = map.begin();  it != map.end();  )
 	{
 		if (it.key().calendarIndex == mUrlIndex
 		&&  (!nonexistentOnly  ||  !event(it.key().eventID)))
 		{
 			EventsMap::Iterator i = it;
 			++it;                      // prevent iterator becoming invalid with remove()
-			mEventsHandled.remove(i);
+			map.remove(i);
 		}
 		else
 			++it;
Index: kalarm/kalarmd/alarmdaemon.cpp
===================================================================
--- kalarm/kalarmd/alarmdaemon.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmd/alarmdaemon.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  alarmdaemon.cpp  -  alarm daemon control routines
  *  Program:  KAlarm's alarm daemon (kalarmd)
- *  Copyright (c) 2001, 2004, 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001, 2004-2006 by David Jarvie <software@astrojar.org.uk>
  *  Based on the original, (c) 1998, 1999 Preston Brown
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -195,6 +195,22 @@
 }
 
 /******************************************************************************
+* DCOP call to notify the daemon that an event has been handled, and optionally
+* to tell it to reload the calendar.
+*/
+void AlarmDaemon::eventHandled(const QCString& appname, const QString& calendarUrl, const QString& eventID, bool reload)
+{
+	QString urlString = expandURL(calendarUrl);
+	kdDebug(5900) << "AlarmDaemon::eventHandled(" << urlString << (reload ? "): reload" : ")") << endl;
+	ADCalendar* cal = ADCalendar::getCalendar(urlString);
+	if (!cal  ||  cal->appName() != appname)
+		return;
+	cal->setEventHandled(eventID);
+	if (reload)
+		reloadCal(cal, false);
+}
+
+/******************************************************************************
 * DCOP call to add an application to the list of client applications,
 * and add it to the config file.
 * N.B. This method must not return a bool because DCOPClient::call() can cause
@@ -372,7 +388,7 @@
 		if (!cal->eventHandled(event, alarmtimes))
 		{
 			if (notifyEvent(cal, eventID))
-				cal->setEventHandled(event, alarmtimes);
+				cal->setEventPending(event, alarmtimes);
 		}
 	}
 }
@@ -393,6 +409,7 @@
 		return false;
 	}
 	kdDebug(5900) << "AlarmDaemon::notifyEvent(" << appname << ", " << eventID << "): notification type=" << client->startClient() << endl;
+	QString id = QString::fromLatin1("ad:") + eventID;    // prefix to indicate that the notification if from the daemon
 
 	// Check if the client application is running and ready to receive notification
 	bool registered = kapp->dcopClient()->isApplicationRegistered(static_cast<const char*>(appname));
@@ -425,15 +442,15 @@
 			return true;
 		}
 		p << cmd;
-		p << "--handleEvent" << eventID << "--calendarURL" << calendar->urlString();
-		p.start(KProcess::Block);
+		p << "--handleEvent" << id << "--calendarURL" << calendar->urlString();
+		p.start(KProcess::DontCare);
 		kdDebug(5900) << "AlarmDaemon::notifyEvent(): used command line" << endl;
 		return true;
 	}
 
 	// Notify the client by telling it the calendar URL and event ID
 	AlarmGuiIface_stub stub(appname, client->dcopObject());
-	stub.handleEvent(calendar->urlString(), eventID);
+	stub.handleEvent(calendar->urlString(), id);
 	if (!stub.ok())
 	{
 		kdDebug(5900) << "AlarmDaemon::notifyEvent(): dcop send failed" << endl;
Index: kalarm/kalarmd/adcalendar.h
===================================================================
--- kalarm/kalarmd/adcalendar.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmd/adcalendar.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  adcalendar.h  -  calendar file access
  *  Program:  KAlarm's alarm daemon (kalarmd)
- *  Copyright (C) 2001, 2004, 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001, 2004-2006 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -47,9 +47,10 @@
 		void            setUnregistered(bool u) { mUnregistered = u; }
 		bool            unregistered() const    { return mUnregistered; }
   
+		void            setEventPending(const KCal::Event*, const QValueList<QDateTime>&);
+		void            setEventHandled(const QString& eventID);
+		void            clearEventsHandled(bool nonexistentOnly = false);
 		bool            eventHandled(const KCal::Event*, const QValueList<QDateTime>&);
-		void            setEventHandled(const KCal::Event*, const QValueList<QDateTime>&);
-		void            clearEventsHandled(bool nonexistentOnly = false);
 
 		bool            loadFile(bool reset);
 		bool            setLoadedConnected();     // check status of mLoadedConnected and set it to true
@@ -94,23 +95,26 @@
 		};
 
 		typedef QMap<EventKey, EventItem>  EventsMap;   // calendar/event ID, event sequence num
-		static EventsMap               mEventsHandled;  // IDs of already triggered events
+		static EventsMap               mEventsHandled;  // IDs of already triggered events which have been processed by KAlarm
+		static EventsMap               mEventsPending;  // IDs of already triggered events not yet processed by KAlarm
 		static QStringList             mCalendarUrls;   // URLs of all calendars ever opened
 		static QValueList<ADCalendar*> mCalendars;      // list of all constructed calendars
 
 		ADCalendar(const ADCalendar&);             // prohibit copying
 		ADCalendar& operator=(const ADCalendar&);  // prohibit copying
 
-		void            loadLocalFile(const QString& filename);
+		void      loadLocalFile(const QString& filename);
+		void      clearEventMap(EventsMap&, bool nonexistentOnly);
+		void      setEventInMap(EventsMap&, const EventKey&, const QValueList<QDateTime>& alarmtimes, int sequence);
 
-		QString           mUrlString;       // calendar file URL
-		QCString          mAppName;         // name of application owning this calendar
-		QString           mTempFileName;    // temporary file used if currently downloading, else null
-		int               mUrlIndex;        // unique index to URL in mCalendarUrls
-		bool              mLoaded;          // true if calendar file is currently loaded
-		bool              mLoadedConnected; // true if the loaded() signal has been connected to AlarmDaemon
-		bool              mUnregistered;    // client has registered, but has not since added the calendar
-		bool              mEnabled;         // events are currently manually enabled
+		QString   mUrlString;       // calendar file URL
+		QCString  mAppName;         // name of application owning this calendar
+		QString   mTempFileName;    // temporary file used if currently downloading, else null
+		int       mUrlIndex;        // unique index to URL in mCalendarUrls
+		bool      mLoaded;          // true if calendar file is currently loaded
+		bool      mLoadedConnected; // true if the loaded() signal has been connected to AlarmDaemon
+		bool      mUnregistered;    // client has registered, but has not since added the calendar
+		bool      mEnabled;         // events are currently manually enabled
 };
 
 #endif // ADCALENDAR_H
Index: kalarm/kalarmd/alarmdaemon.h
===================================================================
--- kalarm/kalarmd/alarmdaemon.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmd/alarmdaemon.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  alarmdaemon.h  -  alarm daemon control routines
  *  Program:  KAlarm's alarm daemon (kalarmd)
- *  Copyright (c) 2001, 2004, 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001, 2004-2006 by David Jarvie <software@astrojar.org.uk>
  *  Based on the original, (c) 1998, 1999 Preston Brown
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -55,6 +55,7 @@
 		void    registerApp(const QCString& appName, const QString& appTitle,
 		                    const QCString& dcopObject, const QString& calendarUrl, bool startClient);
 		void    registerChange(const QCString& appName, bool startClient);
+		void    eventHandled(const QCString& appname, const QString& calendarURL, const QString& eventID, bool reload);
 		void    quit();
 		// Other methods
 		void    startMonitoring();
Index: kalarm/Changelog
===================================================================
--- kalarm/Changelog	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/Changelog	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,6 +1,16 @@
 KAlarm
 
-=== Version 1.3.6 --- 10 January 2006 ===
+=== Version 1.3.9 --- 29 January 2006 ===
+Notify daemon by DCOP that alarm has been processed: to prevent alarm loss, and
+    to prevent defunct kalarm processes when run mode is on-demand.
+
+=== Version 1.3.8 --- 24 January 2006 ===
+Fix kalarmd hang when triggering late alarm and KAlarm run mode is on-demand.
+
+=== Version 1.3.7 --- 22 January 2006 ===
+Fix column widths when main window is resized, if columns have been reordered.
+
+=== Version 1.3.6 (KDE 3.5.1) --- 10 January 2006 ===
 Make autoclose of message windows work.
 Fix New From Template not creating alarm if template contents are not changed.
 Ensure that day and month names translations are independent of locale calendar.
@@ -11,7 +21,7 @@
 Fix email attachments being forgotten when saving alarms.
 Fix toolbar configuration being lost after quitting KAlarm.
 
-=== Version 1.3.4 --- 2 October 2005 ===
+=== Version 1.3.4 (KDE 3.5) --- 2 October 2005 ===
 Fix incorrect recurrence frequency in Alarm Edit dialogue's Alarm tab.
 
 === Version 1.3.3 --- 22 September 2005 ===
Index: kalarm/kalarmapp.cpp
===================================================================
--- kalarm/kalarmapp.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmapp.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -328,9 +328,9 @@
 				EventFunc function = EVENT_HANDLE;
 				int count = 0;
 				const char* option = 0;
-				if (args->isSet("handleEvent"))   { function = EVENT_HANDLE;  option = "handleEvent";  ++count; }
+				if (args->isSet("handleEvent"))   { function = EVENT_HANDLE;   option = "handleEvent";   ++count; }
 				if (args->isSet("triggerEvent"))  { function = EVENT_TRIGGER;  option = "triggerEvent";  ++count; }
-				if (args->isSet("cancelEvent"))   { function = EVENT_CANCEL;  option = "cancelEvent";  ++count; }
+				if (args->isSet("cancelEvent"))   { function = EVENT_CANCEL;   option = "cancelEvent";   ++count; }
 				if (!count)
 					USAGE(i18n("%1 requires %2, %3 or %4").arg(QString::fromLatin1("--calendarURL")).arg(QString::fromLatin1("--handleEvent")).arg(QString::fromLatin1("--triggerEvent")).arg(QString::fromLatin1("--cancelEvent")))
 				if (count > 1)
@@ -348,6 +348,12 @@
 				}
 				QString eventID = args->getOption(option);
 				args->clear();      // free up memory
+				if (eventID.startsWith(QString::fromLatin1("ad:")))
+				{
+					// It's a notification from the alarm deamon
+					eventID = eventID.mid(3);
+					Daemon::queueEvent(eventID);
+				}
 				setUpDcop();        // start processing DCOP calls
 				if (!handleEvent(eventID, function))
 				{
@@ -781,22 +787,8 @@
 		}
 	}
 
-	/* This was the last/only running "instance" of the program, so exit completely.
-	 * First, change the name which we are registered with at the DCOP server. This is
-	 * to ensure that the alarm daemon immediately sees us as not running. It prevents
-	 * the following situation which has been observed:
-	 *
-	 * If KAlarm is not running and, for instance, it has registered more than one
-	 * calendar at some time in the past, when the daemon checks pending alarms, it
-	 * starts KAlarm to notify us of the first event. If this is for a different
-	 * calendar from what KAlarm expects, we exit. But without DCOP re-registration,
-	 * when the daemon then notifies us of the next event (from the correct calendar),
-	 * it will still see KAlarm as registered with DCOP and therefore tells us via a
-	 * DCOP call. The call of course never reaches KAlarm but the daemon sees it as
-	 * successful. The result is that the alarm is never seen.
-	 */
+	// This was the last/only running "instance" of the program, so exit completely.
 	kdDebug(5950) << "KAlarmApp::quitIf(" << exitCode << "): quitting" << endl;
-	dcopClient()->registerAs(QCString(aboutData()->appName()) + "-quitting");
 	exit(exitCode);
 }
 
@@ -1226,6 +1218,7 @@
 	if (cal  &&  KURL(urlString).url() != cal->urlString())
 	{
 		kdError(5950) << "KAlarmApp::handleEvent(DCOP): wrong calendar file " << urlString << endl;
+		Daemon::eventHandled(eventID, false);
 		return false;
 	}
 	mDcopQueue.append(DcopQEntry(function, eventID));
@@ -1249,6 +1242,7 @@
 	if (!kcalEvent)
 	{
 		kdError(5950) << "KAlarmApp::handleEvent(): event ID not found: " << eventID << endl;
+		Daemon::eventHandled(eventID, false);
 		return false;
 	}
 	KAEvent event(*kcalEvent);
@@ -1264,8 +1258,8 @@
 			QDateTime now = QDateTime::currentDateTime();
 			DateTime  repeatDT;
 			bool updateCalAndDisplay = false;
-			bool displayAlarmValid = false;
-			KAAlarm displayAlarm;
+			bool alarmToExecuteValid = false;
+			KAAlarm alarmToExecute;
 			// Check all the alarms in turn.
 			// Note that the main alarm is fetched before any other alarms.
 			for (KAAlarm alarm = event.firstAlarm();  alarm.valid();  alarm = event.nextAlarm(alarm))
@@ -1278,8 +1272,8 @@
 					// If the deferral is not yet due, this prevents the main alarm being
 					// triggered repeatedly. If the deferral is due, this triggers it
 					// in preference to the main alarm.
-					displayAlarm        = KAAlarm();
-					displayAlarmValid   = false;
+					alarmToExecute      = KAAlarm();
+					alarmToExecuteValid = false;
 					updateCalAndDisplay = false;
 				}
 				// Check if the alarm is due yet.
@@ -1305,7 +1299,7 @@
 
 					// Check if the main alarm is already being displayed.
 					// (We don't want to display both at the same time.)
-					if (displayAlarm.valid())
+					if (alarmToExecute.valid())
 						continue;
 
 					// Set the time to be shown if it's a display alarm
@@ -1341,7 +1335,7 @@
 							KAEvent::OccurType type = event.previousOccurrence(now, next, true);
 							switch (type & ~KAEvent::OCCURRENCE_REPEAT)
 							{
-								case KAEvent::FIRST_OCCURRENCE:
+								case KAEvent::FIRST_OR_ONLY_OCCURRENCE:
 								case KAEvent::RECURRENCE_DATE:
 								case KAEvent::RECURRENCE_DATE_TIME:
 								case KAEvent::LAST_RECURRENCE:
@@ -1349,8 +1343,9 @@
 									limit.setTime(Preferences::startOfDay());
 									if (now >= limit)
 									{
-										if (type == KAEvent::LAST_RECURRENCE)
-											cancel = true;
+										if (type == KAEvent::LAST_RECURRENCE
+										||  type == KAEvent::FIRST_OR_ONLY_OCCURRENCE && !event.recurs())
+											cancel = true;   // last ocurrence (and there are no repetitions)
 										else
 											late = true;
 									}
@@ -1364,7 +1359,7 @@
 					}
 					else
 					{
-						// The alarm is timed. Allow it to be just over a minute late before cancelling it.
+						// The alarm is timed. Allow it to be the permitted amount late before cancelling it.
 						int maxlate = maxLateness(alarm.lateCancel());
 						if (secs > maxlate)
 						{
@@ -1374,14 +1369,15 @@
 							KAEvent::OccurType type = event.previousOccurrence(now, next, true);
 							switch (type & ~KAEvent::OCCURRENCE_REPEAT)
 							{
-								case KAEvent::FIRST_OCCURRENCE:
+								case KAEvent::FIRST_OR_ONLY_OCCURRENCE:
 								case KAEvent::RECURRENCE_DATE:
 								case KAEvent::RECURRENCE_DATE_TIME:
 								case KAEvent::LAST_RECURRENCE:
 									if (next.dateTime().secsTo(now) > maxlate)
 									{
-										if (type == KAEvent::LAST_RECURRENCE)
-											cancel = true;
+										if (type == KAEvent::LAST_RECURRENCE
+										||  type == KAEvent::FIRST_OR_ONLY_OCCURRENCE && !event.recurs())
+											cancel = true;   // last ocurrence (and there are no repetitions)
 										else
 											late = true;
 									}
@@ -1396,7 +1392,7 @@
 
 					if (cancel)
 					{
-						// All repetitions are finished, so cancel the event
+						// All recurrences are finished, so cancel the event
 						event.setArchive();
 						cancelAlarm(event, alarm.type(), false);
 						updateCalAndDisplay = true;
@@ -1410,20 +1406,20 @@
 						continue;
 					}
 				}
-				if (!displayAlarmValid)
+				if (!alarmToExecuteValid)
 				{
-					kdDebug(5950) << "KAlarmApp::handleEvent(): alarm " << alarm.type() << ": display\n";
-					displayAlarm = alarm;             // note the alarm to be displayed
-					displayAlarmValid = true;         // only trigger one alarm for the event
+					kdDebug(5950) << "KAlarmApp::handleEvent(): alarm " << alarm.type() << ": execute\n";
+					alarmToExecute = alarm;             // note the alarm to be executed
+					alarmToExecuteValid = true;         // only trigger one alarm for the event
 				}
 				else
 					kdDebug(5950) << "KAlarmApp::handleEvent(): alarm " << alarm.type() << ": skip\n";
 			}
 
-			// If there is an alarm to display, do this last after rescheduling/cancelling
+			// If there is an alarm to execute, do this last after rescheduling/cancelling
 			// any others. This ensures that the updated event is only saved once to the calendar.
-			if (displayAlarm.valid())
-				execAlarm(event, displayAlarm, true, !displayAlarm.repeatAtLogin());
+			if (alarmToExecute.valid())
+				execAlarm(event, alarmToExecute, true, !alarmToExecute.repeatAtLogin());
 			else
 			{
 				if (function == EVENT_TRIGGER)
@@ -1438,7 +1434,10 @@
 				if (updateCalAndDisplay)
 					KAlarm::updateEvent(event, 0);     // update the window lists and calendar file
 				else if (function != EVENT_TRIGGER)
+				{
 					kdDebug(5950) << "KAlarmApp::handleEvent(): no action\n";
+					Daemon::eventHandled(eventID, false);
+				}
 			}
 			break;
 		}
@@ -1476,8 +1475,10 @@
 			}
 
 			rescheduleAlarm(event, alarm, true);
+			return;
 		}
 	}
+	Daemon::eventHandled(event.id(), false);
 }
 
 /******************************************************************************
@@ -1542,7 +1543,7 @@
 						event.setUpdated();    // note that the calendar file needs to be updated
 					}
 					break;
-				case KAEvent::FIRST_OCCURRENCE:
+				case KAEvent::FIRST_OR_ONLY_OCCURRENCE:
 					// The first occurrence is still due?!?, so don't do anything
 				default:
 					break;
@@ -1561,7 +1562,10 @@
 		KAlarm::updateEvent(event, 0);     // update the window lists and calendar file
 	}
 	else if (updateDisplay)
+	{
+		Daemon::eventHandled(event.id(), false);
 		AlarmListView::modifyEvent(event, 0);
+	}
 }
 
 /******************************************************************************
@@ -1831,7 +1835,7 @@
 */
 void KAlarmApp::slotCommandOutput(KProcess* proc, char* buffer, int bufflen)
 {
-kdDebug(5950) << "KAlarmApp::slotCommandOutput(): '" << QCString(buffer, bufflen+1) << "'\n";
+//kdDebug(5950) << "KAlarmApp::slotCommandOutput(): '" << QCString(buffer, bufflen+1) << "'\n";
 	// Find this command in the command list
 	for (QValueList<ProcData*>::Iterator it = mCommandProcesses.begin();  it != mCommandProcesses.end();  ++it)
 	{
@@ -2150,6 +2154,14 @@
 	return ok;
 }
 
+KAlarmApp::ProcData::ProcData(ShellProcess* p, ShellProcess* logp, KAEvent* e, KAAlarm* a, int f)
+	: process(p),
+	  logProcess(logp),
+	  event(e),
+	  alarm(a),
+	  messageBoxParent(0),
+	  flags(f)
+{ }
 
 KAlarmApp::ProcData::~ProcData()
 {
Index: kalarm/daemon.h
===================================================================
--- kalarm/daemon.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/daemon.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  daemon.h  -  interface with alarm daemon
  *  Program:  kalarm
- *  Copyright (C) 2001 - 2004 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001-2006 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -56,6 +56,10 @@
 		static bool      isRegistered()          { return mStatus == REGISTERED; }
 		static void      allowRegisterFailMsg()  { mRegisterFailMsg = false; }
 
+		static void      queueEvent(const QString& eventID);
+		static void      savingEvent(const QString& eventID);
+		static void      eventHandled(const QString& eventID, bool reloadCal);
+
 	signals:
 		void             daemonRunning(bool running);
 
@@ -81,6 +85,7 @@
 		static bool      registerWith(bool reregister);
 		static void      registrationResult(bool reregister, int result);
 		static void      reload();
+		static void      notifyEventHandled(const QString& eventID, bool reloadCal);
 		static void      updateRegisteredStatus(bool timeout = false);
 		static void      enableCalendar(bool enable);
 		static void      calendarIsEnabled(bool enabled);
@@ -88,7 +93,9 @@
 		static void      setFastCheck();
 
 		static Daemon*   mInstance;            // only one instance allowed
-		static NotificationHandler* mDcopHandler; // handles DCOP requests from daemon
+		static NotificationHandler* mDcopHandler;  // handles DCOP requests from daemon
+		static QValueList<QString>  mQueuedEvents; // IDs of pending events that daemon has triggered
+		static QValueList<QString>  mSavingEvents; // IDs of updated events that are currently being saved
 		static QTimer*   mStartTimer;          // timer to check daemon status after starting daemon
 		static QTimer*   mRegisterTimer;       // timer to check whether daemon has sent registration status
 		static QTimer*   mStatusTimer;         // timer for checking daemon status
Index: kalarm/daemon.cpp
===================================================================
--- kalarm/daemon.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/daemon.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  daemon.cpp  -  interface with alarm daemon
  *  Program:  kalarm
- *  Copyright (c) 2001 - 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001-2006 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -66,6 +66,8 @@
 
 Daemon*              Daemon::mInstance = 0;
 NotificationHandler* Daemon::mDcopHandler = 0;
+QValueList<QString>  Daemon::mQueuedEvents;
+QValueList<QString>  Daemon::mSavingEvents;
 QTimer*              Daemon::mStartTimer = 0;
 QTimer*              Daemon::mRegisterTimer = 0;
 QTimer*              Daemon::mStatusTimer = 0;
@@ -532,10 +534,66 @@
 void Daemon::slotCalendarSaved(AlarmCalendar* cal)
 {
 	if (cal == AlarmCalendar::activeCalendar())
-		reload();
+	{
+		int n = mSavingEvents.count();
+		if (n)
+		{
+			// We have just saved a modified event originally triggered by the daemon.
+			// Notify the daemon of the event, and tell it to reload the calendar.
+			for (int i = 0;  i < n - 1;  ++i)
+				notifyEventHandled(mSavingEvents[i], false);
+			notifyEventHandled(mSavingEvents[n - 1], true);
+			mSavingEvents.clear();
+		}
+		else
+			reload();
+	}
 }
 
 /******************************************************************************
+* Note an event ID which has been triggered by the alarm daemon.
+*/
+void Daemon::queueEvent(const QString& eventId)
+{
+	mQueuedEvents += eventId;
+}
+
+/******************************************************************************
+* Note an event ID which is currently being saved in the calendar file, if the
+* event was originally triggered by the alarm daemon.
+*/
+void Daemon::savingEvent(const QString& eventId)
+{
+	if (mQueuedEvents.remove(eventId) > 0)
+		mSavingEvents += eventId;
+}
+
+/******************************************************************************
+* If the event ID has been triggered by the alarm daemon, tell the daemon that
+* it has been processed, and whether to reload its calendar.
+*/
+void Daemon::eventHandled(const QString& eventId, bool reloadCal)
+{
+	if (mQueuedEvents.remove(eventId) > 0)
+		notifyEventHandled(eventId, reloadCal);    // it's a daemon event, so tell daemon that it's been handled
+	else if (reloadCal)
+		reload();    // not a daemon event, so simply tell the daemon to reload the calendar
+}
+
+/******************************************************************************
+* Tell the daemon that an event has been processed, and whether to reload its
+* calendar.
+*/
+void Daemon::notifyEventHandled(const QString& eventId, bool reloadCal)
+{
+	kdDebug(5950) << "Daemon::notifyEventHandled(" << eventId << (reloadCal ? "): reload" : ")") << endl;
+	AlarmDaemonIface_stub s(DAEMON_APP_NAME, DAEMON_DCOP_OBJECT);
+	s.eventHandled(QCString(kapp->aboutData()->appName()), AlarmCalendar::activeCalendar()->urlString(), eventId, reloadCal);
+	if (!s.ok())
+		kdError(5950) << "Daemon::notifyEventHandled(): eventHandled dcop send failed" << endl;
+}
+
+/******************************************************************************
 * Return the maximum time (in seconds) elapsed since the last time the alarm
 * daemon must have checked alarms.
 */
@@ -594,7 +652,14 @@
  */
 void NotificationHandler::handleEvent(const QString& url, const QString& eventId)
 {
-	theApp()->handleEvent(url, eventId);
+	QString id = eventId;
+	if (id.startsWith(QString::fromLatin1("ad:")))
+	{
+		// It's a notification from the alarm deamon
+		id = id.mid(3);
+		Daemon::queueEvent(id);
+	}
+	theApp()->handleEvent(url, id);
 }
 
 /******************************************************************************
Index: kalarm/functions.cpp
===================================================================
--- kalarm/functions.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/functions.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  functions.cpp  -  miscellaneous functions
  *  Program:  kalarm
- *  Copyright (C) 2001 - 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001-2006 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -319,8 +319,7 @@
 		if (archive  &&  event.toBeArchived())
 			addExpiredEvent(event);     // this changes the event ID to an expired ID
 		AlarmCalendar* cal = AlarmCalendar::activeCalendar();
-		cal->deleteEvent(id);
-		cal->save();
+		cal->deleteEvent(id, true);    // save calendar after deleting
 	}
 	return ret;
 }
@@ -336,8 +335,7 @@
 	AlarmCalendar* cal = AlarmCalendar::templateCalendarOpen();
 	if (cal)
 	{
-		cal->deleteEvent(id);
-		cal->save();
+		cal->deleteEvent(id, true);    // save calendar after deleting
 		cal->emitEmptyStatus();
 	}
 
Index: kalarm/kalarmapp.h
===================================================================
--- kalarm/kalarmapp.h	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/kalarmapp.h	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -113,8 +113,7 @@
 		};
 		struct ProcData
 		{
-			ProcData(ShellProcess* p, ShellProcess* logp, KAEvent* e, KAAlarm* a, int f = 0)
-			          : process(p), logProcess(logp), event(e), alarm(a), messageBoxParent(0), flags(f) { }
+			ProcData(ShellProcess* p, ShellProcess* logp, KAEvent* e, KAAlarm* a, int f = 0);
 			~ProcData();
 			enum { PRE_ACTION = 0x01, POST_ACTION = 0x02, RESCHEDULE = 0x04, ALLOW_DEFER = 0x08,
 			       TEMP_FILE = 0x10, EXEC_IN_XTERM = 0x20 };
Index: kalarm/alarmcalendar.cpp
===================================================================
--- kalarm/alarmcalendar.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kalarm/alarmcalendar.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -1,7 +1,7 @@
 /*
  *  alarmcalendar.cpp  -  KAlarm calendar file access
  *  Program:  kalarm
- *  Copyright (C) 2001 - 2005 by David Jarvie <software@astrojar.org.uk>
+ *  Copyright (c) 2001-2006 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -48,6 +48,7 @@
 #include <libkcal/icalformat.h>
 
 #include "calendarcompat.h"
+#include "daemon.h"
 #include "kalarmapp.h"
 #include "mainwindow.h"
 #include "preferences.h"
@@ -630,8 +631,13 @@
 		{
 			evnt.updateKCalEvent(*kcalEvent);
 			evnt.clearUpdated();
+			if (mType == KAEvent::ACTIVE)
+				Daemon::savingEvent(evnt.id());
+			return;
 		}
 	}
+	if (mType == KAEvent::ACTIVE)
+		Daemon::eventHandled(evnt.id(), false);
 }
 
 /******************************************************************************
@@ -646,10 +652,15 @@
 		if (kcalEvent)
 		{
 			mCalendar->deleteEvent(kcalEvent);
+			if (mType == KAEvent::ACTIVE)
+				Daemon::savingEvent(eventID);
 			if (saveit)
 				save();
+			return;
 		}
 	}
+	if (mType == KAEvent::ACTIVE)
+		Daemon::eventHandled(eventID, false);
 }
 
 /******************************************************************************
Index: kaddressbook/editors/protocols/skypeprotocol.desktop
===================================================================
--- kaddressbook/editors/protocols/skypeprotocol.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kaddressbook/editors/protocols/skypeprotocol.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -14,6 +14,7 @@
 Comment[eu]=Skype-en internet telefonia
 Comment[fr]=Téléphonie Internet Skype
 Comment[he]=טלפוניית רשת של Skype
+Comment[hu]=Skype internetes telefon
 Comment[is]=Skype Internet sími
 Comment[it]=Telefonia internet Skype
 Comment[ja]=Skype インターネット電話
@@ -26,7 +27,7 @@
 Comment[pt]=Telefonia Internet Skype
 Comment[pt_BR]=Telefonia via Internet Skype
 Comment[ru]=Интернет-телефон Skype
-Comment[sl]=Internetna telefonija Skype
+Comment[sl]=Internetno telefoniranje Skype
 Comment[sr]=Skype интернет телефонија
 Comment[sr@Latn]=Skype internet telefonija
 Comment[sv]=Skype Internettelefoni
Index: kitchensync/libkonnector2/filters/calendarfilter.desktop
===================================================================
--- kitchensync/libkonnector2/filters/calendarfilter.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kitchensync/libkonnector2/filters/calendarfilter.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -18,6 +18,7 @@
 Name[eu]=Egutegiaren iragazkia
 Name[fr]=Filtre pour le calendrier
 Name[he]=מסנן לוח שנה
+Name[hu]=Naptárszűrő
 Name[is]=Dagatalssía
 Name[it]=Filtro calendario
 Name[ja]=カレンダーフィルタ
@@ -50,6 +51,7 @@
 Comment[eu]=Egutegian gertaerak eta egitekoak iragazten ditu
 Comment[fr]=Permet de filtrer les évènements et les tâches du calendrier
 Comment[he]=מסנן אירועים ומטלות בלוח השנה
+Comment[hu]=Szűrő a naptár eseményeihez és feladataihoz
 Comment[is]=Síar atburði og verkþætti í dagatali
 Comment[it]=Fltra gli eventi e le cose da fare in un calendario
 Comment[lt]=Filtruoja įvykius ir užduotis kalendoriuje
Index: kitchensync/libkonnector2/filters/addressbookfilter.desktop
===================================================================
--- kitchensync/libkonnector2/filters/addressbookfilter.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kitchensync/libkonnector2/filters/addressbookfilter.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -18,6 +18,7 @@
 Name[eu]=Helbide-liburuaren iragazkia
 Name[fr]=Filtre pour le carnet d'adresses
 Name[he]=מסנן פנקס כתובות
+Name[hu]=Címjegyzékszűrő
 Name[is]=Sía fyrir vistfangaskrá
 Name[it]=Filtro rubrica indirizzi
 Name[ja]=アドレス帳フィルタ
@@ -50,6 +51,7 @@
 Comment[eu]=Helbide-liburuko kontaktuak iragazten ditu
 Comment[fr]=Permet de filtrer les contacts du carnet d'adresses
 Comment[he]=מסנן אנשי קשר בפנקס הכתובות
+Comment[hu]=Szűrési lehetőség a címjegyzékben
 Comment[is]=Síar tengiliði í vistfangaskrá
 Comment[it]=Filtra i contatti di una rubrica indirizzi
 Comment[ja]=アドレス帳の連絡先をフィルタ
Index: kontact/plugins/akregator/akregatorplugin.desktop
===================================================================
--- kontact/plugins/akregator/akregatorplugin.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/akregator/akregatorplugin.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -75,7 +75,7 @@
 Name[pt]=Fontes
 Name[pt_BR]=Fontes de Notícias
 Name[ru]=Ленты новостей
-Name[sl]=Dovodi
+Name[sl]=Viri
 Name[sr]=Доводи
 Name[sr@Latn]=Dovodi
 Name[sv]=Källor
Index: kontact/plugins/akregator/akregatorplugin3.2.desktop
===================================================================
--- kontact/plugins/akregator/akregatorplugin3.2.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/akregator/akregatorplugin3.2.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -74,7 +74,7 @@
 Name[pt]=Fontes
 Name[pt_BR]=Fontes de Notícias
 Name[ru]=Ленты новостей
-Name[sl]=Dovodi
+Name[sl]=Viri
 Name[sr]=Доводи
 Name[sr@Latn]=Dovodi
 Name[sv]=Källor
Index: kontact/plugins/karm/karmplugin.desktop
===================================================================
--- kontact/plugins/karm/karmplugin.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/karm/karmplugin.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -25,6 +25,7 @@
 Comment[eu]=KArm plugina
 Comment[fr]=Module pour KArm
 Comment[ga]=Breiseán KArm
+Comment[hu]=KArm bővítőmodul
 Comment[is]=KArm íforrit
 Comment[it]=Plugin KArm
 Comment[ja]=KArm プラグイン
@@ -37,7 +38,7 @@
 Comment[pt]='Plugin' KArm
 Comment[pt_BR]=Plugin do KArm
 Comment[ru]=Модуль KArm
-Comment[sl]=Vstavek KArm
+Comment[sl]=Vstavek za KArm
 Comment[sr]=Прикључак KArm-а
 Comment[sr@Latn]=Priključak KArm-a
 Comment[sv]=Karm-insticksprogram
Index: kontact/plugins/weather/weatherplugin.desktop
===================================================================
--- kontact/plugins/weather/weatherplugin.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/weather/weatherplugin.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -71,6 +71,7 @@
 Name[eu]=Eguraldiaren zerbitzua
 Name[fr]=KWeatherService
 Name[ga]=Seirbhís Aimsire
+Name[hu]=Időjárás
 Name[is]=Veðurþjónusta
 Name[it]=Servizio meteorologico
 Name[ja]=気象サービス
@@ -83,7 +84,7 @@
 Name[pt]=Serviço Meteorológico
 Name[pt_BR]=Serviço de Previsão do Tempo
 Name[ru]=Погода
-Name[sl]=Vremenska napoved
+Name[sl]=Vremenska storitev
 Name[sr]=Време
 Name[sr@Latn]=Vreme
 Name[sv]=Väderleksprognos
Index: kontact/plugins/kpilot/kpilot_plugin.cpp
===================================================================
--- kontact/plugins/kpilot/kpilot_plugin.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/kpilot/kpilot_plugin.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -35,7 +35,7 @@
                             KPilotPluginFactory( "kontact_kpilotplugin" ) )
 
 KPilotPlugin::KPilotPlugin( Kontact::Core *core, const char *name, const QStringList& )
-  : Kontact::Plugin( core, core, name ), mAboutData( 0 )
+  : Kontact::Plugin( core, core, "kpilot" ), mAboutData( 0 )
 {
   setInstance( KPilotPluginFactory::instance() );
 	// TODO: Make sure kpilotDaemon is running!
Index: kontact/plugins/korganizer/kcmkorgsummary.desktop
===================================================================
--- kontact/plugins/korganizer/kcmkorgsummary.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/korganizer/kcmkorgsummary.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -20,6 +20,7 @@
 Name[et]=Kohtumised ja ülesanded
 Name[eu]=Hitzorduak eta egitekoak
 Name[fr]=Évènements et tâches
+Name[hu]=Találkozók és feladatok
 Name[is]=Fundir og verkþættir
 Name[it]=Appuntamenti e cose da fare
 Name[lt]=Susitikimai ir užduotys
@@ -47,6 +48,7 @@
 Comment[et]=Kohtumiste ja ülesannete kokkuvõtte seadistus
 Comment[eu]=Hitzordu eta egitekoen laburpenen konfigurazioa
 Comment[fr]=Configuration du résumé des évènements et des tâches
+Comment[hu]=A találkozók és feladatok áttekintőjének beállítása
 Comment[is]=Uppsetning á yfirliti yfir fundi og verkþætti
 Comment[it]=Impostazioni sommario appuntamenti e cose da fare
 Comment[ja]=予約と To-do の概要設定
Index: kontact/plugins/newsticker/kcmkontactknt.desktop
===================================================================
--- kontact/plugins/newsticker/kcmkontactknt.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ kontact/plugins/newsticker/kcmkontactknt.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -68,6 +68,7 @@
 Comment[et]=Uudistejälgija kokkuvõtte seadistus
 Comment[eu]=Berri markatzailearen laburpenaren konfigurazioa
 Comment[fr]=Configuration du résumé du téléscripteur de nouvelles
+Comment[hu]=A hírmegjelenítő áttekintőjének beállításai
 Comment[is]=Uppsetning á yfirliti yfir fréttastrimla
 Comment[it]=Impostazioni sommario ticker notizie
 Comment[ja]=メール Ticker の設定
@@ -80,6 +81,7 @@
 Comment[pt]=Configuração do Sumário do Extractor de Notícias
 Comment[pt_BR]=Configuração de Resumo de Notícias
 Comment[ru]=Настройка дайджеста новостей
+Comment[sl]=Nastavitve povzetka novic
 Comment[sr]=Подешавање сажетка приказивања вести
 Comment[sr@Latn]=Podešavanje sažetka prikazivanja vesti
 Comment[sv]=Inställning av nyhetsövervakningsöversikt
Index: korganizer/kodialogmanager.cpp
===================================================================
--- korganizer/kodialogmanager.cpp	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ korganizer/kodialogmanager.cpp	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -25,6 +25,7 @@
 
 #include <kcmultidialog.h>
 #include <ksettings/dialog.h>
+#include <kwin.h>
 
 #include <libkdepim/categoryeditdialog.h>
 
@@ -89,6 +90,9 @@
   mFilterEditDialog = 0;
 
   mCategoryEditDialog = new KPIM::CategoryEditDialog( KOPrefs::instance(), mMainView );
+  // don't set any specific parent for the dialog, as its kept around and reused
+  // in different cases where it should have different parents
+  KWin::setMainWindow( mCategoryEditDialog, 0 );
   connect( mainView, SIGNAL( categoriesChanged() ),
            mCategoryEditDialog, SLOT( reload() ) );
   KOGlobals::fitDialogToScreen( mCategoryEditDialog );
Index: korganizer/korganizer_configplugins.desktop
===================================================================
--- korganizer/korganizer_configplugins.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ korganizer/korganizer_configplugins.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -29,6 +29,7 @@
 Name[ga]=Breiseáin
 Name[hu]=Bővítőmodulok
 Name[is]=Íforrit
+Name[it]=Plugin
 Name[ja]=プラグイン
 Name[lt]=Priedai
 Name[nb]=Programtillegg
Index: korganizer/korgac/korgac.desktop
===================================================================
--- korganizer/korgac/korgac.desktop	(.../tags/KDE/3.5.1/kdepim)	(revision 503772)
+++ korganizer/korgac/korgac.desktop	(.../branches/KDE/3.5/kdepim)	(revision 503772)
@@ -11,6 +11,7 @@
 Name[et]=KOrganizeri meeldetuletuse klientprogramm
 Name[eu]=KOrganizer-en oroigarrien bezeroa
 Name[fr]=Client d'alarme de KOrganizer
+Name[hu]=KOrganizer-emlékeztető kliens
 Name[is]=Áminningarforrit fyrir KOrganizer
 Name[it]=Client degli avvisi di KOrganizer
 Name[ja]=KOrganizer リマインダクライアント
@@ -42,6 +43,7 @@
 GenericName[et]=KOrganizeri meeldetuletusdeemoni klientprogramm
 GenericName[eu]=KOrganizer-en oroigarrien deabruaren bezeroa
 GenericName[fr]=Client pour le démon d'alarme de KOrganizer
+GenericName[hu]=KOrganizer emlékeztető szolgáltatás kliense
 GenericName[is]=Áminningarpúki fyrir KOrganizer
 GenericName[it]=Client del demone degli avvisi di KOrganizer
 GenericName[ja]=KOrganizer リマインダデーモンクライアント
@@ -54,6 +56,7 @@
 GenericName[pt]=Cliente do Servidor de Avisos do KOrganizer
 GenericName[pt_BR]=Cliente do Servidor de Alarme do KOrganizer
 GenericName[ru]=Клиент службы уведомлений KOrganizer
+GenericName[sl]=Pritajeni odjemalec za opomnik KOrganizerja
 GenericName[sr]=Клијент демона подсетника KOrganizer-а
 GenericName[sr@Latn]=Klijent demona podsetnika KOrganizer-a
 GenericName[sv]=Korganizer-alarmdemonklient

Property changes on: .
___________________________________________________________________
Name: svn:externals
   + admin https://svn.kde.org/home/kde/branches/KDE/3.5/kde-common/admin


