summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/aboutdialog.cpp1
-rw-r--r--src/dlls.manifest.debug.qt53
-rw-r--r--src/downloadmanager.cpp2
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainwindow.cpp48
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/organizer.pro2
-rw-r--r--src/pluginlist.cpp12
-rw-r--r--src/settings.cpp2
-rw-r--r--src/shared/util.cpp9
10 files changed, 59 insertions, 24 deletions
diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp
index b5bfeb04..90dcd073 100644
--- a/src/aboutdialog.cpp
+++ b/src/aboutdialog.cpp
@@ -41,7 +41,6 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent)
addLicense("Boost Library", LICENSE_BOOST);
addLicense("7-zip", LICENSE_LGPL3);
addLicense("ZLib", LICENSE_ZLIB);
- addLicense("NIF File Format Library", LICENSE_BSD3);
addLicense("Tango Icon Theme", LICENSE_NONE);
addLicense("RRZE Icon Set", LICENSE_CCBY3);
addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3);
diff --git a/src/dlls.manifest.debug.qt5 b/src/dlls.manifest.debug.qt5
index 6cc0a83d..1bbdf691 100644
--- a/src/dlls.manifest.debug.qt5
+++ b/src/dlls.manifest.debug.qt5
@@ -8,7 +8,10 @@
<file name="Qt5Declaratived.dll"/>
<file name="Qt5Quickd.dll"/>
<file name="Qt5Guid.dll"/>
+ <file name="Qt5Multimediad.dll"/>
+ <file name="Qt5MultimediaWidgetsd.dll"/>
<file name="Qt5Networkd.dll"/>
+ <file name="Qt5OpenGLd.dll"/>
<file name="Qt5Scriptd.dll"/>
<file name="Qt5Sqld.dll"/>
<file name="Qt5Widgetsd.dll"/>
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index 28605409..b803d170 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -608,7 +608,7 @@ void DownloadManager::pauseDownload(int index)
DownloadInfo *info = m_ActiveDownloads.at(index);
if (info->m_State == STATE_DOWNLOADING) {
- if (info->m_Reply->isRunning()) {
+ if ((info->m_Reply != NULL) && (info->m_Reply->isRunning())) {
setState(info, STATE_PAUSING);
} else {
setState(info, STATE_PAUSED);
diff --git a/src/main.cpp b/src/main.cpp
index 642bfa1a..b4139f09 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -332,7 +332,7 @@ int main(int argc, char *argv[])
}
}
- application.addLibraryPath(application.applicationDirPath() + "/dlls");
+ application.setLibraryPaths(QStringList() << (application.applicationDirPath() + "/dlls"));
SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 17743312..ede14448 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -103,6 +103,10 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <TlHelp32.h>
#include <QNetworkInterface>
#include <QNetworkProxy>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
+#include <QJsonValue>
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QtConcurrent/QtConcurrentRun>
#else
@@ -1268,14 +1272,14 @@ void MainWindow::unloadPlugins()
ui->actionTool->menu()->clear();
}
- foreach (QPluginLoader *loader, m_PluginLoaders) {
- qDebug("unloading %s", qPrintable(loader->fileName()));
+ while (!m_PluginLoaders.empty()) {
+ QPluginLoader *loader = m_PluginLoaders.back();
+ m_PluginLoaders.pop_back();
if (!loader->unload()) {
qDebug("failed to unload %s: %s", qPrintable(loader->fileName()), qPrintable(loader->errorString()));
}
delete loader;
}
- m_PluginLoaders.clear();
}
void MainWindow::loadPlugins()
@@ -1322,7 +1326,7 @@ void MainWindow::loadPlugins()
if (QLibrary::isLibrary(pluginName)) {
QPluginLoader *pluginLoader = new QPluginLoader(pluginName, this);
if (pluginLoader->instance() == NULL) {
- m_UnloadedPlugins.push_back(pluginName);
+ m_FailedPlugins.push_back(pluginName);
qCritical("failed to load plugin %s: %s",
qPrintable(pluginName), qPrintable(pluginLoader->errorString()));
} else {
@@ -1330,7 +1334,7 @@ void MainWindow::loadPlugins()
qDebug("loaded plugin \"%s\"", qPrintable(pluginName));
m_PluginLoaders.push_back(pluginLoader);
} else {
- m_UnloadedPlugins.push_back(pluginName);
+ m_FailedPlugins.push_back(pluginName);
qWarning("plugin \"%s\" failed to load", qPrintable(pluginName));
}
}
@@ -2300,7 +2304,7 @@ void MainWindow::on_tabWidget_currentChanged(int index)
std::vector<unsigned int> MainWindow::activeProblems() const
{
std::vector<unsigned int> problems;
- if (m_UnloadedPlugins.size() != 0) {
+ if (m_FailedPlugins.size() != 0) {
problems.push_back(PROBLEM_PLUGINSNOTLOADED);
}
if (m_PluginList.enabledCount() > 255) {
@@ -2329,7 +2333,7 @@ QString MainWindow::fullDescription(unsigned int key) const
switch (key) {
case PROBLEM_PLUGINSNOTLOADED: {
QString result = tr("The following plugins could not be loaded. The reason may be missing dependencies (i.e. python) or an outdated version:") + "<ul>";
- foreach (const QString &plugin, m_UnloadedPlugins) {
+ foreach (const QString &plugin, m_FailedPlugins) {
result += "<li>" + plugin + "</li>";
}
result += "<ul>";
@@ -5390,13 +5394,10 @@ void MainWindow::processLOOTOut(const std::string &lootOut, std::string &reportU
foreach (const std::string &line, lines) {
if (line.length() > 0) {
- size_t progidx = line.find("[progress]");
- size_t reportidx = line.find("[Report]");
- size_t erroridx = line.find("[error]");
+ size_t progidx = line.find("[progress]");
+ size_t erroridx = line.find("[error]");
if (progidx != std::string::npos) {
dialog.setLabelText(line.substr(progidx + 11).c_str());
- } else if (reportidx != std::string::npos) {
- reportURL = line.substr(reportidx + 9);
} else if (erroridx != std::string::npos) {
qWarning("%s", line.c_str());
errorMessages.append(boost::algorithm::trim_copy(line.substr(erroridx + 8)) + "\n");
@@ -5540,12 +5541,15 @@ void MainWindow::on_bossButton_clicked()
dialog.setMaximum(0);
dialog.show();
+ QString outPath = QDir::temp().absoluteFilePath("lootreport.json");
+
QStringList parameters;
parameters << "--unattended"
<< "--stdout"
<< "--noreport"
<< "--game" << ToQString(GameInfo::instance().getGameShortName())
- << "--gamePath" << QString("\"%1\"").arg(ToQString(GameInfo::instance().getGameDirectory()));
+ << "--gamePath" << QString("\"%1\"").arg(ToQString(GameInfo::instance().getGameDirectory()))
+ << "--out" << outPath;
if (m_DidUpdateMasterList) {
parameters << "--skipUpdateMasterlist";
@@ -5555,7 +5559,7 @@ void MainWindow::on_bossButton_clicked()
HANDLE stdOutWrite = INVALID_HANDLE_VALUE;
HANDLE stdOutRead = INVALID_HANDLE_VALUE;
createStdoutPipe(&stdOutRead, &stdOutWrite);
- HANDLE loot = startBinary(QFileInfo(qApp->applicationDirPath() + "/loot/LOOT.exe"),
+ HANDLE loot = startBinary(QFileInfo(qApp->applicationDirPath() + "/loot/lootcli.exe"),
parameters.join(" "),
m_CurrentProfile->getName(),
m_Settings.logLevel(),
@@ -5630,6 +5634,22 @@ void MainWindow::on_bossButton_clicked()
return;
} else {
success = true;
+ QFile outFile(outPath);
+ outFile.open(QIODevice::ReadOnly);
+ QJsonDocument doc = QJsonDocument::fromJson(outFile.readAll());
+ QJsonArray array = doc.array();
+ for (auto iter = array.begin(); iter != array.end(); ++iter) {
+ QJsonObject pluginObj = (*iter).toObject();
+ QJsonArray pluginMessages = pluginObj["messages"].toArray();
+ for (auto msgIter = pluginMessages.begin(); msgIter != pluginMessages.end(); ++msgIter) {
+ QJsonObject msg = (*msgIter).toObject();
+ m_PluginList.addInformation(pluginObj["name"].toString(),
+ QString("%1: %2").arg(msg["type"].toString(), msg["message"].toString()));
+ }
+ if (pluginObj["dirty"].toString() == "yes")
+ m_PluginList.addInformation(pluginObj["name"].toString(), "dirty");
+ }
+
}
} else {
reportError(tr("failed to start loot"));
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 8bd663ac..ea79fc37 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -381,7 +381,7 @@ private:
std::vector<MOBase::IPluginDiagnose*> m_DiagnosisPlugins;
std::vector<boost::signals2::connection> m_DiagnosisConnections;
std::vector<MOBase::IPluginModPage*> m_ModPages;
- std::vector<QString> m_UnloadedPlugins;
+ std::vector<QString> m_FailedPlugins;
std::vector<QPluginLoader*> m_PluginLoaders;
QFile m_PluginsCheck;
diff --git a/src/organizer.pro b/src/organizer.pro
index b24586e6..fd1e6aad 100644
--- a/src/organizer.pro
+++ b/src/organizer.pro
@@ -341,7 +341,7 @@ SRCDIR ~= s,/,$$QMAKE_DIR_SEP,g
DSTDIR ~= s,/,$$QMAKE_DIR_SEP,g
QMAKE_POST_LINK += xcopy /y /I $$quote($$SRCDIR\\ModOrganizer*.exe) $$quote($$DSTDIR) $$escape_expand(\\n)
-QMAKE_POST_LINK += xcopy /y /I $$quote($$SRCDIR\\ModOrganizer*.pdb) $$quote($$DSTDIR) $$escape_expand(\\n)
+QMAKE_POST_LINK += xcopy /y /I $$quote($$SRCDIR\\ModOrganizer*.exe) $$quote($$DSTDIR) $$escape_expand(\\n)
QMAKE_POST_LINK += xcopy /y /s /I $$quote($$BASEDIR\\stylesheets) $$quote($$DSTDIR)\\stylesheets $$escape_expand(\\n)
QMAKE_POST_LINK += xcopy /y /s /I $$quote($$BASEDIR\\tutorials) $$quote($$DSTDIR)\\tutorials $$escape_expand(\\n)
QMAKE_POST_LINK += xcopy /y /s /I $$quote($$BASEDIR\\*.qm) $$quote($$DSTDIR)\\translations $$escape_expand(\\n)
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp
index 973e3cfc..b2d02cd2 100644
--- a/src/pluginlist.cpp
+++ b/src/pluginlist.cpp
@@ -23,6 +23,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "settings.h"
#include "safewritefile.h"
#include "scopeguard.h"
+#include "modinfo.h"
#include <utility.h>
#include <gameinfo.h>
#include <espfile.h>
@@ -158,7 +159,14 @@ void PluginList::refresh(const QString &profileName, const DirectoryEntry &baseD
QString iniPath = QFileInfo(filename).baseName() + ".ini";
bool hasIni = baseDirectory.findFile(ToWString(iniPath)).get() != NULL;
- m_ESPs.push_back(ESPInfo(filename, forceEnabled, current->getFileTime(), ToQString(origin.getName()), ToQString(current->getFullPath()), hasIni));
+ QString originName = ToQString(origin.getName());
+ unsigned int modIndex = ModInfo::getIndex(originName);
+ if (modIndex != UINT_MAX) {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex);
+ originName = modInfo->name();
+ }
+
+ m_ESPs.push_back(ESPInfo(filename, forceEnabled, current->getFileTime(), originName, ToQString(current->getFullPath()), hasIni));
} catch (const std::exception &e) {
reportError(tr("failed to update esp info for file %1 (source id: %2), error: %3").arg(filename).arg(current->getOrigin(archive)).arg(e.what()));
}
@@ -290,6 +298,8 @@ void PluginList::addInformation(const QString &name, const QString &message)
if (iter != m_ESPsByName.end()) {
m_AdditionalInfo[name.toLower()].m_Messages.append(message);
+ } else {
+ qWarning("failed to associate message for \"%s\"", qPrintable(name));
}
}
diff --git a/src/settings.cpp b/src/settings.cpp
index 3b28c788..274e5979 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -231,7 +231,7 @@ QString Settings::getModDirectory() const
QString Settings::getNMMVersion() const
{
- static const QString MIN_NMM_VERSION = "0.52.2";
+ static const QString MIN_NMM_VERSION = "0.52.3";
QString result = m_Settings.value("Settings/nmm_version", MIN_NMM_VERSION).toString();
if (VersionInfo(result) < VersionInfo(MIN_NMM_VERSION)) {
result = MIN_NMM_VERSION;
diff --git a/src/shared/util.cpp b/src/shared/util.cpp
index 4bc5a8a4..d4a77929 100644
--- a/src/shared/util.cpp
+++ b/src/shared/util.cpp
@@ -71,7 +71,9 @@ std::string ToString(const std::wstring &source, bool utf8)
if (sizeRequired == 0) {
throw windows_error("failed to convert string to multibyte");
}
- result.resize(sizeRequired, '\0');
+ // the size returned by WideCharToMultiByte contains zero termination IF -1 is specified for the length.
+ // we don't want that \0 in the string because then the length field would be wrong. Because madness
+ result.resize(sizeRequired - 1, '\0');
::WideCharToMultiByte(codepage, 0, &source[0], (int)source.size(), &result[0], sizeRequired, NULL, NULL);
return result;
}
@@ -117,14 +119,15 @@ std::wstring ToLower(const std::wstring &text)
VS_FIXEDFILEINFO GetFileVersion(const std::wstring &fileName)
{
- DWORD size = ::GetFileVersionInfoSizeW(fileName.c_str(), NULL);
+ DWORD handle;
+ DWORD size = ::GetFileVersionInfoSizeW(fileName.c_str(), &handle);
if (size == 0) {
throw windows_error("failed to determine file version info size");
}
void *buffer = new char[size];
try {
- if (!::GetFileVersionInfoW(fileName.c_str(), 0UL, size, buffer)) {
+ if (!::GetFileVersionInfoW(fileName.c_str(), handle, size, buffer)) {
throw windows_error("failed to determine file version info");
}