As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 851275 - show size on disk for newsgroup folders
: show size on disk for newsgroup folders
Product: MailNews Core
Classification: Components
Component: Networking: NNTP (show other bugs)
: Trunk
: All All
: -- minor (vote)
: Thunderbird 23.0
Assigned To: :aceman
Depends on:
  Show dependency treegraph
Reported: 2013-03-14 13:27 PDT by :aceman
Modified: 2013-04-15 10:09 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

patch (1.41 KB, patch)
2013-03-14 13:33 PDT, :aceman
Pidgeot18: review-
Details | Diff | Splinter Review
patch v2 (10.30 KB, patch)
2013-03-22 10:35 PDT, :aceman
no flags Details | Diff | Splinter Review
patch v3 (10.23 KB, patch)
2013-04-05 11:22 PDT, :aceman
Pidgeot18: review+
Details | Diff | Splinter Review
patch v4 (10.25 KB, patch)
2013-04-15 10:00 PDT, :aceman
acelists: review+
Details | Diff | Splinter Review

Description User image :aceman 2013-03-14 13:27:59 PDT
nsMsgNewsFolder::GetSizeOnDisk is not implemented so newsgroup folders show "unknown" size in the folder properties.
Comment 1 User image :aceman 2013-03-14 13:33:59 PDT
Created attachment 725083 [details] [diff] [review]

So this is a crude patch to get the size directly from the file holding the folder. Is that acceptable/fast enough? Other folder types maintain a mFolderSize variable and change the value when operations are done on the folder. I am not sure that is needed here too.
Comment 2 User image Joshua Cranmer [:jcranmer] 2013-03-21 15:53:36 PDT
Comment on attachment 725083 [details] [diff] [review]

Review of attachment 725083 [details] [diff] [review]:

This code isn't quite right--it should be caching the value in mFolderSize and using that. See nsLocalMailFolder for what that implementation looks like.
Comment 3 User image :aceman 2013-03-22 10:35:52 PDT
Created attachment 728304 [details] [diff] [review]
patch v2

OK, something like this?
Comment 4 User image Joshua Cranmer [:jcranmer] 2013-04-04 20:42:05 PDT
This patch doesn't apply cleanly?
Comment 5 User image :aceman 2013-04-05 11:22:56 PDT
Created attachment 733955 [details] [diff] [review]
patch v3

Does not any longer. Try this.
Comment 6 User image Joshua Cranmer [:jcranmer] 2013-04-14 13:26:16 PDT
Comment on attachment 733955 [details] [diff] [review]
patch v3

Review of attachment 733955 [details] [diff] [review]:

::: mailnews/news/src/nsNewsFolder.cpp
@@ +829,5 @@
> +
> +  // 0 is a valid folder size (meaning empty file with no offline messages),
> +  // but 1 is not. So use 1 as a special value meaning no file size was fetched
> +  // from disk yet.
> +  if (mFolderSize == kSizeUnknown) {

The brace style here is supposed to be:
if ()
Comment 7 User image :aceman 2013-04-15 10:00:56 PDT
Created attachment 737552 [details] [diff] [review]
patch v4

OK, thanks.
Comment 8 User image Ryan VanderMeulen [:RyanVM] 2013-04-15 10:09:47 PDT

Note You need to log in before you can comment on or make changes to this bug.