Closed
Bug 95122
Opened 24 years ago
Closed 23 years ago
Preference for Simple MAPI
Categories
(MailNews Core :: Simple MAPI, defect, P1)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: tiantian, Assigned: srilatha)
References
Details
(Whiteboard: [PDT+],[ETA 10.04] [Checked into 094 branch])
Attachments
(7 files, 14 obsolete files)
45.60 KB,
image/gif
|
Details | |
10.79 KB,
text/plain
|
Details | |
55.05 KB,
patch
|
Details | Diff | Splinter Review | |
2.70 KB,
text/plain
|
Details | |
56.53 KB,
patch
|
ssu0262
:
review+
mscott
:
superreview+
|
Details | Diff | Splinter Review |
4.85 KB,
patch
|
curt
:
review+
dveditz
:
superreview+
|
Details | Diff | Splinter Review |
4.80 KB,
patch
|
curt
:
review+
dveditz
:
superreview+
|
Details | Diff | Splinter Review |
This is to track the implementation for preference in Simple MAPI.
Two new UI need to be added.
(1) allow user to select NS as their default mail news client when starting NS.
(2) allow user to set a preference to select NS as their default mail news client.
Reporter | ||
Updated•24 years ago
|
mass qa assigning all simple MAPI bugs to olgac
QA Contact: hong → olgac
Updated•24 years ago
|
Keywords: nsenterprise → nsenterprise+
Reporter | ||
Comment 3•23 years ago
|
||
nsbranch+
Assignee | ||
Comment 4•23 years ago
|
||
Assignee | ||
Comment 5•23 years ago
|
||
This patch includes the patch from 98566 plus the implementation of nsIMapiRegistry.
Reporter | ||
Updated•23 years ago
|
Whiteboard: pdt
Reporter | ||
Comment 6•23 years ago
|
||
Added PDT status, per PDT meeting today. Once we got all r and sr, will change
it into PDT+.
All r ans sr, please try your best to give comments within 24 hours. If no
reply, then our assumption will be within 24 hours. If you cannot do it within
24 hours, please attend the PDT meeting at 12 noon on 9/18 at the pit of bldg 21
to explain why. Many thanks.
=======================
Subject: Urgent: your review and super review comments.
Date: Mon, 17 Sep 2001 13:18:36 -0700
From: Tiantian Kong <tiantiankong8@netscape.com>
Reply-To: tiantiankong8@netscape.com
To: sspitzer@netscape.com, dveditz@netscape.com, Doug Turner <dougt@netscape.com>, law@netscape.com, alecf@netscape.com,
Rajiv Dayal <rdayal@netscape.com>
CC: Elaine King <elaineking@netscape.com>
Hi:
You got this mail because you are the r or sr of features in simple MAPI.
Pathes for these has been up on the bug.
On behalf on PDT, I'm requesting that you provide immediate feeback. If you
cannot be back to us today, please reply by
email, and cc Elaine King, as to when you'll be able to get back to us.
This is an urgent request, please drop everything else that you are doing.
Thx. Elaine will be calling each of you as well.
Rajiv, r, Pref, 95122
Seth, sr, Pref, 95122
Dan Veditz, r log on, log off, 95117/95121
Doug Turner, sr, log on, log off, 95117/95121
Bill Law, r xpfe/bootstrap for log on, off
Alec, sr, xpfe/bootstrap for log on, off
Tiantian
=========================
Comment 7•23 years ago
|
||
working with srilatha over aim (9/17)
Whiteboard: pdt → pdt / working with srilatha over aim (9/17)
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
Comment 10•23 years ago
|
||
looks good. sr=sspitzer on
http://bugzilla.mozilla.org/attachment.cgi?id=49709&action=view
srilatha, can you log a new bug for the new profile problem (where it puts up
two dialogs at once)? I think we can live with it for now, but we should log a
bug convering it and see what jglick recommends. (either we'll reverse the
oder of the dialogs, or fix
I'm still think we're going to have add another contents.rdf ns/mailnews/mapi,
since the commercial build will stomp on your mapi specific contents.rdf, but
since srilatha tested her commercial build and it worked, we should just wait
and see.
Comment 11•23 years ago
|
||
this patch is not ready for the branch yet. in addition to baking on the
trunk, we shouldn't land this stuff on the branch until the rest of the mapi is
ready and landed on the trunk first.
Whiteboard: pdt / working with srilatha over aim (9/17) → pdt / working with srilatha over aim (9/17), ready for trunk, not branch
Comment 12•23 years ago
|
||
if we're worried about localization, we can land some of the changes (like the
new .dtd and properies files) on the branch, once you've got PDT+.
but I wouldn't land any changes that show up in the UI on the branch (like the
change to prefs) until the mapi code is also landed on the branch.
Comment 13•23 years ago
|
||
I'd like to second Seth's comments. This needs to land on the trunk and baked
before we can move it to the branch. modulo landing the property and dtd changes.
Reporter | ||
Comment 14•23 years ago
|
||
Hi, Seth and Srilatha:
Thanks for asking me to confirm that you can check in the UI which has got r and
sr.
I just called Steve Elmer, and described about the UI patch. He said it's fine
to check in.
You have PDT+ for this patch. Thx.
Assignee | ||
Comment 15•23 years ago
|
||
Checked in the attachment 49709 [details] [diff] [review] into the trunk and the branch.
Comment 16•23 years ago
|
||
srilatha, you need to add default pref value for your new pref,
system.windows.lock_ui.defaultMailClient
without a default, showMailIntegrationDialog() and mailnewsOverlayInit() will
not behave as expected since getBoolPref() will throw an exception.
I was going to suggest adding the pref to mailnews.js, but perhaps winpref.js
is better, since this is windows only.
Comment 17•23 years ago
|
||
"will throw an exception", let me elaborate. you've wrapped the call to
getBoolPref() with a try / catch, so you won't fail with an exception, but that
exception (if the pref branch code throws and exception like the pref code
does) will cause you to skip over some code in showMailIntegrationDialog() and
mailnewsOverlayInit() you want to execute.
Comment 18•23 years ago
|
||
on my trunk build with your patch, I get a js error when I got to the mailnews
pref panel:
JavaScript error:
chrome://messenger/content/pref-mailnewsOverlay.js line 23: parent.hPrefWindow
as no properties
Assignee | ||
Comment 19•23 years ago
|
||
I am not seeing this error in my build. but when if I go to a different pane and
click on OK i get the following error.
JavaScript error:
chrome://messenger/content/pref-mailnewsOverlay.js line 64: mapiRegistry is not
defined
I will attach a patch for this right away and also with the pref.
Assignee | ||
Comment 20•23 years ago
|
||
Assignee | ||
Comment 21•23 years ago
|
||
Seth, please review the patch
Comment 22•23 years ago
|
||
Note that our pref naming style is supposed to be
all_lowercase.separated.by_underbars (I know, hard to tell from the junk that's
in there these days).
Assignee | ||
Comment 23•23 years ago
|
||
Comment 24•23 years ago
|
||
Comment on attachment 49751 [details] [diff] [review]
updated the patch with new pref name
sr=sspitzer
Attachment #49751 -
Flags: superreview+
Comment 25•23 years ago
|
||
hmmm...me thinks this really should have landed on the trunk for flushing out
first =).
Assignee | ||
Comment 26•23 years ago
|
||
Comment 27•23 years ago
|
||
in that last patch, in mailnewsOverlayInit(), I think you can move more code
into the if (mapiRegistry) block.
Comment 28•23 years ago
|
||
ignore that last comment. srilatha is right, she can't move it.
sr=sspitzer
Assignee | ||
Comment 29•23 years ago
|
||
latest patch checked into the trunk.
Comment 30•23 years ago
|
||
since the original patch went on the branch, we should land the latest patch.
other wise the branch will have the same JS error that the trunk had.
Whiteboard: pdt / working with srilatha over aim (9/17), ready for trunk, not branch → pdt
Comment 31•23 years ago
|
||
"since the original patch went on the branch, we should land the latest patch on
the branch also."
the alternative is to back out the original patch from the branch.
it's PDTs call.
Assignee | ||
Updated•23 years ago
|
Attachment #49805 -
Flags: superreview+
Reporter | ||
Comment 32•23 years ago
|
||
Comment on attachment 49805 [details] [diff] [review]
patch with updated contents.rdf
r=rdayal. reviewed this part (UI) in bug # 98566.
some more testing with only these changes to a fresh build would help though.
Attachment #49805 -
Flags: review+
Comment 33•23 years ago
|
||
tested the latest patch on a mozilla debug build today. able to verify that:
- all preferences in pref panel work properly
- mail/news launches, reads & sends, & exits properly
- composer launches, interacts, & exits properly- address book, launches,
interacts, & exits properly
- switching from multiple panel displays work
- buttons, checkboxes, text boxes, radio buttons, & scroll bars work properly
- correctly writing to prefs.js
will take a look at the latest trunk build tomorrow to continue the
verification. assuming the fix is in it
Comment 34•23 years ago
|
||
Check in the DTDs for L10n translations. Once the backend is ready, we can
consider taking the whole fix.
Whiteboard: pdt → PDT+
Comment 35•23 years ago
|
||
The UI and strings for localization has already been checked in. The patch for
it had r and sr and have PDT + too.
Comment 36•23 years ago
|
||
Where is this feature documented? For instance, if I want to use Outlook or
Outlook Express instead, how do I manage that?
My guess would be that I'd disable Mozilla's MAPI preference for EMail and/or
News, then load the other program and hope it prompted to configure itself as
the new default.
Assignee | ||
Updated•23 years ago
|
Attachment #49558 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #49700 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #49709 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #49735 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #49751 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #49805 -
Attachment is obsolete: true
Assignee | ||
Comment 37•23 years ago
|
||
Comment 38•23 years ago
|
||
just a quick comment - I think you need to use the new license as described here:
http://www.mozilla.org/MPL/license-policy.html
Comment 39•23 years ago
|
||
Assignee | ||
Comment 40•23 years ago
|
||
Review comments from Sean Su on attachment 50185 [details] [diff] [review].
*******
for RegisterServer() function, why have the first parameter definition commented
out? perhaps we should remove it?
*******
For calls to RegOpenKeyEx() and RegCreateKeyEx(), do not try to request
KEY_ACCESS_ALL. Try to request only the minimal access needed. This is because
the user might not have permission to get KEY_ACCESS_ALL, so it will fail. But
if, say, KEY_WRITE or KEY_READ (or a combination of them) is all that was
needed, the same user could have sufficient permissions to succeed.
*******
Do not assume const size when declaring char * variables. You will probably run
into buffer overrun bugs. Use nsXPIDLString, nsCString, or nsCAutoString. I
believe that it takes care of expanding the allocated memory if the string being
copied to it does not fit. Or check to make sure it can fit before performing
the copy. I found this in the folowing functions:
SubkeyExists()
setKeyAndValue()
RegistryProxy()
UnRegisterProxy()
RegisterServer()
UnregisterServer()
*******
In SetRegistryKey(), there's a call to RegCreateKey() is a key does not exist
from a call to RegOpenKey(). Why not just call RegCreateKey() since it will
open the key if one already exists? And if not, then it will create it. The
code should work fine as is. Just simpler the other way.
*******
In IsDefaultMailClient(), why do you truncate the length of result by 5?
+ nsCAutoString result(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ keyName.get(), ""));
+ if (!result.IsEmpty()) {
+ PRInt32 length = result.Length();
>>+ result.SetLength(length - 5);
+ return (result == thisApplication());
+ }
*******
In saveDefaultMailClient(), you should also save the value of:
key: HKEY_CURRENT_USER\Software\Clients\Mail
var Name: (default)
in HKEY_LOCAL_MACHINE\Software\Mozilla\Desktop, just as you do
HKEY_LOCAl_MACHINE\Software\Clients\Mail. Remember, if the above (default)
variable is not set, we need still need to save it, but with an "" empty string,
so that the uninstaller knows it needs to delete it.
You should save HKEY_LOCAL_MACHINE\Software\Clients\Mail if it's (default)
variable is empty as well. It probably will never happen, but we can never be
sure.
*******
In saveDefaultMailClient(), you shouldn't save appPath to the Mozilla\Desktop
key because mail wouldn't be overwriting it. We should only save what we're
going to overwrite.
+ nsresult rc = SetRegistryKey(HKEY_LOCAL_MACHINE,
+ "Software\\Mozilla\\Desktop",
+
"HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail",
+ (char *)name.get());
+ if (NS_SUCCEEDED(rc)) {
+ nsCString keyName("Software\\Clients\\Mail\\");
+ keyName += name.get();
+ keyName += "\\protocols\\mailto\\shell\\open\\command";
+ nsCAutoString appPath(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ keyName.get(), ""));
>>+ if (!appPath.IsEmpty()) {
>>+ nsCString stringName("HKEY_LOCAL_MACHINE\\");
>>+ stringName += keyName.get();
>>+ rc = SetRegistryKey(HKEY_LOCAL_MACHINE,
>>+ "Software\\Mozilla\\Desktop",
>>+ stringName.get(), (char *)appPath.get());
+ }
*******
in setDefaultMailClient():
+nsresult setDefaultMailClient()
+{
+ nsresult result = NS_ERROR_FAILURE;
+ if (!NS_SUCCEEDED(saveDefaultMailClient())) return NS_ERROR_FAILURE;
+ nsresult rc = SetRegistryKey(HKEY_LOCAL_MACHINE,
>>+ "Software\\Clients\\Mail\\Mozilla",
+ "", "Mozilla");
you can't assume that the key to create under:
HKEY_LOCAL_MACHINE\Software\Clients\Mail
is "Mozilla" because for netscape it's most likely Netscp6.exe". You should use
your thisApplication() function to get this info. This way, it will return
either "mozilla.exe" or "netscp6.exe". Something like this (got it from Bill
Law):
// Returns the "short" name of this application (in upper case). This is for
// use as a StartMenuInternet value.
static nsCString shortAppName() {
static nsCAutoString result;
if ( result.IsEmpty() ) {
// Find last backslash in thisApplication().
nsCAutoString thisApp( thisApplication() );
PRInt32 n = thisApp.RFind( "\\" );
if ( n != kNotFound ) {
// Use what comes after the last backslash.
result = (const char*)thisApp.get() + n + 1;
} else {
// Use entire string.
result = thisApp;
}
}
return result;
}
*******
Again in setDefaultMailClient():
+nsresult setDefaultMailClient()
+{
+ nsresult result = NS_ERROR_FAILURE;
+ if (!NS_SUCCEEDED(saveDefaultMailClient())) return NS_ERROR_FAILURE;
+ nsresult rc = SetRegistryKey(HKEY_LOCAL_MACHINE,
+ "Software\\Clients\\Mail\\Mozilla",
>>+ "", "Mozilla");
you can't assume that the description that is to show up in the Start menu
should be "Mozilla" because for netscape, it'll probably be "Netscape 6". Bill
Law is running into the same problem because he's trying to set the Start menu
for the browser. He's currently hard coded it to be "Netscape 6" on the branch
because only netscape will be shipping it (I think). You should get in touch
with him on how he's going to solve this problem. The string will probably come
from either a .dtd or .properties file. I'm not sure which one though :(
*******
Yet again in setDefaultMailClient(), you are only setting
HKEY_LOCAL_MACHINE\Software\Clients\Mail. You should also set (just this):
key: HKEY_CURRENT_USER\Software\Clients\Mail
var name: (default)
value: "Netscp6.exe" <-- the same key you create under
HKEY_LOCAL_MACHINE\Software\Clients\Mail for the mail product. It should be the
main app name (either Mozilla.exe or Netscp6.exe).
You should set this key only if there's something already set *and* we were able
to successfully set our mail as the default mail for this system. If we weren't
successfull, then setting this key will be confusing to the user. This is only
affects the WinXP's Start menu. HKEY_LOCAL_MACHINE\Software\Clients\Mail
affects both the default mail client *and* WinXP's Start menu (but the Start
menu feature is overridden by the key listed above if it exists).
*******
In unsetDefaultMailclient(), you will need to take into account the previous
value of HKEY_CURRENT_USER\Software\Clients\Mail. Remember, if the saved value
for this key is an empty string, then it should delete its (default) variable.
You also don't need to unset/restore the command key or the DLLPath:
+ nsCAutoString name(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ "Software\\Mozilla\\Desktop",
+
"HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail"));
+ if (!name.IsEmpty() && !strcmp(name.get(), "Mozilla")) {
>>+ nsCAutoString appPath(GetRegistryKey(HKEY_LOCAL_MACHINE,
>>+ "Software\\Mozilla\\Desktop",
>>+
"HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\Mozilla\\protocols\\mailto\\shell\
\open\\command"));
>>+ if (!appPath.IsEmpty()) {
>>+ result = SetRegistryKey(HKEY_LOCAL_MACHINE,
>>+
"Software\\Clients\\Mail\\Mozilla\\protocols\\mailto\\shell\\open\\command",
>>+ "", (char *)appPath.get());
>>+ if (NS_SUCCEEDED(result)) {
>>+ PRInt32 length = appPath.Length();
>>+ appPath.SetLength(length -16);
>>+ appPath += "mozMapi32.dll";
>>+ result = SetRegistryKey(HKEY_LOCAL_MACHINE,
>>+ "Software\\Clients\\Mail\\Mozilla",
>>+ "DLLPath", (char *) appPath.get());
+ }
+ }
+ }
The reason for not needing to reset this is because the resetting is
accomplished with the (default) value of
HKEY_LOCAL_MACHINE\Software\Clients\Mail. The "Mozilla" subkey in the above
code, was created only by us and not anyone else. It's also the way to show us
up in the list of available mail apps that can be set as default mail apps for
the system.
*******
In getShowDialog(), I'm confused on parts of its logic. The comment indicates
that it return FALSE if showMapiDialog is set to 0, but in the code, it doesn't
look like it's doing that:
+// Returns FALSE if showMapiDialog is set to 0.
+// Returns TRUE otherwise
+// Also returns TRUE if the Mozilla has been set as the default mail client
+// and some other application has changed that setting.
+PRBool getShowDialog() {
>>+ PRBool rv = PR_FALSE;
+ nsCString showDialog(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ "Software\\Mozilla\\Desktop",
+ "showMapiDialog"));
+ if (!showDialog.IsEmpty()) {
>>+ if (!strcmp(showDialog.get(), "1"))
>>+ rv = PR_TRUE;
+ }
+ else
+ rv = PR_TRUE;
+ if (!rv) {
+ nsCAutoString setMailDefault(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ "Software\\Mozilla\\Desktop",
+ "setMailDefault"));
>>+ if (!setMailDefault.IsEmpty() && !strcmp(setMailDefault.get(), "1"))
>>+ rv = PR_TRUE;
+ }
+ return rv;
+}
same thing with setMailDefault above. Maybe I'm starting to see things at 3am?
Assignee | ||
Comment 41•23 years ago
|
||
Assignee | ||
Comment 42•23 years ago
|
||
Assignee | ||
Comment 43•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #50323 -
Attachment is obsolete: true
Assignee | ||
Comment 44•23 years ago
|
||
Sean, i have not made all the changes you mentioned. see my comments in the
attatchment 50324.
Comment 45•23 years ago
|
||
In IsDefaultMailClient(), why do you truncate the length of result by 5?
+ nsCAutoString result(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ keyName.get(), ""));
+ if (!result.IsEmpty()) {
+ PRInt32 length = result.Length();
>>+ result.SetLength(length - 5);
+ return (result == thisApplication());
+ }
because the "result" has the following string
"....../mozilla.exe "%1"" and thisApplication returns "...../mozilla.exe"
Isn't there a proper way to parse this string? is it 100% impossible for the
string not to be of some other form? and if that's the case then don't we
already know it some other way?
So does this mean a user who installs mozilla and netscape6 won't be able to
use XP's control panels to pick the other one of them as their internet
application, because you're sharing keys?
+ nsCAutoString setMailDefault(GetRegistryKey(HKEY_LOCAL_MACHINE,
+ "Software\\Mozilla\\Desktop",
+ "setMailDefault"));
>>+ if (!setMailDefault.IsEmpty() && !strcmp(setMailDefault.get(), "1"))
We wouldn't be so confused if you used
setMailDefault.Equals(NS_LITERAL_STRING("1")).
It's late for me too and i'm still quite unsure about a lot of this so i will
probably have other questions later.
Assignee | ||
Comment 46•23 years ago
|
||
Assignee | ||
Comment 47•23 years ago
|
||
Assignee | ||
Comment 48•23 years ago
|
||
In the latest patch I changed the code in IsDefaultMailClient(), instead
of truncating the length of result by 5, I was checking fot the last space.
Also changed Registry.cpp to address the buffer overrun cases.
Sean please review
Comment 49•23 years ago
|
||
/** Is this the way useful comments
* are supposed to be formatted if we want our magic
* documentation extractor to catch them?
*/
I think that we might have slightly changed the license block edges, but i'm
not quite sure so i'll have to ask someone...
+ HKEY hKey ;
+ HKEY hKey;
um, i much prefer no ws before ;'s but whatever you choose please be
consistent. my same views apply to ws before )'s
+ LONG lResult = ::RegOpenKeyEx(HKEY_CLASSES_ROOT, szKeyBuf, 0,
+ KEY_ALL_ACCESS, &hKey) ;
+ long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT, szKeyBuf,
+ 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS, NULL, &hKey, NULL) ;
the microsoft web site avoids these problems,
Q201431 - HOWTO: Write Automation for Visual SourceSafe 5.0/ ...
... Find the ssapi.dll registry key. HKEY hclass; if
(RegOpenKeyEx(HKEY_CLASSES_ROOT,
"CLSID", 0, KEY_QUERY_VALUE, &hclass) == ERROR_SUCCESS) { HKEY hkey; if ...
support.microsoft.com/support/kb/articles/q201/4/31.asp - 18k - Cached -
Similar pages
offhand i don't remember if you should be using LONG or long but again i'd
prefer some consistency.
+void RegisterProxy(char *szExePath)
+{
+ HINSTANCE h = nsnull;
+ DllRegisterServer *RegisterFunc = NULL;
+ char szTemp[MAX_SIZE];
+ char *pTemp = nsnull;
+
+ pTemp = strrchr(szExePath, '\\');
+ assert(pTemp != NULL);
+
+ *pTemp = '\0';
+ strcpy (szTemp, szExePath);
+ *pTemp = '\\';
+ strcat (szTemp, "\\");
+ strcat (szTemp, MAPI_PROXY_DLL_NAME);
what's the point of setting pTemp to '\0' ?
+ char szModule[MAX_SIZE] ;
+ char szBackupModule[MAX_SIZE];
+
+ DWORD dwResult = ::GetModuleFileName(hModule, szModule,
+ sizeof(szModule)/sizeof(char));
why the sizeof division?
i wonder if compilers are smart about the repeated use of constant strings
("CLSID")...
+ LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey);
+ assert((lResult == ERROR_SUCCESS) ||
ws.
\ No newline at end of file
^ fix!
+ else
+ rv = ShowMapiErrorDialog();
ws
+// This will bring up the dialog box only once per session and
+// only if Mozilla is not default Mail Client.
hrm... should we internally describe ourselves as mozilla ...?
+ if (checkValue) {
+ rv = SetRegistryKey(HKEY_LOCAL_MACHINE,
"Software\\Mozilla\\Desktop",
+ "showMapiDialog", "0");
+ if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
+ }
+ else {
+ rv = SetRegistryKey(HKEY_LOCAL_MACHINE,
"Software\\Mozilla\\Desktop",
+ "showMapiDialog", "1");
+ if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
+ }
i'd prefer if you used a ?: form, something like:
+ rv = SetRegistryKey(HKEY_LOCAL_MACHINE,
"Software\\Mozilla\\Desktop",
+ "showMapiDialog", (checkValue) ? "0" : "1");
+ if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
+ if ( result.IsEmpty() ) {
+ char buffer[MAX_PATH] = { 0 };
+ DWORD len = ::GetModuleFileName(NULL, buffer, sizeof buffer);
ws. i wonder if i'm actually seeing tabs? -- tabs are evil
+static nsCString shortAppName() {
+ static nsCAutoString result;
+
+ if ( result.IsEmpty() ) {
+ // Find last backslash in thisApplication().
+ nsCAutoString thisApp( thisApplication() );
+ PRInt32 n = thisApp.RFind( "\\" );
+ if ( n != kNotFound ) {
+ // Use what comes after the last backslash.
+ result = (const char*)thisApp.get() + n + 1;
this looks wrong.
you've used both if ( cond ) and if (cond), i prefer the latter, but it appears
you're at least consistent on a per file basis... however i'm pretty sure most
people will agree (foo ) and ( foo) aren't ok.. even if they span multiple
lines (foo, \nbar ) ...
+ rc = ::RegQueryValueEx(key, valueName, NULL, NULL, (LPBYTE)buffer,
+ &len );
+ nsCString keyName("Software\\Clients\\Mail\\");
+ keyName += name.get();
+ keyName += "\\protocols\\mailto\\shell\\open\\command";
this should probably be NS_LITERAL_STRING wrapped, right?
+ result.SetLength(length - 5);
if / when you *ever* use magic numbers please comment /* i'm doing this because
i'm making the evil assumption that 5 magically corresponds to... um, i forgot,
... -- however i promise to fill this in before someone complains */
you used 'rc' to mean windows api return, so i didn't carp about it.
now i'm carping:
+ nsresult rc;
we use rv (return value) for mozilla calls. in my view using rv to mean mozilla
calls can help the reader discern them from winapi calls and recognize mozilla
calls
+ else if (appPath.Equals(nsCAutoString("NETSCP6.EXE")))
hrm... 1 this should probably be NS_LITERAL_CSTRING, 2 please comment /* we're
violating the rules that say we shouldn't know about non mozilla versions
because ... 3 we know netscp6.exe will be there and we don't care about
beonex.exe */ -- yes i really don't like the fact that you picked netscp6 and
ignored any other known distributions.
+ dllPath.SetLength(length -11);
another magic number :-( don't forget to comment about it.
mozilla.exe ah there's 11. @@@! BAD.
beonex.exe that's 10. please don't hard code 11. If you're going to need
appPath then make it available if it isn't already.
erm, now i'm really confused you're calling winapi functions and storing them
as nsresults?? ??
+ if (currentAppPath.Equals(nsCAutoString("MOZILLA.EXE"))) {
+ appName.Assign("Mozilla");
+ }
+ else if (currentAppPath.Equals(nsCAutoString("NETSCP6.EXE")))
+ {
+ appName.Assign("Netscape 6");
+ }
... this is getting frustrating. there's a bug about adding a versioninfo
resource to mozilla, i highly suggest that you work on getting that patch in.
-- oh and don't forget you want NS_LITERAL_CSTRING, not nsCAutoString.
some of my hard coding complaints will probably be addressed in a future bug,
but i'd appreciate it if you filed it against yourself and referenced it here.
i really suspect there are tabs in this patch.
... there's supposed to be a nice ms ref about HKEY_ALL_ACCESS but i can't find
it at the moment, ms's search engine is being rather disagreeable. .. i guess
more later.
perhaps scc or jag might comment on string usage. the beginning was very good
(or i'm tired) but the end didn't look as good.
Comment 50•23 years ago
|
||
fwiw, my comments were against attachment 50575 [details] [diff] [review] -- i collided. i'll check again
tomorrow night.
Comment 51•23 years ago
|
||
Yes, the license headers have changed slightly for compatibility with XML
comments. Basically, "-----" changed to "*****". Sorry for the inconvenience.
Gerv
Comment 52•23 years ago
|
||
Taking out PDT+, back to PDT. We need the real fix ... like real soon.
Status Update and ETA in Status Whiteboard pls ...
Whiteboard: PDT+ → PDT,[ETA?]
Comment 53•23 years ago
|
||
I still see usage of strcpy() and strcat() without first making sure there's
enough space allocated. Please add comments that this needs to be fixed in
the future and also file a bug on this so that it can be tracked and not
forgotten about.
In unsetDefaultMailclient(), do not truncate a string to get at it's path:
+ if (NS_SUCCEEDED(result)) {
+ PRInt32 length = appPath.Length();
>>+ appPath.SetLength(length -16);
+ appPath += "mozMapi32.dll";
It looks like you're trying to get at the '[bin path]' of
'[bin path]\netscp6.exe "%1"'. This will fail if the main app name is not
'netscap6.exe', or even if the parameter is not '"%1"'. A better way is
probably to search for the first '\\' from the right by using the following:
PRInt32 n = appPath.RFind( "\\" );
I understand that we're on a time contraint to get this checked in. If you
fix the above, I can provide a (reluctant) r=ssu for the branch, not the
trunk. All the problems that are still in the code (which include timeless'
comments) will need to be addressed before it can be merged into the trunk.
Unfortunately, I am currently unable to apply the patch and test it, as I do not
have a WinXP box readily available. I hope QA is already testing this code.
Reporter | ||
Comment 54•23 years ago
|
||
Scot:
Thx for agreeing to be the sr for this bug at the PDT meeting yesterday
afternoon. Sean said you can start your sr right now. I just left you a voice
mail. We want to be able to check in today.
Assignee | ||
Comment 55•23 years ago
|
||
Will post a new patch with the changes suggested by Sean and timeless in few
minutes.
Assignee | ||
Comment 56•23 years ago
|
||
Assignee | ||
Comment 57•23 years ago
|
||
Assignee | ||
Comment 58•23 years ago
|
||
In the last patch I am using the brand name from brand.properties file instead
of checking for mozilla.exe or Netscp6.exe.
Comment 59•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #50185 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #50318 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #50575 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #50654 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #50790 -
Attachment is obsolete: true
Assignee | ||
Comment 60•23 years ago
|
||
Attachment #50851 -
Flags: review+
Comment 61•23 years ago
|
||
ssu's request about mortal users is something i was going to ask about, so i
think i'm unlikely to have further complaints. but i need to go to work and
tonight is a Holy Day so i won't be able to mark anything until friday. My
absense should not be a concern.
a quick note...
+ nsCAutoString theKey(keyName);
+ if (subKey != NULL)
+ {
+ theKey += "\\";
+ theKey += subKey;
you shouldn't use two seperate operations
+ theKey += "\\" + subKey;
should behave better (never worse) -- this appears a few times. if you're
afraid of long lines, feel free to wrap near the + operation.
+ *pTemp = '\0';
+ nsCAutoString proxyPath(szModule);
+ *pTemp = '\\';
this pTemp here still looks unused, i'd suggest removing it...
+ UnRegisterFunc = (ProxyServer *) GetProcAddress(h, "DllUnregisterServer");
+ if (!UnRegisterFunc)
+ UnRegisterFunc();
i think this logic is backwards, but i'm just waking up.
UnRegisterFunc = 0;
if (!0) => if (true)
call 0. sure seems wrong.
some of your functions are now using /** form :-), some aren't :-(
whichever, please avoid //foo (in favor of at least some whitespace)
Assignee | ||
Comment 62•23 years ago
|
||
Assignee | ||
Comment 63•23 years ago
|
||
oops wrong patch
Assignee | ||
Updated•23 years ago
|
Attachment #50908 -
Attachment is obsolete: true
Assignee | ||
Comment 64•23 years ago
|
||
Comment 65•23 years ago
|
||
Comment 66•23 years ago
|
||
Assignee | ||
Comment 67•23 years ago
|
||
I created the new attachment based on timeless comments
+ theKey += "\\" + subKey;
I cannot do this because I get a compilation error "cannot add two pointers"
In the latest patch, I have
+ pTemp = strrchr(szModule, '\\');
+ if (pTemp == NULL)
+ return;
+
+ *pTemp = '\0';
+ nsCAutoString proxyPath(szModule);
So setting *pTemp = '\0' will truncate szModule since pTemp is pointing to the
the szModule + some offset.
*******
+ UnRegisterFunc = (ProxyServer *) GetProcAddress(h, "DllUnregisterServer");
+ if (!UnRegisterFunc)
+ UnRegisterFunc();
i think this logic is backwards, but i'm just waking up.
You are right. I made this change
Comment 68•23 years ago
|
||
Comment on attachment 50918 [details] [diff] [review]
the right patch
sr=mscott. One question though, should be we be writing our registry keys to HKEY_LOCAL_MACHINE (which applies for all profiles on that windows OS) or should it be a per user setting:
HKEY_CURRENT_USER
Seems to me we'd want to be making mozilla the default app on a per user basis. Just my 2 cents.
Attachment #50918 -
Flags: superreview+
Attachment #50918 -
Flags: review+
Attachment #50851 -
Attachment is obsolete: true
Attachment #50851 -
Flags: review+
Assignee | ||
Comment 69•23 years ago
|
||
We have to write the registry keys into HKEY_LOCAL_MACHINE because the OS looks
in HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail for the default mail client.
Comment 70•23 years ago
|
||
Comment on attachment 50920 [details] [diff] [review]
patch to update installer do undo WinXP Start menu (ns tree)
sr=dveditz
Attachment #50920 -
Flags: superreview+
Comment 71•23 years ago
|
||
Comment on attachment 50921 [details] [diff] [review]
patch to update installer do undo WinXP Start menu (moz tree)
sr=dveditz
Attachment #50921 -
Flags: superreview+
Updated•23 years ago
|
Whiteboard: PDT,[ETA?] → [PDT],[ETA?]
Comment 72•23 years ago
|
||
Pls update the status for all patches with "has-review" and "has-super-review"
where needed.
Updated•23 years ago
|
Attachment #50920 -
Flags: review+
Comment 73•23 years ago
|
||
Comment on attachment 50921 [details] [diff] [review]
patch to update installer do undo WinXP Start menu (moz tree)
r=curt for both patches, i.e. ns and mozilla
Attachment #50921 -
Flags: review+
Reporter | ||
Updated•23 years ago
|
Component: Composition → Simple MAPI
Comment 74•23 years ago
|
||
+ theKey += "\\" + subKey;
> I cannot do this because I get a compilation error "cannot add two pointers"
yeah, sorry |theKey += NS_LITERAL_CSTRING("\\") + subKey| should work ...
> So setting *pTemp = '\0' will truncate szModule since pTemp is pointing to
> the szModule + some offset.
ah... hrm, a comment in the code could be useful.
and thanks for tolerating my comments
Updated•23 years ago
|
Whiteboard: [PDT],[ETA?] → [PDT],[ETA 10.04]
Assignee | ||
Comment 75•23 years ago
|
||
feature done, has r and sr
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 76•23 years ago
|
||
It's not "fixed" until the code is checked in
Comment 77•23 years ago
|
||
The installer patches have now been checked into the branch only.
Assignee | ||
Comment 78•23 years ago
|
||
Checked in attachment 50918 [details] [diff] [review] into the MOZILLA_0_9_4_BRANCH
Updated•23 years ago
|
Whiteboard: [PDT],[ETA 10.04] → [PDT+],[ETA 10.04] [Checked into 094 branch]
Reporter | ||
Comment 79•23 years ago
|
||
checked into 0.9.4 branch.
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•