1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 18:45:38 +00:00

fixed merge conflicts

Merge branch 'saving' of https://github.com/zinnschlag/openmw into esxSelector

Conflicts:
	apps/launcher/datafilespage.cpp
	apps/launcher/settings/gamesettings.hpp
	components/contentselector/model/contentmodel.cpp
This commit is contained in:
graffy76 2013-11-02 09:31:23 -05:00
commit 8d12e2b99d
4 changed files with 47 additions and 25 deletions

View file

@ -262,19 +262,11 @@ bool Launcher::MainDialog::showFirstRunDialog()
// Add a new profile // Add a new profile
if (msgBox.isChecked()) { if (msgBox.isChecked()) {
mLauncherSettings.setValue(QString("Profiles/currentprofile"), QString("Imported")); mLauncherSettings.setValue(QString("Profiles/currentprofile"), QString("Imported"));
mLauncherSettings.remove(QString("Profiles/Imported/content"));
mLauncherSettings.remove(QString("Profiles/Imported/master")); QStringList contents = mGameSettings.values(QString("content"));
mLauncherSettings.remove(QString("Profiles/Imported/plugin")); foreach (const QString &content, contents) {
mLauncherSettings.setMultiValue(QString("Profiles/Imported/content"), content);
QStringList masters = mGameSettings.values(QString("master"));
QStringList plugins = mGameSettings.values(QString("plugin"));
foreach (const QString &master, masters) {
mLauncherSettings.setMultiValue(QString("Profiles/Imported/master"), master);
}
foreach (const QString &plugin, plugins) {
mLauncherSettings.setMultiValue(QString("Profiles/Imported/plugin"), plugin);
} }
} }

View file

@ -139,13 +139,13 @@ bool Launcher::GameSettings::writeFile(QTextStream &stream)
while (i.hasPrevious()) { while (i.hasPrevious()) {
i.previous(); i.previous();
if (i.key() == QLatin1String("master") || i.key() == QLatin1String("plugin")) if (i.key() == QLatin1String("content"))
continue; continue;
// Quote paths with spaces // Quote paths with spaces
if (i.key() == QLatin1String("data") if (i.key() == QLatin1String("data")
|| i.key() == QLatin1String("data-local") || i.key() == QLatin1String("data-local")
|| i.key() == QLatin1String("resources")) || i.key() == QLatin1String("resources"))
{ {
if (i.value().contains(QChar(' '))) if (i.value().contains(QChar(' ')))
{ {
@ -161,15 +161,24 @@ bool Launcher::GameSettings::writeFile(QTextStream &stream)
} }
QStringList masters = mSettings.values(QString("master")); QStringList content = mSettings.values(QString("content"));
for (int i = masters.count(); i--;) { for (int i = content.count(); i--;) {
stream << "content=" << masters.at(i) << "\n"; stream << "content=" << content.at(i) << "\n";
}
QStringList plugins = mSettings.values(QString("plugin"));
for (int i = plugins.count(); i--;) {
stream << "content=" << plugins.at(i) << "\n";
} }
return true; return true;
} }
bool GameSettings::hasMaster()
{
bool result = false;
QStringList content = mSettings.values(QString("content"));
for (int i = 0; i < content.count(); ++i) {
if (content.at(i).contains(".omwgame") || content.at(i).contains(".esm")) {
result = true;
break;
}
}
return result;
}

View file

@ -8,8 +8,11 @@
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
namespace Files { typedef std::vector<boost::filesystem::path> PathContainer; namespace Files
struct ConfigurationManager;} {
typedef std::vector<boost::filesystem::path> PathContainer;
struct ConfigurationManager;
}
namespace Launcher namespace Launcher
{ {
@ -42,6 +45,12 @@ namespace Launcher
mSettings.remove(key); mSettings.remove(key);
} }
inline QStringList getDataDirs() { return mDataDirs; }
inline void addDataDir(const QString &dir) { if(!dir.isEmpty()) mDataDirs.append(dir); }
inline QString getDataLocal() {return mDataLocal; }
bool hasMaster();
inline QStringList getDataDirs() { return mDataDirs; } inline QStringList getDataDirs() { return mDataDirs; }
inline void addDataDir(const QString &dir) { if(!dir.isEmpty()) mDataDirs.append(dir); } inline void addDataDir(const QString &dir) { if(!dir.isEmpty()) mDataDirs.append(dir); }
inline QString getDataLocal() {return mDataLocal; } inline QString getDataLocal() {return mDataLocal; }

View file

@ -565,9 +565,21 @@ ContentSelectorModel::ContentFileList ContentSelectorModel::ContentModel::checke
{ {
ContentFileList list; ContentFileList list;
// First search for game files and next addons,
// so we get more or less correct game files vs addons order.
foreach (EsmFile *file, mFiles) foreach (EsmFile *file, mFiles)
{ {
<<<<<<< HEAD
if (isChecked(file->filePath())) if (isChecked(file->filePath()))
=======
if (isChecked(file->fileName()) && file->isGameFile())
list << file;
}
foreach (EsmFile *file, mFiles)
{
if (isChecked(file->fileName()) && !file->isGameFile())
>>>>>>> f5fbe7361fad698e8dd3330e9820a157800be8ae
list << file; list << file;
} }