[Kde-pim] note format
Patrick Ohly
patrick.ohly at gmx.de
Tue Mar 18 10:20:38 GMT 2014
On Tue, 2014-03-18 at 10:38 +0100, Patrick Ohly wrote:
> On Mon, 2014-03-17 at 15:35 +0100, Daniel Vrátil wrote:
> > On Monday 17 of March 2014 15:25:19 Christian Mollekopf wrote:
> > > On Monday 17 March 2014 14.42:48 Daniel Vrátil wrote:
> > > It seems indeed to be an alias according to kdepim-runtime 72b7c09d5, but
> > > IMO we should decide for one as i.e. the kolab resource now uses text/x-
> > > vnd.akonadi.note and application/x-vnd.akonadi.note while the notes
> > > resource uses application/x-vnd.kde.notes. IMO we should go with text/x-
> > > vnd.akonadi.note as specified in kdepimlibs/akonadi/notes/noteutils.h.
> >
> > +1 for vnd.akonadi.note
> >
> > However we can't just remove it, we can only make sure that all new items are
> > created with the new mime type.
>
> Won't that confuse apps which have not been updated yet?
>
> Suppose I have a collection containing application/x-vnd.kde.notes, with
> the corresponding KDE app only knowing about
> application/x-vnd.kde.notes. Won't it be problematic to create new
> application/x-vnd.akonadi.note items in the collection, if that's
> accepted by the collection at all?
>
> Note that I am speaking of the existing KDE + Akonadi here, as found on
> current distros, in combination with a SyncEvolution which tries to
> implement this migration to application/x-vnd.akonadi.note as the "real"
> type for notes.
>
> Regarding the current situation, why has this not caused problems
> before? Could it be that KDE's type (application/x-vnd.kde.notes) is the
> one that is really used in practice? Wouldn't it be better to deprecate
> application/x-vnd.akonadi.note if that's the case?
Because I am concerned about this, I tried to implement a different
approach: find collections containing either application/x-vnd.kde.notes
or application/x-vnd.akonadi.note. When creating a new item, check which
types the collection supports and use the first one of these, starting
with application/x-vnd.akonadi.note.
However, Collection::getContentMimeTypes() returns an empty list in this
code:
m_collection = Collection::fromUrl(KUrl(id.c_str()));
m_contentMimeType = "";
QStringList collectionMimeTypes = m_collection.contentMimeTypes();
foreach (const QString &mimeType, m_mimeTypes) {
if (collectionMimeTypes.contains(mimeType)) {
m_contentMimeType = mimeType;
break;
}
}
if (m_contentMimeType.isEmpty()) {
SE_THROW(StringPrintf("Resource %s cannot store items of type(s) %s. It can only store %s.",
id.c_str(),
m_mimeTypes.join(",").toUtf8().constData(),
collectionMimeTypes.join(",").toUtf8().constData()));
}
Why is that? The collection is found by a CollectionFetchJob with a
scope including the m_mimeTypes list, so the URL is right.
Akonadi is 1.11.0 (Debian Testing).
Bye, Patrick
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list