MCPcopy Create free account
hub / github.com/OneMoreGres/ScreenTranslator / applyAction

Method applyAction

src/service/updates.cpp:785–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785void Updater::applyAction(Action action, const QVector<File> &files)
786{
787 for (const auto &file : files) {
788 LTRACE() << "applyAction" << int(action) << file.rawPath;
789
790 if (action == Action::Remove) {
791 Installer installer;
792 installer.remove(file);
793 if (!installer.error().isEmpty()) {
794 emit error(installer.error());
795 continue;
796 }
797 model_->updateStates();
798 emit updated();
799 continue;
800 }
801
802 if (action == Action::Install) {
803 if (file.urls.isEmpty() || findDownload(file.urls.first()) != -1)
804 continue;
805
806 Installer installer;
807 installer.checkInstall(file);
808
809 if (!installer.error().isEmpty()) {
810 emit error(installer.error());
811 continue;
812 }
813
814 downloading_.push_back(file);
815 loader_->download(file.urls);
816 continue;
817 }
818 }
819}
820
821void Updater::downloaded(const QUrl &url, const QByteArray &data)
822{

Callers 2

selectAllUpdatesMethod · 0.80
tryActionMethod · 0.80

Calls 4

removeMethod · 0.80
updateStatesMethod · 0.80
checkInstallMethod · 0.80
downloadMethod · 0.80

Tested by

no test coverage detected