Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make QML code more declarative by using properties #2221

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

nicolasfella
Copy link
Contributor

By using properties and property bindings the QML code gets more declarative rather than imperative, which is considered better.

This patch:

  • Introduces a currentUserId property in UserModel that replaces the equivalent Q_INVOKABLE call
  • Introduces an avatar property in User that contains the avatar's image provider url without any fallback
  • Introduces new image provider urls for fallback images
  • Moves the fallback image selection to QML since we want different fallbacks according to where it is used
  • Wires up the necessary signals to propagate a changing avatar

Signed-off-by: Nicolas Fella [email protected]

@er-vin
Copy link
Member

er-vin commented Jul 21, 2020

/rebase

@er-vin er-vin added this to the 2.8 👥 Sharing features milestone Jul 21, 2020
@nicolasfella nicolasfella changed the title Make QML code more declarative by using properties [WIP] Make QML code more declarative by using properties Jul 21, 2020
@nicolasfella
Copy link
Contributor Author

Needs some care for when no accounts are availabe

@er-vin
Copy link
Member

er-vin commented Sep 14, 2020

Ping?

@nicolasfella nicolasfella changed the title [WIP] Make QML code more declarative by using properties Make QML code more declarative by using properties Oct 6, 2020
@er-vin
Copy link
Member

er-vin commented Oct 7, 2020

/rebase

Copy link
Member

@er-vin er-vin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work, just a bunch of nitpicks left really.

src/gui/tray/UserModel.cpp Outdated Show resolved Hide resolved
src/gui/tray/UserModel.cpp Outdated Show resolved Hide resolved
src/gui/tray/UserModel.cpp Outdated Show resolved Hide resolved
src/gui/tray/UserModel.cpp Outdated Show resolved Hide resolved
src/gui/tray/UserModel.cpp Outdated Show resolved Hide resolved
@er-vin
Copy link
Member

er-vin commented Oct 12, 2020

/rebase

By using properties and property bindings the QML code gets more declarative rather than imperative, which is considered better.

This patch:
- Introduces a currentUserId property in UserModel that replaces the equivalent Q_INVOKABLE call
- Introduces an avatar property in User that contains the avatar's image provider url without any fallback
- Introduces new image provider urls for fallback images
- Moves the fallback image selection to QML since we want different fallbacks according to where it is used
- Wires up the necessary signals to propagate a changing avatar

Signed-off-by: Nicolas Fella <[email protected]>
@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-2221-f5860928d9179d31e4226794ecb47af6440b1319-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@er-vin er-vin merged commit 142894b into nextcloud:master Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants