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

Small re-factoring of DocumentProperties #5201

Merged
merged 1 commit into from
Aug 16, 2014
Merged

Small re-factoring of DocumentProperties #5201

merged 1 commit into from
Aug 16, 2014

Conversation

Snuffleupagus
Copy link
Collaborator

With the changes made in PR #5169 to enable quicker display of the File size, setFileSize() can now be called during file loading. This function parses and localizes the file size, where the l10n is a synchronous operation.
This patch:

  • Re-factors setFileSize() to only update rawFileSize, and moves parsing and fetching of the l10n string to a separate method that isn't called until the Document Properties dialog is actually opened.
  • Adds a couple of checks to make sure that rawFileSize is set to a positive number.
  • Removes the fileName and fileSize properties. Since they are parsed every time the Document Properties dialog is opened, it doesn't seem necessary to cache them.

/cc @timvandermeij Can you please review this?

With the changes made in PR 5169 to enable quicker display of the File size, `setFileSize()` can now be called during file loading. This function parses *and* localizes the file size, where the l10n is a synchronous operation.
This patch:
* Re-factors `setFileSize()` to *only* update `rawFileSize`, and moves parsing and fetching of the l10n string to a separate method that isn't called until the Document Properties dialog is actually opened.

* Adds a couple of checks to make sure that `rawFileSize` is set to a positive number.

* Removes the `fileName` and `fileSize` properties. Since they are parsed every time the Document Properties dialog is opened, it doesn't seem necessary to cache them.
@Snuffleupagus
Copy link
Collaborator Author

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/186dc6f75324051/output.txt

yurydelendik added a commit that referenced this pull request Aug 16, 2014
@yurydelendik yurydelendik merged commit b06dc8d into mozilla:master Aug 16, 2014
@yurydelendik
Copy link
Contributor

Thank you

@Snuffleupagus Snuffleupagus deleted the DocumentProperties-refactor branch August 16, 2014 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants