Closed Bug 567066 Opened 16 years ago Closed 16 years ago

Keep Qt related command line parameters during restart

Categories

(Core Graveyard :: Widget: Qt, defect)

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: steffen.imhof, Assigned: steffen.imhof)

Details

Attachments

(2 files)

If the browser restarts itself for example because extensions were enabled/disabled, it drops all command line parameters given previously. This is not good for those that are Qt related for example specifying the graphics system with "-graphicssystem raster" gets lost after the restart which might lead to unexpected effects.
Attachment #446465 - Flags: review?(dougt)
Assignee: nobody → steffen.imhof
Status: NEW → ASSIGNED
Hardware: x86 → All
Comment on attachment 446465 [details] [diff] [review] Patch to store all Qt parameters for later use rob, can you take a look at this?
Attachment #446465 - Flags: review?(dougt) → review?(rstrong)
Comment on attachment 446465 [details] [diff] [review] Patch to store all Qt parameters for later use > PRBool aBlankCommandLine = PR_FALSE) > { > aNative->Quit(); // release DDE mutex, if we're holding it > > // Restart this process by exec'ing it into the current process > // if supported by the platform. Otherwise, use NSPR. > > if (aBlankCommandLine) { >+#if defined(MOZ_WIDGET_QT) >+ // Remove only arguments not given to Qt >+ gRestartArgc = gQtOnlyArgc; >+ gRestartArgv = gQtOnlyArgv; >+ gRestartArgv[gRestartArgc] = nsnull; This last line seems unnecessary when you're setting the last element to null when initialising gQtOnlyArgv. > #if defined(MOZ_WIDGET_QT) > QApplication app(gArgc, gArgv); >+ >+ QStringList nonQtArguments = app.arguments(); >+ gQtOnlyArgc = 1; >+ gQtOnlyArgv = (char**) malloc(sizeof(char*) * (gRestartArgc - nonQtArguments.size() + 1)); >+ >+ // copy binary path >+ gQtOnlyArgv[0] = gRestartArgv[0]; >+ >+ for (int i = 1; i < gRestartArgc; ++i) { >+ if (!nonQtArguments.contains(gRestartArgv[i])) { >+ // copy arguments used by Qt for later >+ gQtOnlyArgv[gQtOnlyArgc++] = gRestartArgv[i]; >+ } >+ } >+ gQtOnlyArgv[gQtOnlyArgc] = 0; Use nsnull please. r=me with those changes
Attachment #446465 - Flags: review?(rstrong) → review+
Attached patch Updated patchSplinter Review
Updated version of the patch that addresses the review issues, also it is refreshed to the latest mozilla-central code and the memory allocation is made bigger, because it was too small.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: