summaryrefslogtreecommitdiff
path: root/src/selfupdater.cpp
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-06-07 03:44:05 -0700
committerGitHub <noreply@github.com>2020-06-07 03:44:05 -0700
commitbf055e804879c0a74750c7b60dbeababeafd3a23 (patch)
tree75f47a25da8c8045dd195f42c8c218acb425d3db /src/selfupdater.cpp
parent226b2b1843bbf41581757f44f8a2f4728f0a4b19 (diff)
parent0ad56591fd9581aa9195f854ac3fc1b40d5b1802 (diff)
Merge pull request #1101 from Holt59/archive-lib-modification
Archive lib refactoring
Diffstat (limited to 'src/selfupdater.cpp')
-rw-r--r--src/selfupdater.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/selfupdater.cpp b/src/selfupdater.cpp
index 501c7ed1..1f56fd62 100644
--- a/src/selfupdater.cpp
+++ b/src/selfupdater.cpp
@@ -19,10 +19,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "selfupdater.h"
-#include "archive.h"
-#include "callback.h"
#include "utility.h"
-#include "installationmanager.h"
#include "iplugingame.h"
#include "messagedialog.h"
#include "downloadmanager.h"
@@ -71,45 +68,18 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
using namespace MOBase;
using namespace MOShared;
-
-typedef Archive* (*CreateArchiveType)();
-
-
-template <typename T> static T resolveFunction(QLibrary &lib, const char *name)
-{
- T temp = reinterpret_cast<T>(lib.resolve(name));
- if (temp == nullptr) {
- throw std::runtime_error(QObject::tr("invalid 7-zip32.dll: %1").arg(lib.errorString()).toLatin1().constData());
- }
- return temp;
-}
-
-
SelfUpdater::SelfUpdater(NexusInterface *nexusInterface)
: m_Parent(nullptr)
, m_Interface(nexusInterface)
, m_Reply(nullptr)
, m_Attempts(3)
{
- QLibrary archiveLib(QCoreApplication::applicationDirPath() + "\\dlls\\archive.dll");
- if (!archiveLib.load()) {
- throw MyException(tr("archive.dll not loaded: \"%1\"").arg(archiveLib.errorString()));
- }
-
- CreateArchiveType CreateArchiveFunc = resolveFunction<CreateArchiveType>(archiveLib, "CreateArchive");
-
- m_ArchiveHandler = CreateArchiveFunc();
- if (!m_ArchiveHandler->isValid()) {
- throw MyException(InstallationManager::getErrorString(m_ArchiveHandler->getLastError()));
- }
-
m_MOVersion = createVersionInfo();
}
SelfUpdater::~SelfUpdater()
{
- delete m_ArchiveHandler;
}
void SelfUpdater::setUserInterface(QWidget *widget)