Commit 51244877 authored by Shashwat Jolly's avatar Shashwat Jolly
Browse files

Don't set metadata type for new items and collections

EteSync only requires collection types to be set. Metadata types in items and collections are not required.
parent 367a6c60
...@@ -32,11 +32,6 @@ void etebase_fetch_options_set_stoken(EtebaseFetchOptions *fetch_options, const ...@@ -32,11 +32,6 @@ void etebase_fetch_options_set_stoken(EtebaseFetchOptions *fetch_options, const
etebase_fetch_options_set_stoken(fetch_options, charArrFromQString(stoken)); etebase_fetch_options_set_stoken(fetch_options, charArrFromQString(stoken));
} }
void etebase_item_metadata_set_item_type(EtebaseItemMetadata *meta_data, const QString &item_type)
{
etebase_item_metadata_set_item_type(meta_data, charArrFromQString(item_type));
}
void etebase_item_metadata_set_color(EtebaseItemMetadata *meta_data, const QString &color) void etebase_item_metadata_set_color(EtebaseItemMetadata *meta_data, const QString &color)
{ {
etebase_item_metadata_set_color(meta_data, charArrFromQString(color)); etebase_item_metadata_set_color(meta_data, charArrFromQString(color));
......
...@@ -110,8 +110,6 @@ EtebaseAccountPtr etebase_account_login(const EtebaseClient *client, const QStri ...@@ -110,8 +110,6 @@ EtebaseAccountPtr etebase_account_login(const EtebaseClient *client, const QStri
void etebase_fetch_options_set_stoken(EtebaseFetchOptions *fetch_options, const QString &stoken); void etebase_fetch_options_set_stoken(EtebaseFetchOptions *fetch_options, const QString &stoken);
void etebase_item_metadata_set_item_type(EtebaseItemMetadata *meta_data, const QString &item_type);
void etebase_item_metadata_set_color(EtebaseItemMetadata *meta_data, const QString &color); void etebase_item_metadata_set_color(EtebaseItemMetadata *meta_data, const QString &color);
void etebase_item_metadata_set_name(EtebaseItemMetadata *meta_data, const QString &name); void etebase_item_metadata_set_name(EtebaseItemMetadata *meta_data, const QString &name);
......
...@@ -389,7 +389,6 @@ void EteSyncResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collec ...@@ -389,7 +389,6 @@ void EteSyncResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collec
// Create metadata // Create metadata
int64_t modificationTimeSinceEpoch = QDateTime::currentMSecsSinceEpoch(); int64_t modificationTimeSinceEpoch = QDateTime::currentMSecsSinceEpoch();
EtebaseItemMetadataPtr itemMetaData(etebase_item_metadata_new()); EtebaseItemMetadataPtr itemMetaData(etebase_item_metadata_new());
etebase_item_metadata_set_item_type(itemMetaData.get(), "file");
QString uid; QString uid;
if (type == ETEBASE_COLLECTION_TYPE_ADDRESS_BOOK) { if (type == ETEBASE_COLLECTION_TYPE_ADDRESS_BOOK) {
uid = item.payload<KContacts::Addressee>().uid(); uid = item.payload<KContacts::Addressee>().uid();
...@@ -572,7 +571,6 @@ void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, con ...@@ -572,7 +571,6 @@ void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, con
int64_t modificationTimeSinceEpoch = QDateTime::currentMSecsSinceEpoch(); int64_t modificationTimeSinceEpoch = QDateTime::currentMSecsSinceEpoch();
const QString type = getEtebaseTypeForCollection(collection); const QString type = getEtebaseTypeForCollection(collection);
EtebaseItemMetadataPtr collectionMetaData(etebase_item_metadata_new()); EtebaseItemMetadataPtr collectionMetaData(etebase_item_metadata_new());
etebase_item_metadata_set_item_type(collectionMetaData.get(), type);
etebase_item_metadata_set_name(collectionMetaData.get(), collection.displayName()); etebase_item_metadata_set_name(collectionMetaData.get(), collection.displayName());
etebase_item_metadata_set_color(collectionMetaData.get(), ETESYNC_DEFAULT_COLLECTION_COLOR); etebase_item_metadata_set_color(collectionMetaData.get(), ETESYNC_DEFAULT_COLLECTION_COLOR);
etebase_item_metadata_set_mtime(collectionMetaData.get(), &modificationTimeSinceEpoch); etebase_item_metadata_set_mtime(collectionMetaData.get(), &modificationTimeSinceEpoch);
......
...@@ -77,7 +77,6 @@ void LoginJob::createDefaultCollection(const QString &collectionType, const QStr ...@@ -77,7 +77,6 @@ void LoginJob::createDefaultCollection(const QString &collectionType, const QStr
// Create metadata // Create metadata
int64_t modificationTimeSinceEpoch = QDateTime::currentMSecsSinceEpoch(); int64_t modificationTimeSinceEpoch = QDateTime::currentMSecsSinceEpoch();
EtebaseItemMetadataPtr collectionMetaData(etebase_item_metadata_new()); EtebaseItemMetadataPtr collectionMetaData(etebase_item_metadata_new());
etebase_item_metadata_set_item_type(collectionMetaData.get(), collectionType);
etebase_item_metadata_set_name(collectionMetaData.get(), collectionName); etebase_item_metadata_set_name(collectionMetaData.get(), collectionName);
etebase_item_metadata_set_color(collectionMetaData.get(), ETESYNC_DEFAULT_COLLECTION_COLOR); etebase_item_metadata_set_color(collectionMetaData.get(), ETESYNC_DEFAULT_COLLECTION_COLOR);
etebase_item_metadata_set_mtime(collectionMetaData.get(), &modificationTimeSinceEpoch); etebase_item_metadata_set_mtime(collectionMetaData.get(), &modificationTimeSinceEpoch);
......
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