Commit 0da5a6e3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Get current calendar

parent e18dd3f3
......@@ -737,6 +737,14 @@ void AkonadiCollectionView::slotServerSideSubscription()
job->start();
}
Akonadi::Collection AkonadiCollectionView::currentCalendar() const
{
const QModelIndex index = mCollectionView->selectionModel()->currentIndex(); //selectedRows()
Q_ASSERT(index.isValid());
Akonadi::Collection collection = CalendarSupport::collectionFromIndex(index);
return collection;
}
void AkonadiCollectionView::setDefaultCalendar()
{
QModelIndex index = mCollectionView->selectionModel()->currentIndex(); //selectedRows()
......
......@@ -85,6 +85,7 @@ public:
Akonadi::Collection selectedCollection() const;
Akonadi::Collection::List checkedCollections() const;
bool isChecked(const Akonadi::Collection &) const;
Akonadi::Collection currentCalendar() const;
public Q_SLOTS:
void edit_disable();
void edit_enable();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment