mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2025-01-18 16:26:26 +01:00
fix "Update extension"
This commit is contained in:
parent
4dedc90344
commit
7ac33ef408
@ -120,7 +120,7 @@ public class StoreExtensionDetailsOverview extends HOverview {
|
||||
@Override
|
||||
public void buttonClick(GExtensionStore gExtensionStore) {
|
||||
int mode = mode();
|
||||
if (mode == 2) return;
|
||||
if (mode == 1) return;
|
||||
|
||||
String modeString = mode() == 0 ? "Install" : "Update";
|
||||
HOverview selff = this;
|
||||
@ -149,7 +149,7 @@ public class StoreExtensionDetailsOverview extends HOverview {
|
||||
if (mode() == 0) {
|
||||
StoreExtensionTools.installExtension(extension.getTitle(), storeRepository, listener);
|
||||
}
|
||||
else if (mode() == 1) {
|
||||
else if (mode() == 2) {
|
||||
StoreExtensionTools.updateExtension(extension.getTitle(), storeRepository, listener);
|
||||
}
|
||||
}
|
||||
|
@ -142,10 +142,14 @@ public class StoreExtensionTools {
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
listener.fail("Invalid extension URL");
|
||||
removeExtension(path); // cleanup
|
||||
try {
|
||||
removeExtension(path); // cleanup
|
||||
} catch (IOException ignore) { }
|
||||
} catch (IOException e) {
|
||||
listener.fail("Extension not available in repository");
|
||||
removeExtension(path); // cleanup
|
||||
try {
|
||||
removeExtension(path); // cleanup
|
||||
} catch (IOException ignore) { }
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -161,12 +165,8 @@ public class StoreExtensionTools {
|
||||
|
||||
}
|
||||
|
||||
public static void removeExtension(String extensionPath) {
|
||||
try {
|
||||
FileUtils.deleteDirectory(new File(extensionPath));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public static void removeExtension(String extensionPath) throws IOException {
|
||||
FileUtils.deleteDirectory(new File(extensionPath));
|
||||
}
|
||||
|
||||
public static List<InstalledExtension> getInstalledExtension() {
|
||||
|
Loading…
Reference in New Issue
Block a user