Kaydet (Commit) 3c71fa1e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Cleanly remove an extension again that cannot be activated while installing it

...otherwise, it will needlessly be carried forward marked "broken."

Change-Id: I12fbd4430e1ecc11f1969ae5f49aed43668f2c27
üst 3d23c626
...@@ -693,6 +693,10 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( ...@@ -693,6 +693,10 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
xOldExtension ); xOldExtension );
{ {
bool added = false;
OUString sNewExtensionIdentifier;
OUString sNewExtensionFileName;
// In this garded section (getMutex) we must not use the argument xCmdEnv // In this garded section (getMutex) we must not use the argument xCmdEnv
// because it may bring up dialogs (XInteractionHandler::handle) this // because it may bring up dialogs (XInteractionHandler::handle) this
//may potententially deadlock. See issue //may potententially deadlock. See issue
...@@ -737,6 +741,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( ...@@ -737,6 +741,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
xNewExtension = xPackageManager->addPackage( xNewExtension = xPackageManager->addPackage(
url, properties, OUString(), xAbortChannel, url, properties, OUString(), xAbortChannel,
Reference<ucb::XCommandEnvironment>()); Reference<ucb::XCommandEnvironment>());
added = true;
//If we add a user extension and there is already one which was //If we add a user extension and there is already one which was
//disabled by a user, then the newly installed one is enabled. If we //disabled by a user, then the newly installed one is enabled. If we
//add to another repository then the user extension remains //add to another repository then the user extension remains
...@@ -745,9 +750,8 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( ...@@ -745,9 +750,8 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
if (repository == "user") if (repository == "user")
bUserDisabled2 = false; bUserDisabled2 = false;
// pass the two values via variables to workaround gcc-4.3.4 specific bug (bnc#655912) sNewExtensionIdentifier = dp_misc::getIdentifier(xNewExtension);
OUString sNewExtensionIdentifier = dp_misc::getIdentifier(xNewExtension); sNewExtensionFileName = xNewExtension->getName();
OUString sNewExtensionFileName = xNewExtension->getName();
activateExtension( activateExtension(
sNewExtensionIdentifier, sNewExtensionFileName, sNewExtensionIdentifier, sNewExtensionFileName,
...@@ -792,6 +796,18 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( ...@@ -792,6 +796,18 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//If the user aborted installation then a ucb::CommandAbortedException //If the user aborted installation then a ucb::CommandAbortedException
//is thrown. //is thrown.
//Use a private AbortChannel so the user cannot interrupt. //Use a private AbortChannel so the user cannot interrupt.
if (added) {
try {
xPackageManager->removePackage(
sNewExtensionIdentifier, sNewExtensionFileName,
css::uno::Reference< css::task::XAbortChannel >(),
css::uno::Reference< css::ucb::XCommandEnvironment >());
} catch (css::uno::Exception & e) {
SAL_WARN(
"desktop.deployment",
"ignoring Exception " << e.Message);
}
}
try try
{ {
if (xExtensionBackup.is()) if (xExtensionBackup.is())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment