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

Fix compiler warnings

- Declare unused parameters
- Fix comparison of signed and unsigned ints
parent 64f31f0e
......@@ -85,8 +85,8 @@ void EntriesFetchJob::fetchEntries()
qCDebug(ETESYNC_LOG) << "Retrieved item list length" << dataLength;
const EtebaseItem *etesyncItems[dataLength];
if (etebase_item_list_response_get_data(itemList.get(), etesyncItems)) {
std::vector<const EtebaseItem *> etesyncItems(dataLength, nullptr);
if (etebase_item_list_response_get_data(itemList.get(), etesyncItems.data())) {
setError(int(etebase_error_get_code()));
const char *err = etebase_error_get_message();
setErrorText(QString::fromUtf8(err));
......@@ -94,7 +94,7 @@ void EntriesFetchJob::fetchEntries()
Item item;
for (int i = 0; i < dataLength; i++) {
for (uintptr_t i = 0; i < dataLength; i++) {
saveEtebaseItemCache(itemManager.get(), etesyncItems[i], mCacheDir);
setupItem(item, etesyncItems[i], type);
}
......
......@@ -442,6 +442,8 @@ void EteSyncResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collec
void EteSyncResource::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{
Q_UNUSED(parts)
qCDebug(ETESYNC_LOG) << "Item changed" << item.mimeType() << item.remoteId();
qCDebug(ETESYNC_LOG) << "Journal UID" << item.parentCollection().remoteId();
......@@ -560,6 +562,8 @@ void EteSyncResource::itemRemoved(const Akonadi::Item &item)
void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent)
{
Q_UNUSED(parent)
qCDebug(ETESYNC_LOG) << "Collection added" << collection.mimeType();
if (credentialsRequired()) {
......
......@@ -73,8 +73,8 @@ void JournalsFetchJob::fetchJournals()
qCDebug(ETESYNC_LOG) << "Retrieved collection list length" << dataLength;
const EtebaseCollection *etesyncCollections[dataLength];
if (etebase_collection_list_response_get_data(collectionList.get(), etesyncCollections)) {
std::vector<const EtebaseCollection *> etesyncCollections(dataLength, nullptr);
if (etebase_collection_list_response_get_data(collectionList.get(), etesyncCollections.data())) {
setError(int(etebase_error_get_code()));
const char *err = etebase_error_get_message();
setErrorText(QString::fromUtf8(err));
......@@ -82,20 +82,20 @@ void JournalsFetchJob::fetchJournals()
Collection collection;
for (int i = 0; i < dataLength; i++) {
for (uintptr_t i = 0; i < dataLength; i++) {
saveEtebaseCollectionCache(collectionManager.get(), etesyncCollections[i], mCacheDir);
setupCollection(collection, etesyncCollections[i]);
}
int removedCollectionsLength = etebase_collection_list_response_get_removed_memberships_length(collectionList.get());
uintptr_t removedCollectionsLength = etebase_collection_list_response_get_removed_memberships_length(collectionList.get());
if (removedCollectionsLength) {
const EtebaseRemovedCollection *removedEtesyncCollections[removedCollectionsLength];
if (etebase_collection_list_response_get_removed_memberships(collectionList.get(), removedEtesyncCollections)) {
std::vector<const EtebaseRemovedCollection *> removedEtesyncCollections(removedCollectionsLength, nullptr);
if (etebase_collection_list_response_get_removed_memberships(collectionList.get(), removedEtesyncCollections.data())) {
setError(int(etebase_error_get_code()));
const char *err = etebase_error_get_message();
setErrorText(QString::fromUtf8(err));
}
for (int i = 0; i < removedCollectionsLength; i++) {
for (uintptr_t i = 0; i < removedCollectionsLength; i++) {
Collection collection;
const QString journalUid = QString::fromUtf8(etebase_removed_collection_get_uid(removedEtesyncCollections[i]));
collection.setRemoteId(journalUid);
......
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