Branch 'kolab/integration/4.13.0' - 3 commits - korganizer/akonadicollectionview.cpp korganizer/calendarview.cpp korganizer/views
Christian Mollekopf
mollekopf at kolabsys.com
Wed Oct 15 11:16:27 CEST 2014
korganizer/akonadicollectionview.cpp | 4 ++
korganizer/calendarview.cpp | 4 +-
korganizer/views/collectionview/calendardelegate.cpp | 32 ++++++++++---------
3 files changed, 24 insertions(+), 16 deletions(-)
New commits:
commit 74336afaa5d09cff9cd8404bf61c942f8563f4a5
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date: Wed Oct 15 11:16:15 2014 +0200
Proper name for invitation folders.
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f2391e7..0815eb9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -370,7 +370,7 @@ void CalendarView::onIdentitiesChanged()
Akonadi::PersistentSearchAttribute *attribute = mOpenInvitationCollection.attribute<Akonadi::PersistentSearchAttribute>( 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"));
+ displayname->setDisplayName(i18nc("A collection of all open invidations.", "Open Invitations"));
Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( mOpenInvitationCollection, this );
connect( job, SIGNAL(result(KJob*)), this, SLOT(modifyResult(KJob*)) );
kDebug() << "updating OpenIncidence (" << mOpenInvitationCollection.id() << ") virtual Collection";
@@ -395,7 +395,7 @@ void CalendarView::onIdentitiesChanged()
Akonadi::EntityDisplayAttribute *displayname = mDeclineCollection.attribute<Akonadi::EntityDisplayAttribute >( Akonadi::Entity::AddIfMissing );
persistentsearch->setQueryString( QString::fromLatin1(query.toJSON()) );
- displayname->setDisplayName(i18nc("A collection of all declined invidation", "decliend invitations"));
+ displayname->setDisplayName(i18nc("A collection of all declined invidations.", "Declined Invitations"));
Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( mDeclineCollection, this );
connect( job, SIGNAL(result(KJob*)), this, SLOT(modifyResult(KJob*)) );
kDebug() << "updating DeclinedIncidence(" << mDeclineCollection.id() << ") virtual Collection";
commit fb5746955d006077ee0ce1ce72b8e76bd607d132
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date: Wed Oct 15 11:15:52 2014 +0200
CalendarSelection: Only show the quickview button on the search collections.
diff --git a/korganizer/views/collectionview/calendardelegate.cpp b/korganizer/views/collectionview/calendardelegate.cpp
index e5d9eda..087885d 100644
--- a/korganizer/views/collectionview/calendardelegate.cpp
+++ b/korganizer/views/collectionview/calendardelegate.cpp
@@ -101,26 +101,30 @@ QList<StyledCalendarDelegate::Action> StyledCalendarDelegate::getActions(const Q
const Akonadi::Collection col = CalendarSupport::collectionFromIndex(index);
Qt::CheckState enabled = static_cast<Qt::CheckState>(index.data(EnabledRole).toInt());
// kDebug() << index.data().toString() << enabled;
+ const bool isSearchCollection = col.resource().startsWith(QLatin1String("akonadi_search_resource"));
+ const bool isToplevelSearchCollection = (col.id() == 1);
QList<Action> buttons;
- if (isSearchResult) {
- buttons << AddToList;
- } else {
- if (hover) {
- if (enabled != Qt::Checked) {
- buttons << Enable;
- }
- //The remove button should not be available for person subfolders
- if (!isChildOfPersonCollection(index)) {
- buttons << RemoveFromList;
- }
+ if (!isSearchCollection) {
+ if (isSearchResult) {
+ buttons << AddToList;
} else {
- if (enabled == Qt::Checked) {
- buttons << Enable;
+ if (hover) {
+ if (enabled != Qt::Checked) {
+ buttons << Enable;
+ }
+ //The remove button should not be available for person subfolders
+ if (!isChildOfPersonCollection(index)) {
+ buttons << RemoveFromList;
+ }
+ } else {
+ if (enabled == Qt::Checked) {
+ buttons << Enable;
+ }
}
}
}
- if (isPersonNode(index)) {
+ if (isPersonNode(index) || (isSearchCollection && !isToplevelSearchCollection)) {
buttons << Quickview;
}
return buttons;
commit 38e28fd12decc0ded373794fee25bea526b4b25d
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date: Wed Oct 15 11:06:58 2014 +0200
CalendarSelection: Sort search folders at the end.
diff --git a/korganizer/akonadicollectionview.cpp b/korganizer/akonadicollectionview.cpp
index 6eb2908..503300e 100644
--- a/korganizer/akonadicollectionview.cpp
+++ b/korganizer/akonadicollectionview.cpp
@@ -269,6 +269,10 @@ class SortProxyModel : public QSortFilterProxyModel
if (index.data(IsSearchResultRole).toBool()) {
score += 2;
}
+ //Search collection
+ if (index.data(Akonadi::EntityTreeModel::CollectionIdRole).toLongLong() == 1) {
+ score += 3;
+ }
return score;
}
More information about the commits
mailing list