Branch 'dev/invitations' - 4 commits - calendarsupport/utils.cpp calendarviews/helper.cpp calendarviews/month incidenceeditor-ng/editoritemmanager.cpp incidenceeditor-ng/incidencedialog.cpp korganizer/calendarview.cpp

Sandro Knauß knauss at kolabsys.com
Tue Sep 2 16:37:30 CEST 2014


 calendarsupport/utils.cpp                |    4 +++-
 calendarviews/helper.cpp                 |    2 +-
 calendarviews/month/monthitem.cpp        |   13 ++-----------
 incidenceeditor-ng/editoritemmanager.cpp |    3 ++-
 incidenceeditor-ng/incidencedialog.cpp   |    4 ++--
 korganizer/calendarview.cpp              |    2 +-
 6 files changed, 11 insertions(+), 17 deletions(-)

New commits:
commit cd772e7a685a933ddccfc2bf0d4be2da1658ad01
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Tue Sep 2 16:34:41 2014 +0200

    show displayName if available

diff --git a/calendarsupport/utils.cpp b/calendarsupport/utils.cpp
index b398959..481de05 100644
--- a/calendarsupport/utils.cpp
+++ b/calendarsupport/utils.cpp
@@ -622,7 +622,9 @@ QString CalendarSupport::displayName( Akonadi::ETMCalendar *calendar, const Akon
   const QString dName = fullCollection.displayName();
 
   if ( !dName.isEmpty() ) {
-    return fullCollection.name().startsWith( QLatin1String( "akonadi_" ) ) ? i18n( "My %1", dName ) : fullCollection.name();
+    return fullCollection.name().startsWith( QLatin1String( "akonadi_" ) ) ? i18n( "My %1", dName ) : dName;
+  } else if ( !fullCollection.name().isEmpty() ) {
+    return fullCollection.name();
   } else {
     return i18nc( "unknown resource", "Unknown" );
   }


commit 9e2eeca25b05b85e933e528d14dc63642cb69447
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Tue Sep 2 15:27:06 2014 +0200

    show color for parent Collection

diff --git a/calendarviews/helper.cpp b/calendarviews/helper.cpp
index 50d868d..8ca2b62 100644
--- a/calendarviews/helper.cpp
+++ b/calendarviews/helper.cpp
@@ -51,7 +51,7 @@ QColor EventViews::resourceColor( const Akonadi::Item &item, const PrefsPtr &pre
   if ( !item.isValid() ) {
     return QColor();
   }
-  const QString id = QString::number( item.storageCollectionId() );
+  const QString id = QString::number( item.parentCollection().id() );
   return preferences->resourceColor( id );
 }
 
diff --git a/calendarviews/month/monthitem.cpp b/calendarviews/month/monthitem.cpp
index 1872617..364c1cd 100644
--- a/calendarviews/month/monthitem.cpp
+++ b/calendarviews/month/monthitem.cpp
@@ -629,13 +629,7 @@ QColor IncidenceMonthItem::bgColor() const
     if ( prefs->monthViewColors() == PrefsBase::MonthItemResourceOnly ||
          prefs->monthViewColors() == PrefsBase::MonthItemResourceInsideCategoryOutside ) {
 
-      const QString id = QString::number( akonadiItem().storageCollectionId() );
-      if ( id.isEmpty() ) {
-        // item got removed from calendar, give up.
-        return QColor();
-      }
-
-      bgColor = monthScene()->monthView()->preferences()->resourceColor( id );
+      bgColor = EventViews::resourceColor(akonadiItem(), prefs);
     } else {
       bgColor = catColor();
     }
@@ -658,10 +652,7 @@ QColor IncidenceMonthItem::frameColor() const
        ( mIncidence->categories().isEmpty() && prefs->monthViewColors() ==
          PrefsBase::MonthItemResourceInsideCategoryOutside ) ) {
     Q_ASSERT( mIncidence );
-    const QString id = QString::number( akonadiItem().storageCollectionId() );
-    if ( !id.isEmpty() ) {
-      frameColor = prefs->resourceColor( id );
-    }
+    frameColor = EventViews::resourceColor(akonadiItem(), prefs);
   } else {
     frameColor = catColor();
   }


commit 0b303702ab3fd190fdf69255bf7dcda28f2064a1
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Tue Sep 2 15:03:32 2014 +0200

    Use stoargeCollection to store an incidence and not parentCollection.

diff --git a/incidenceeditor-ng/editoritemmanager.cpp b/incidenceeditor-ng/editoritemmanager.cpp
index 0d57318..d0b54d6 100644
--- a/incidenceeditor-ng/editoritemmanager.cpp
+++ b/incidenceeditor-ng/editoritemmanager.cpp
@@ -332,7 +332,8 @@ void EditorItemManager::save()
     KCalCore::Incidence::Ptr incidence = CalendarSupport::incidence( d->mItem );
 
     KCalCore::Incidence::Ptr oldPayload = CalendarSupport::incidence( d->mPrevItem );
-    if ( d->mItem.parentCollection() == d->mItemUi->selectedCollection() ) {
+    if ( d->mItem.parentCollection() == d->mItemUi->selectedCollection()
+         || d->mItem.storageCollectionId() == d->mItemUi->selectedCollection().id()) {
       d->mChanger->modifyIncidence( d->mItem, oldPayload );
     } else {
       Q_ASSERT( d->mItemUi->selectedCollection().isValid() );
diff --git a/incidenceeditor-ng/incidencedialog.cpp b/incidenceeditor-ng/incidencedialog.cpp
index b8dec82..dc82880 100644
--- a/incidenceeditor-ng/incidencedialog.cpp
+++ b/incidenceeditor-ng/incidencedialog.cpp
@@ -564,8 +564,8 @@ void IncidenceDialogPrivate::load( const Akonadi::Item &item )
   kDebug() << "Loading item " << item.id() << "; parent " << item.parentCollection().id()
            << "; storage " << item.storageCollectionId();
 
-  if ( item.parentCollection().isValid() ) {
-    mCalSelector->setDefaultCollection( item.parentCollection() );
+  if ( item.storageCollectionId() > -1 ) {
+    mCalSelector->setDefaultCollection(Akonadi::Collection(item.storageCollectionId()));
   }
 
   if ( !mCalSelector->mimeTypeFilter().contains( "text/calendar" ) ||


commit 7de491375057142044a8e9fcc4991bcbf86661de
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Tue Sep 2 15:03:06 2014 +0200

    typo

diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 6149fb1..f2391e7 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -368,7 +368,7 @@ void CalendarView::onIdentitiesChanged()
         kDebug() <<  "We have to create a OpenIncidence virtual Collection";
     } else {
         Akonadi::PersistentSearchAttribute *attribute = mOpenInvitationCollection.attribute<Akonadi::PersistentSearchAttribute>( Akonadi::Entity::AddIfMissing );
-        Akonadi::EntityDisplayAttribute *displayname  = mDeclineCollection.attribute<Akonadi::EntityDisplayAttribute >( Akonadi::Entity::AddIfMissing );
+        Akonadi::EntityDisplayAttribute *displayname  = mOpenInvitationCollection.attribute<Akonadi::EntityDisplayAttribute >( Akonadi::Entity::AddIfMissing );
         attribute->setQueryString( QString::fromLatin1(query.toJSON()) );
         displayname->setDisplayName(i18nc("A collection of all open invidation", "open invitations"));
         Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( mOpenInvitationCollection, this );




More information about the commits mailing list