Skip to content

Commit

Permalink
[sociald] Remove useless synchronization timestamps. Contributes to J…
Browse files Browse the repository at this point in the history
…B#11198

This commit removes the storage of
useless synchronization timestamps
of downloaded elements (like a
Facebook post or image),
that was done in a database that was
managed by sociald.

Now, it is up to the sync process
to store the timestamps if they
need it.
  • Loading branch information
SfietKonstantin committed Oct 15, 2013
1 parent 2515a87 commit c48c69e
Show file tree
Hide file tree
Showing 15 changed files with 2 additions and 531 deletions.
7 changes: 0 additions & 7 deletions src/facebook/facebookcalendartypesyncadaptor.cpp
Expand Up @@ -93,13 +93,6 @@ void FacebookCalendarTypeSyncAdaptor::purgeDataForOldAccounts(const QList<int> &

storage->save();
storage->close();

foreach (int pid, oldIds) {
// purge all data from our database
removeAllData(QLatin1String("facebook"),
SyncService::dataType(SyncService::Calendars),
QString::number(pid));
}
}

void FacebookCalendarTypeSyncAdaptor::beginSync(int accountId, const QString &accessToken)
Expand Down
5 changes: 0 additions & 5 deletions src/facebook/facebookcontactsyncadaptor.cpp
Expand Up @@ -142,11 +142,6 @@ void FacebookContactSyncAdaptor::purgeDataForOldAccounts(const QList<int> &purge
foreach (int pid, purgeIds) {
// first, purge all data from QtContacts and also our cache db.
purgeAccount(pid);

// second, purge all data from the sociald database
removeAllData(QLatin1String("facebook"),
SyncService::dataType(SyncService::Contacts),
QString::number(pid));
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/facebook/facebookimagesyncadaptor.cpp
Expand Up @@ -58,11 +58,6 @@ void FacebookImageSyncAdaptor::purgeDataForOldAccounts(const QList<int> &purgeId
foreach (int pid, purgeIds) {
// first, purge the data from our database + our cache directory
m_db.purgeAccount(pid);

// second, purge all data from the sociald main database
removeAllData(QLatin1String("facebook"),
SyncService::dataType(SyncService::Images),
QString::number(pid));
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/facebook/facebooknotificationsyncadaptor.cpp
Expand Up @@ -27,11 +27,6 @@ FacebookNotificationSyncAdaptor::~FacebookNotificationSyncAdaptor()
void FacebookNotificationSyncAdaptor::purgeDataForOldAccounts(const QList<int> &purgeIds)
{
foreach (int accountId, purgeIds) {
// purge all data from our database
removeAllData(QLatin1String("facebook"),
SyncService::dataType(SyncService::Notifications),
QString::number(accountId));

// Search for the notification and close it
Notification *notification = 0;
QList<QObject *> notifications = Notification::notifications();
Expand Down
16 changes: 0 additions & 16 deletions src/facebook/facebookpostsyncadaptor.cpp
Expand Up @@ -279,8 +279,6 @@ void FacebookPostSyncAdaptor::finishedPostsHandler()
// name easier.
QMap<QString, QString> actorNames;
QJsonArray mainData;
QList<SyncedDatum> syncedData;

foreach (QJsonValue entry, data) {
QJsonObject entryObject = entry.toObject();
QString name = entryObject.value(QUERY_NAME_KEY).toString();
Expand Down Expand Up @@ -497,8 +495,6 @@ void FacebookPostSyncAdaptor::finishedPostsHandler()
allowLike, allowComment, clientId(), accountId);
}
}

markSyncedData(syncedData);
} else {
// error occurred during request.
TRACE(SOCIALD_ERROR,
Expand Down Expand Up @@ -556,15 +552,3 @@ bool FacebookPostSyncAdaptor::fromIsSelfContact(const QString &fromName, const Q
// not the self contact.
return false;
}

bool FacebookPostSyncAdaptor::haveAlreadyPostedEvent(const QString &postId, const QString &eventBody, const QDateTime &createdTime)
{
Q_UNUSED(eventBody);
Q_UNUSED(createdTime);

QDateTime syncedDatum = whenSyncedDatum(QLatin1String("facebook"), postId);



return (syncedDatum.isValid());
}
1 change: 0 additions & 1 deletion src/facebook/facebookpostsyncadaptor.h
Expand Up @@ -44,7 +44,6 @@ class FacebookPostSyncAdaptor : public FacebookDataTypeSyncAdaptor
private:
void requestMe(int accountId, const QString &accessToken);
void requestPosts(int accountId, const QString &accessToken);
bool haveAlreadyPostedEvent(const QString &postId, const QString &title, const QDateTime &createdTime);
bool fromIsSelfContact(const QString &fromName, const QString &fromFbUid) const;

private Q_SLOTS:
Expand Down
3 changes: 1 addition & 2 deletions src/google/google.pri
Expand Up @@ -12,8 +12,7 @@ HEADERS += \
$$PWD/googledatatypesyncadaptor.h \
$$PWD/googlecontactsyncadaptor.h \
$$PWD/googlecontactstream.h \
$$PWD/googlecontactatom.h \
$$PWD/googlecontactatom_global.h
$$PWD/googlecontactatom.h

OTHER_FILES += google_sync_profiles.files

Expand Down
5 changes: 0 additions & 5 deletions src/google/googlecontactsyncadaptor.cpp
Expand Up @@ -81,11 +81,6 @@ void GoogleContactSyncAdaptor::purgeDataForOldAccounts(const QList<int> &purgeId
foreach (int pid, purgeIds) {
// first, purge all data from QtContacts
purgeAccount(pid);

// second, purge all data from the sociald database
removeAllData(QLatin1String("google"),
SyncService::dataType(SyncService::Contacts),
QString::number(pid));
}
}

Expand Down

0 comments on commit c48c69e

Please sign in to comment.