Closed Bug 294683 Opened 20 years ago Closed 20 years ago

xulrunner should use env var to remember path to appdata file

Categories

(Toolkit Graveyard :: XULRunner, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: darin.moz, Assigned: benjamin)

Details

Attachments

(1 file)

xulrunner should use env var to remember path to appdata file

right now, we augment the command line with a "-app" command line flag, but this
might interfere with other command line handling done by the application.  it'd
be better to strip the path-to-appdata-file command line argument and stash it
in an env var for use when we need to restart the application.
Assignee: nobody → benjamin
Attachment #184510 - Flags: first-review?(darin)
Comment on attachment 184510 [details] [diff] [review]
Add XUL_APP-FILE envvar, rev. 1

>Index: toolkit/xre/nsAppRunner.cpp

>+        PR_SetEnv("XUL_APP_FILE=");

nit: why bother clearing this env var?	it seems that nsAppRunner.cpp
should not know about details of nsXULRunnerApp.cpp.


>Index: xulrunner/app/nsXULRunnerApp.cpp

>+  const char *appDataFile = PR_GetEnv("XUL_APP_FILE");
> 
>+  if (! (appDataFile && *appDataFile)) {

nit: kill the space after the "!"


>+    if (IsArg(argv[1], "app")) {
>+      if (argc == 2) {
>+        Output(PR_TRUE, "Error: APP-FILE must be specified!\n");

nit: maybe this should be Usage() ?


r=darin
Attachment #184510 - Flags: first-review?(darin) → first-review+
> nit: why bother clearing this env var?	it seems that nsAppRunner.cpp
> should not know about details of nsXULRunnerApp.cpp.

We need to clear the envvar for the same reason we need to clear the other
"restart variables", because otherwise one xulapp cannot launch another one (the
envvar would override. I thought about adding a nsXULAppAPI hook for "clearing
stuff after we've restarted" or something like that, but it sounded like overkill.
Comment on attachment 184510 [details] [diff] [review]
Add XUL_APP-FILE envvar, rev. 1

xulrunner only fixup.
Attachment #184510 - Flags: approval-aviary1.1a1?
Agreed on clearing the env var.  Thanks for reminding me of that reason.
Comment on attachment 184510 [details] [diff] [review]
Add XUL_APP-FILE envvar, rev. 1

a=asa
Attachment #184510 - Flags: approval-aviary1.1a1? → approval-aviary1.1a1+
fixed on trunk
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta2
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: