diff options
Diffstat (limited to 'libs/installer_fomod/src')
| -rw-r--r-- | libs/installer_fomod/src/fomodinstallerdialog.cpp | 13 | ||||
| -rw-r--r-- | libs/installer_fomod/src/fomodinstallerdialog.h | 3 | ||||
| -rw-r--r-- | libs/installer_fomod/src/installerfomod.cpp | 3 |
3 files changed, 11 insertions, 8 deletions
diff --git a/libs/installer_fomod/src/fomodinstallerdialog.cpp b/libs/installer_fomod/src/fomodinstallerdialog.cpp index ef6c44f..0fa6bfc 100644 --- a/libs/installer_fomod/src/fomodinstallerdialog.cpp +++ b/libs/installer_fomod/src/fomodinstallerdialog.cpp @@ -77,12 +77,13 @@ bool PagesDescending(QGroupBox* LHS, QGroupBox* RHS) FomodInstallerDialog::FomodInstallerDialog( InstallerFomod* installer, const GuessedValue<QString>& modName, - const QString& fomodPath, + const QString& fomodPath, const QString& fomodDirName, const std::function<MOBase::IPluginList::PluginStates(const QString&)>& fileCheck, QWidget* parent) : QDialog(parent), ui(new Ui::FomodInstallerDialog), m_Installer(installer), - m_ModName(modName), m_ModID(-1), m_FomodPath(fomodPath), m_Manual(false), - m_FileCheck(fileCheck), m_FileSystemItemSequence() + m_ModName(modName), m_ModID(-1), m_FomodPath(fomodPath), + m_FomodDirName(fomodDirName), m_Manual(false), m_FileCheck(fileCheck), + m_FileSystemItemSequence() { ui->setupUi(this); setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint); @@ -235,7 +236,7 @@ void FomodInstallerDialog::readXml(QFile& file, void FomodInstallerDialog::readInfoXml() { - QFile file(QDir::tempPath() + "/" + m_FomodPath + "/fomod/info.xml"); + QFile file(QDir::tempPath() + "/" + m_FomodPath + "/" + m_FomodDirName + "/info.xml"); // We don't need a info.xml file, so we just return if we cannot open it: if (!file.open(QIODevice::ReadOnly)) { @@ -246,7 +247,7 @@ void FomodInstallerDialog::readInfoXml() void FomodInstallerDialog::readModuleConfigXml() { - QFile file(QDir::tempPath() + "/" + m_FomodPath + "/fomod/ModuleConfig.xml"); + QFile file(QDir::tempPath() + "/" + m_FomodPath + "/" + m_FomodDirName + "/ModuleConfig.xml"); if (!file.open(QIODevice::ReadOnly)) { throw Exception(tr("%1 missing.").arg(file.fileName())); } @@ -261,7 +262,7 @@ void FomodInstallerDialog::initData(IOrganizer* moInfo) readInfoXml(); QString screenshotPath = - QDir::tempPath() + "/" + m_FomodPath + "/fomod/screenshot.png"; + QDir::tempPath() + "/" + m_FomodPath + "/" + m_FomodDirName + "/screenshot.png"; if (!QImage(screenshotPath).isNull()) { ui->screenshotLabel->setScalableResource(screenshotPath); ui->screenshotExpand->setVisible(false); diff --git a/libs/installer_fomod/src/fomodinstallerdialog.h b/libs/installer_fomod/src/fomodinstallerdialog.h index bd9f975..1ebfe60 100644 --- a/libs/installer_fomod/src/fomodinstallerdialog.h +++ b/libs/installer_fomod/src/fomodinstallerdialog.h @@ -209,7 +209,7 @@ class FomodInstallerDialog : public QDialog, public IConditionTester public: explicit FomodInstallerDialog( InstallerFomod* installer, const MOBase::GuessedValue<QString>& modName, - const QString& fomodPath, + const QString& fomodPath, const QString& fomodDirName, const std::function<MOBase::IPluginList::PluginStates(const QString&)>& fileCheck, QWidget* parent = 0); ~FomodInstallerDialog(); @@ -453,6 +453,7 @@ private: int m_ModID; QString m_FomodPath; + QString m_FomodDirName; bool m_Manual; FileDescriptorList m_RequiredFiles; diff --git a/libs/installer_fomod/src/installerfomod.cpp b/libs/installer_fomod/src/installerfomod.cpp index 3558748..8be3ca3 100644 --- a/libs/installer_fomod/src/installerfomod.cpp +++ b/libs/installer_fomod/src/installerfomod.cpp @@ -217,8 +217,9 @@ InstallerFomod::install(GuessedValue<QString>& modName, std::shared_ptr<const IFileTree> fomodTree = findFomodDirectory(tree); QString fomodPath = fomodTree->parent()->path(); + QString fomodDirName = fomodTree->name(); FomodInstallerDialog dialog( - this, modName, fomodPath, + this, modName, fomodPath, fomodDirName, std::bind(&InstallerFomod::fileState, this, std::placeholders::_1)); dialog.initData(m_MOInfo); if (!dialog.getVersion().isEmpty()) { |
