1 /*
2     SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org>
3 
4     SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "collectioninternalspage.h"
8 
9 #include <Akonadi/Collection>
10 using namespace Akonadi;
11 
CollectionInternalsPage(QWidget * parent)12 CollectionInternalsPage::CollectionInternalsPage(QWidget *parent)
13     : CollectionPropertiesPage(parent)
14 {
15     setPageTitle(QStringLiteral("Internals"));
16     ui.setupUi(this);
17 }
18 
load(const Akonadi::Collection & col)19 void CollectionInternalsPage::load(const Akonadi::Collection &col)
20 {
21     ui.idLabel->setText(QString::number(col.id()));
22     ui.ridEdit->setText(col.remoteId());
23     ui.rrevEdit->setText(col.remoteRevision());
24     ui.resourceLabel->setText(col.resource());
25     ui.contentTypes->setItems(col.contentMimeTypes());
26     ui.virtCheck->setChecked(col.isVirtual());
27 }
28 
save(Akonadi::Collection & col)29 void CollectionInternalsPage::save(Akonadi::Collection &col)
30 {
31     col.setRemoteId(ui.ridEdit->text());
32     col.setRemoteRevision(ui.rrevEdit->text());
33     col.setContentMimeTypes(ui.contentTypes->items());
34     col.setVirtual(ui.virtCheck->isChecked());
35 }
36