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