[meego-commits] 14395: Changes to Trunk:Testing/mkcal
Bernd Wachter
no_reply at build.meego.com
Tue Mar 1 15:17:45 UTC 2011
Hi,
I have made the following changes to mkcal in project Trunk:Testing. Please review and accept ASAP.
Thank You,
Bernd Wachter
[This message was auto-generated]
---
Request #14395:
submit: home:bwachter:branches:Trunk:Testing/mkcal(r2)(cleanup) -> Trunk:Testing/mkcal
Message:
* Tue Mar 01 2011 Bernd Wachter <ext-bernd.wachter at nokia.com> - 0.3.8
- Update version for BMC#6050
State: new 2011-03-01T02:15:48 bwachter
Comment: None
changes files:
--------------
--- mkcal.changes
+++ mkcal.changes
@@ -0,0 +1,3 @@
+* Tue Mar 01 2011 Bernd Wachter <ext-bernd.wachter at nokia.com> - 0.3.8
+- Update version for BMC#6050
+
old:
----
mkcal-0.3.1.tar.gz
new:
----
mkcal-0.3.8.tar.gz
spec files:
-----------
--- mkcal.spec
+++ mkcal.spec
@@ -2,7 +2,7 @@
%define ver_maj 0
%define ver_min 3
-%define ver_pat 1
+%define ver_pat 8
Name: mkcal
Version: %{ver_maj}.%{ver_min}.%{ver_pat}
other changes:
--------------
++++++ mkcal-0.3.1.tar.gz -> mkcal-0.3.8.tar.gz
--- debian/changelog
+++ debian/changelog
@@ -1,3 +1,49 @@
+libmkcal (0.3.8) unstable; urgency=low
+
+ * Removing some debug output
+ * Fixes: NB#229433 - event indicator disappears after editing a recurring event for the current month.
+
+ -- Meng Sun <meng.5.sun at nokia.com> Mon, 28 Feb 2011 10:06:00 +0200
+
+libmkcal (0.3.7) unstable; urgency=low
+
+ * Fixes: NB#226481 - MKcal provides count methods only for incidences currently in memory
+ * Fixes: NB#225848 - libmkcal-doc doesn't describe situations where bool mKCal::ExtendedStorage::load() can fail
+
+ -- Meng Sun <meng.5.sun at nokia.com> Tue, 22 Feb 2011 13:36:57 +0200
+
+libmkcal (0.3.6) unstable; urgency=low
+
+ * Fixes: NB#220999 - com.nokia.time.add_events D-Bus method is called too often during the initial ms exchange sync
+
+ -- Meng Sun <meng.5.sun at nokia.com> Fri, 18 Feb 2011 10:17:34 +0200
+
+libmkcal (0.3.5) unstable; urgency=low
+
+ * Fixes: NB#192795 - Editing first instance of recurrent event creates duplicate in agenda view
+
+ -- Meng Sun <meng.5.sun at nokia.com> Thu, 17 Feb 2011 14:50:18 +0200
+
+libmkcal (0.3.4) unstable; urgency=low
+
+ * Fixes: NB#6049 - importing/exporting iCalendar 2.0: properties modified
+
+ -- Meng Sun <meng.5.sun at nokia.com> Tue, 15 Feb 2011 13:57:44 +0200
+
+libmkcal (0.3.3) unstable; urgency=low
+
+ * Fix possible crash. NO_REVIEWBOARD
+ * Fixes: NB#226736 - Few of the recurring events and also normal events are not deleted from calendar on deleting mfe account.
+ * NO_REVIEWBOARD: minor performance improvement
+
+ -- Meng Sun <meng.5.sun at nokia.com> Mon, 14 Feb 2011 15:20:15 +0200
+
+libmkcal (0.3.2) unstable; urgency=low
+
+ * NO_REVIEWBOARD: removed old hack - add 1 day if allday, not needed anymore
+
+ -- Meng Sun <meng.5.sun at nokia.com> Fri, 04 Feb 2011 10:07:41 +0200
+
libmkcal (0.3.1) unstable; urgency=low
* Creating signal only when db is really changed in save
--- src/directorystorage.cpp
+++ src/directorystorage.cpp
@@ -735,6 +735,21 @@
return KDateTime();
}
+int DirectoryStorage::eventCount()
+{
+ return 0;
+}
+
+int DirectoryStorage::todoCount()
+{
+ return 0;
+}
+
+int DirectoryStorage::journalCount()
+{
+ return 0;
+}
+
bool DirectoryStorage::notifyOpened( const Incidence::Ptr &incidence )
{
Q_UNUSED( incidence );
--- src/directorystorage.h
+++ src/directorystorage.h
@@ -357,6 +357,24 @@
/**
@copydoc
+ ExtendedStorage::eventCount()
+ */
+ int eventCount();
+
+ /**
+ @copydoc
+ ExtendedStorage::todoCount()
+ */
+ int todoCount();
+
+ /**
+ @copydoc
+ ExtendedStorage::journalCount()
+ */
+ int journalCount();
+
+ /**
+ @copydoc
ExtendedStorage::notifyOpened( const KCalCore::Incidence::Ptr & )
*/
bool notifyOpened( const KCalCore::Incidence::Ptr &incidence );
--- src/dummystorage.h
+++ src/dummystorage.h
@@ -232,6 +232,18 @@
{
return KDateTime();
}
+ int eventCount()
+ {
+ return 0;
+ }
+ int todoCount()
+ {
+ return 0;
+ }
+ int journalCount()
+ {
+ return 0;
+ }
void virtual_hook( int, void * ) {
return;
}
--- src/extendedcalendar.cpp
+++ src/extendedcalendar.cpp
@@ -1513,6 +1513,7 @@
ExtendedCalendar::ExpandedIncidenceList returnList;
Incidence::List::Iterator iit;
KDateTime brokenDtStart = dtStart.addSecs(-1);
+ KDateTime::Spec ts = timeSpec();
// used for comparing with entries that have broken dtEnd => we use
// dtStart and compare it against this instead. As this is allocated
@@ -1577,8 +1578,30 @@
#ifdef DEBUG_EXPANSION
kDebug() << "---appending" << (*iit)->summary() << dt.toString();
#endif /* DEBUG_EXPANSION */
- returnList.append( ExpandedIncidence( dt.dateTime(), *iit ) );
- appended++;
+ if ( (*iit)->recurs() ) {
+ if ( !(*iit)->dtStart().isDateOnly() ) {
+ if ( !(*iit)->recursAt( (*iit)->dtStart() ) ) {
+#ifdef DEBUG_EXPANSION
+ kDebug() << "--not recurring at" << (*iit)->dtStart() << (*iit)->summary();
+#endif /* DEBUG_EXPANSION */
+ } else {
+ returnList.append( ExpandedIncidence( dt.dateTime(), *iit ) );
+ appended++;
+ }
+ } else {
+ if ( !(*iit)->recursOn( (*iit)->dtStart().date(), ts ) ) {
+#ifdef DEBUG_EXPANSION
+ kDebug() << "--not recurring on" << (*iit)->dtStart() << (*iit)->summary();
+#endif /* DEBUG_EXPANSION */
+ } else {
+ returnList.append( ExpandedIncidence( dt.dateTime(), *iit ) );
+ appended++;
+ }
+ }
+ } else {
+ returnList.append( ExpandedIncidence( dt.dateTime(), *iit ) );
+ appended++;
+ }
} else {
#ifdef DEBUG_EXPANSION
kDebug() << "-- no match" << dt.toString() << dte.toString() << dte.isValid() << brokenEnd;
@@ -1670,7 +1693,6 @@
bool *expandLimitHit )
{
ExtendedCalendar::ExpandedIncidenceList returnList;
- ExtendedCalendar::ExpandedIncidenceList::Iterator iit;
int i;
if ( expandLimitHit )
--- src/extendedstorage.cpp
+++ src/extendedstorage.cpp
@@ -430,9 +430,10 @@
if ( allIncidences( &list, nb->uid() ) ) {
kDebug() << "deleting" << list.size() << "notes of notebook" << nb->name();
for ( it = list.begin(); it != list.end(); ++it ) {
- Incidence::Ptr incidence = *it;
- load ( incidence->uid(), incidence->recurrenceId() );
- Incidence::Ptr toDelete = calendar()->incidence( incidence->uid() );
+ load ( (*it)->uid(), (*it)->recurrenceId() );
+ }
+ for ( it = list.begin(); it != list.end(); ++it ) {
+ Incidence::Ptr toDelete = calendar()->incidence( (*it)->uid(), (*it)->recurrenceId() );
calendar()->deleteIncidence( toDelete );
}
if ( !list.isEmpty() ) {
@@ -579,6 +580,8 @@
{
#if defined(TIMED_SUPPORT)
Timed::Interface timed;
+ int alarmNumer = 0;
+
if ( !timed.isValid() ) {
kError() << "cannot set alarm for incidence: "
<< "alarm interface is not valid" << timed.lastError();
@@ -608,6 +611,7 @@
}
}
Timed::Event& e = events.append();
+ alarmNumer++;
e.setUserModeFlag();
if ( alarmTime.isUtc() ) {
e.setTicker( alarmTime.toTime_t() );
@@ -680,19 +684,23 @@
e.setAlignedSnoozeFlag();
}
- QDBusReply < QList<QVariant> > reply = timed.add_events_sync( events );
- if ( reply.isValid() ) {
- foreach (QVariant v, reply.value()) {
- bool ok = true;
- uint cookie = v.toUInt(&ok);
- if (ok && cookie) {
- kDebug() << "added alarm: " << cookie;
- } else {
- kError() << "failed to add alarm";
+ if (alarmNumer > 0) {
+ QDBusReply < QList<QVariant> > reply = timed.add_events_sync( events );
+ if ( reply.isValid() ) {
+ foreach (QVariant v, reply.value()) {
+ bool ok = true;
+ uint cookie = v.toUInt(&ok);
+ if (ok && cookie) {
+ kDebug() << "added alarm: " << cookie;
+ } else {
+ kError() << "failed to add alarm";
+ }
}
+ } else {
+ kError() << "failed to add alarms: " << reply.error().message();
}
} else {
- kError() << "failed to add alarms: " << reply.error().message();
+ kDebug() << "No alarms to send";
}
#else
Q_UNUSED( incidence );
--- src/extendedstorage.h
+++ src/extendedstorage.h
@@ -149,7 +149,7 @@
Load incidences at given date into the memory.
@param date date
- @return true if the load was successful; false otherwise.
+ @return true if the load was successful and specific date wasn't already loaded; false otherwise.
*/
virtual bool load( const QDate &date ) = 0;
@@ -158,7 +158,7 @@
@param start is the starting date
@param end is the ending date
- @return true if the load was successful; false otherwise.
+ @return true if the load was successful and specific dates wasn't already loaded; false otherwise.
*/
virtual bool load( const QDate &start, const QDate &end ) = 0;
@@ -457,6 +457,27 @@
*/
virtual KDateTime incidenceDeletedDate( const KCalCore::Incidence::Ptr &incidence ) = 0;
+ /**
+ Get count of events
+
+ @return count of events
+ */
+ virtual int eventCount() = 0;
+
+ /**
+ Get count of todos
+
+ @return count of todos
+ */
+ virtual int todoCount() = 0;
+
+ /**
+ Get count of journals
+
+ @return count of journals
+ */
+ virtual int journalCount() = 0;
+
// Observer Specific Methods //
/**
--- src/sqliteformat.cpp
+++ src/sqliteformat.cpp
@@ -1754,12 +1754,11 @@
if (isOrganizer) {
Person::Ptr person = Person::Ptr( new Person ( name, email ) );
incidence->setOrganizer( person );
- } else {
- Attendee::Ptr attendee = Attendee::Ptr( new Attendee( name, email, rsvp, status, role ) );
- attendee->setDelegate(QString::fromUtf8((const char *)sqlite3_column_text(stmt, 7)));
- attendee->setDelegator(QString::fromUtf8((const char *)sqlite3_column_text(stmt, 8)));
- incidence->addAttendee(attendee, false);
}
+ Attendee::Ptr attendee = Attendee::Ptr( new Attendee( name, email, rsvp, status, role ) );
+ attendee->setDelegate(QString::fromUtf8((const char *)sqlite3_column_text(stmt, 7)));
+ attendee->setDelegator(QString::fromUtf8((const char *)sqlite3_column_text(stmt, 8)));
+ incidence->addAttendee(attendee, false);
}
} while (rv != SQLITE_DONE);
--- src/sqlitestorage.cpp
+++ src/sqlitestorage.cpp
@@ -204,6 +204,7 @@
const char *query5, int qsize5,const char *query6, int qsize6,
DBOperation dbop, const KDateTime &after,
const QString ¬ebookUid, const QString &summary = QString() );
+ int selectCount( const char *query, int qsize );
bool checkVersion();
bool saveTimezones();
bool loadTimezones();
@@ -1763,17 +1764,15 @@
<< event->dtStart() << event->dtEnd()
<< "in calendar";
mCalendar->deleteEvent( old ); // move old to deleted
- mCalendar->addEvent( event ); // and replace it with this one
- mCalendar->setNotebook( event, notebookUid );
+ mCalendar->addEvent( event, notebookUid ); // and replace it with this one
} else {
event = old;
}
} else {
- kDebug() << "adding event" << event->uid()
- << event->dtStart() << event->dtEnd()
- << "in calendar";
- mCalendar->addEvent( event );
- mCalendar->setNotebook( event, notebookUid );
+// kDebug() << "adding event" << event->uid()
+// << event->dtStart() << event->dtEnd()
+// << "in calendar";
+ mCalendar->addEvent( event, notebookUid );
}
if ( event != old ) {
count++; // added into calendar
@@ -1801,8 +1800,7 @@
<< todo->dtDue() << todo->created()
<< "in calendar";
mCalendar->deleteTodo( old ); // move old to deleted
- mCalendar->addTodo( todo ); // and replace it with this one
- mCalendar->setNotebook( todo, notebookUid );
+ mCalendar->addTodo( todo, notebookUid ); // and replace it with this one
} else {
todo = old;
}
@@ -1810,8 +1808,7 @@
kDebug() << "adding todo" << todo->uid()
<< todo->dtDue() << todo->created()
<< "in calendar";
- mCalendar->addTodo( todo );
- mCalendar->setNotebook( todo, notebookUid );
+ mCalendar->addTodo( todo, notebookUid );
}
if ( todo != old ) {
count++; // added into calendar
@@ -1839,8 +1836,7 @@
<< journal->dtStart() << journal->created()
<< "in calendar";
mCalendar->deleteJournal( old ); // move old to deleted
- mCalendar->addJournal( journal ); // and replace it with this one
- mCalendar->setNotebook( journal, notebookUid );
+ mCalendar->addJournal( journal, notebookUid ); // and replace it with this one
} else {
journal = old;
}
@@ -1848,8 +1844,7 @@
kDebug() << "adding journal" << journal->uid()
<< journal->dtStart() << journal->created()
<< "in calendar";
- mCalendar->addJournal( journal );
- mCalendar->setNotebook( journal, notebookUid );
+ mCalendar->addJournal( journal, notebookUid );
}
if ( journal != old ) {
count++; // added into calendar
@@ -2761,6 +2756,59 @@
return deletionDate;
}
+//@cond PRIVATE
+int SqliteStorage::Private::selectCount( const char *query, int qsize )
+{
+ int rv = 0;
+ int count = 0;
+ sqlite3_stmt *stmt = NULL;
+ const char *tail = NULL;
+
+ if ( !mSem.acquire() ) {
+ kError() << "cannot lock" << mDatabaseName << "error" << mSem.errorString();
+ return count;
+ }
+
+ sqlite3_prepare_v2( mDatabase, query, qsize, &stmt, &tail );
+ sqlite3_step( stmt );
+ if ((rv == SQLITE_ROW) || (rv == SQLITE_OK)) {
+ count = sqlite3_column_int(stmt, 0);
+ }
+
+ error:
+ sqlite3_reset( stmt );
+ sqlite3_finalize( stmt );
+
+ if ( !mSem.release() ) {
+ kError() << "cannot release lock" << mDatabaseName << "error" << mSem.errorString();
+ }
+ return count;
+}
+//@endcond
+
+int SqliteStorage::eventCount()
+{
+ const char *query = SELECT_EVENT_COUNT;
+ int qsize = sizeof( SELECT_EVENT_COUNT );
+
+ return d->selectCount(query,qsize);
+}
+
+int SqliteStorage::todoCount()
+{
+ const char *query = SELECT_TODO_COUNT;
+ int qsize = sizeof( SELECT_TODO_COUNT );
+
+ return d->selectCount(query,qsize);
+}
+
+int SqliteStorage::journalCount()
+{
+ const char *query = SELECT_JOURNAL_COUNT;
+ int qsize = sizeof( SELECT_JOURNAL_COUNT );
+
+ return d->selectCount(query,qsize);
+}
bool SqliteStorage::loadNotebooks()
{
@@ -3125,7 +3173,7 @@
void SqliteStorage::queryFinished()
{
- delete sender(); //Cleanup the memory
+ sender()->deleteLater(); //Cleanup the memory
}
void SqliteStorage::virtual_hook( int id, void *data )
--- src/sqlitestorage.h
+++ src/sqlitestorage.h
@@ -326,6 +326,24 @@
/**
@copydoc
+ ExtendedStorage::eventCount()
+ */
+ int eventCount();
+
+ /**
+ @copydoc
+ ExtendedStorage::todoCount()
+ */
+ int todoCount();
+
+ /**
+ @copydoc
+ ExtendedStorage::journalCount()
+ */
+ int journalCount();
+
+ /**
+ @copydoc
ExtendedStorage::virtual_hook()
*/
virtual void virtual_hook( int id, void *data );
@@ -668,6 +686,12 @@
"select DateDeleted from Components where UID=? and DateDeleted<>0"
#define SELECT_ATTENDEE_AND_COUNT \
"select Email, Name, count(Email) from Attendee where Email<>0 group by Email"
+#define SELECT_EVENT_COUNT \
+"select count(*) from Components where Type='Event' and DateDeleted=0"
+#define SELECT_TODO_COUNT \
+"select count(*) from Components where Type='Todo' and DateDeleted=0"
+#define SELECT_JOURNAL_COUNT \
+"select count(*) from Components where Type='Journal' and DateDeleted=0"
#define BEGIN_TRANSACTION \
"BEGIN IMMEDIATE;"
--- src/trackermodify.cpp
+++ src/trackermodify.cpp
@@ -320,14 +320,8 @@
insertQuery << " ]";
}
if ( event->hasEndDate() ) {
- if ( event->allDay() ) {
- // +1 day because end date is non-inclusive.
- insertQuery << "; ncal:dtend [ a ncal:NcalDateTime; ncal:dateTime \""
- << d->kdatetime2String( event->dtEnd().addDays( 1 ), false ) << "\"";
- } else {
- insertQuery << "; ncal:dtend [ a ncal:NcalDateTime; ncal:dateTime \""
- << d->kdatetime2String( event->dtEnd(), false ) << "\"";
- }
+ insertQuery << "; ncal:dtend [ a ncal:NcalDateTime; ncal:dateTime \""
+ << d->kdatetime2String( event->dtEnd(), false ) << "\"";
if ( !event->dtEnd().isUtc() ) {
insertQuery << "; ncal:ncalTimezone <urn:x-ical:timezone:"
<< event->dtEnd().timeZone().name() << ">";
--- src/trackerstorage.cpp
+++ src/trackerstorage.cpp
@@ -815,6 +815,21 @@
return KDateTime();
}
+int TrackerStorage::eventCount()
+{
+ return 0;
+}
+
+int TrackerStorage::todoCount()
+{
+ return 0;
+}
+
+int TrackerStorage::journalCount()
+{
+ return 0;
+}
+
bool TrackerStorage::notifyOpened( const Incidence::Ptr &incidence )
{
Q_UNUSED( incidence );
--- src/trackerstorage.h
+++ src/trackerstorage.h
@@ -300,6 +300,24 @@
/**
@copydoc
+ ExtendedStorage::eventCount()
+ */
+ int eventCount();
+
+ /**
+ @copydoc
+ ExtendedStorage::todoCount()
+ */
+ int todoCount();
+
+ /**
+ @copydoc
+ ExtendedStorage::journalCount()
+ */
+ int journalCount();
+
+ /**
+ @copydoc
ExtendedStorage::notifyOpened( const KCalCore::Incidence::Ptr & )
*/
bool notifyOpened( const KCalCore::Incidence::Ptr &incidence );
More information about the MeeGo-commits
mailing list