[Bug 20034] Avatar cache reference implementation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Sep 7 15:22:50 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=20034

--- Comment #6 from Andre Moreira Magalhaes <andrunko at gmail.com> 2010-09-07 06:22:50 PDT ---
So here it goes another round:


+        realFeatures.insert (Contact::FeatureAvatarToken);
Extra space

+        connection->cmName() +QDir::separator() + connection->protocolName();
Missing space after '+'
Also just use "/" instead of QDir::separator() as we are already using "/"
everywhere.

+    if (createDir && !QDir().mkpath(path))
+        return false;
Missing {}

+ 
mPriv->connection->avatarsInterface()->RequestAvatars(mPriv->requestAvatarsQueue);
This code is sync, change it to use QDBusPendingCallWatcher.

+void ContactManager::requestContactAvatar(Contact *contact)
Make this private to ContactManager and use ContactPtr instead of Contact*

+AvatarData Contact::avatarData() const
+{
+    if (!mPriv->requestedFeatures.contains(FeatureAvatarData)) {
+        warning() << "Contact::avatarFile() used on" << this
The warning should use Contact::avatarData instead

+                if
(manager()->supportedFeatures().contains(FeatureAvatarData)) {
+                    mPriv->actualFeatures.insert(FeatureAvatarData);
+                }
+                mPriv->updateAvatarData();
The call to updateAvatarData should be inside the if clause.

I think that buildAvatarFileName should not create the dir itself, as the name
suggests it will only build the fileName, move the code to create the dirs
outside or rename the method.

I would also sed s/AvatarData/AvatarInfo/g as we don't have the
"data/bytearray" there, instead we have the info to where the avatar is located
and the mimetype.

Other than that, try using QLatin1String over QString::fromLatin1

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list