refactor: Un-singletonize Paths & Updates (#5092)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "util/InitUpdateButton.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "widgets/dialogs/UpdateDialog.hpp"
|
||||
#include "widgets/helper/Button.hpp"
|
||||
|
||||
@@ -40,7 +41,7 @@ void initUpdateButton(Button &button,
|
||||
}
|
||||
break;
|
||||
case UpdateDialog::Install: {
|
||||
Updates::instance().installUpdates();
|
||||
getIApp()->getUpdates().installUpdates();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -52,17 +53,17 @@ void initUpdateButton(Button &button,
|
||||
|
||||
// update image when state changes
|
||||
auto updateChange = [&button](auto) {
|
||||
button.setVisible(Updates::instance().shouldShowUpdateButton());
|
||||
button.setVisible(getIApp()->getUpdates().shouldShowUpdateButton());
|
||||
|
||||
const auto *imageUrl = Updates::instance().isError()
|
||||
const auto *imageUrl = getIApp()->getUpdates().isError()
|
||||
? ":/buttons/updateError.png"
|
||||
: ":/buttons/update.png";
|
||||
button.setPixmap(QPixmap(imageUrl));
|
||||
};
|
||||
|
||||
updateChange(Updates::instance().getStatus());
|
||||
updateChange(getIApp()->getUpdates().getStatus());
|
||||
|
||||
signalHolder.managedConnect(Updates::instance().statusUpdated,
|
||||
signalHolder.managedConnect(getIApp()->getUpdates().statusUpdated,
|
||||
[updateChange](auto status) {
|
||||
updateChange(status);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user