Merge lp:~mzanetti/telegram-app/avatar-spinner into lp:telegram-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Karnicki
Approved revision: 162
Merged at revision: 159
Proposed branch: lp:~mzanetti/telegram-app/avatar-spinner
Merge into: lp:telegram-app
Diff against target: 30 lines (+6/-0)
1 file modified
telegram/app/qml/ClickableContactImage.qml (+6/-0)
To merge this branch: bzr merge lp:~mzanetti/telegram-app/avatar-spinner
Reviewer Review Type Date Requested Status
Michał Karnicki (community) Approve
Review via email: mp+287868@code.launchpad.net

Commit message

don't start the spinner if we don't have anything to fetch

Description of the change

This is a "fix" for the issue that victor found in QA today.

The issue was that when clicking the avatar of some contact details page (or the settings page), the app tries to load the big image from the network and displays a spinner for that. Now the problem was, that this was triggered even when there is no profile picture, in which case the spinner just keeps on spinning forever. In the account settings page, this even suggests that it would try to open content hub for importing a picture and keeps the user waiting forever.

We could probably improve this and actually open the content hub, however, this component is used also when you view another contact's details in which case we can't set the image so it's not 100% straight forward. This patch at least doesn't start the spinner if we don't have anything to fetch from the network and doesn't keep the user waiting.

Importing a new avatar is, after all, done from the toolbar icon for that.

To post a comment you must log in.
Revision history for this message
Michał Karnicki (karni) wrote :

Thank you :D

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'telegram/app/qml/ClickableContactImage.qml'
--- telegram/app/qml/ClickableContactImage.qml 2015-09-22 09:57:07 +0000
+++ telegram/app/qml/ClickableContactImage.qml 2016-03-03 00:56:34 +0000
@@ -8,6 +8,7 @@
8 height: 628 height: 62
99
10 property FileLocation photoBigLocation: isChat ? chat.photo.photoBig : user.photo.photoBig10 property FileLocation photoBigLocation: isChat ? chat.photo.photoBig : user.photo.photoBig
11 property FileLocation photoSmallLocation: isChat ? chat.photo.photoSmall : user.photo.photoSmall
1112
12 signal clicked(string path)13 signal clicked(string path)
1314
@@ -32,6 +33,10 @@
32 cursorShape: Qt.PointingHandCursor33 cursorShape: Qt.PointingHandCursor
33 visible: user.id != telegram.cutegramId34 visible: user.id != telegram.cutegramId
34 onClicked: {35 onClicked: {
36 if (smallFilePath.length == 0) {
37 return;
38 }
39
35 if(filePath.length == 0) {40 if(filePath.length == 0) {
36 loadingPhoto = true41 loadingPhoto = true
37 telegram.getFile(photoBigLocation)42 telegram.getFile(photoBigLocation)
@@ -42,6 +47,7 @@
4247
43 property bool loadingPhoto: false48 property bool loadingPhoto: false
44 property string filePath: photoBigLocation.download.location49 property string filePath: photoBigLocation.download.location
50 property string smallFilePath: photoSmallLocation.download.location
4551
46 onFilePathChanged: {52 onFilePathChanged: {
47 if(!loadingPhoto)53 if(!loadingPhoto)

Subscribers

People subscribed via source and target branches

to status/vote changes: