summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-07-15 17:48:43 +0200
committerTannin <devnull@localhost>2014-07-15 17:48:43 +0200
commit434b6be69dd425504c293866fd4f9d7556ec7342 (patch)
tree262ddf986f6522443fbe79f4feaed28b93cac33c /src
parent84c66727bff954fd0820fc9f33833848496e9531 (diff)
parentbfb3385e4932530928cff5a94ad56d8f30e5babe (diff)
merged changes by TheBloke
Diffstat (limited to 'src')
-rw-r--r--src/ModOrganizer.pro29
-rw-r--r--src/mainwindow.cpp48
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/mainwindow.ui6
-rw-r--r--src/organizer.pro104
-rw-r--r--src/savegame.cpp148
-rw-r--r--src/savegame.h219
-rw-r--r--src/savegamegamebryo.cpp11
-rw-r--r--src/savegamegamebyro.h171
-rw-r--r--src/shared/shared.pro6
-rw-r--r--src/transfersavesdialog.cpp15
-rw-r--r--src/transfersavesdialog.h1
12 files changed, 410 insertions, 350 deletions
diff --git a/src/ModOrganizer.pro b/src/ModOrganizer.pro
index 253fe23f..0d75e883 100644
--- a/src/ModOrganizer.pro
+++ b/src/ModOrganizer.pro
@@ -21,7 +21,32 @@ hookdll.depends = shared
organizer.depends = shared uibase plugins# loot_cli
CONFIG(debug, debug|release) {
- DESTDIR = outputd
+ DESTDIR = $$PWD/../outputd
} else {
- DESTDIR = output
+ DESTDIR = $$PWD/../output
}
+
+STATICDATAPATH = $${DESTDIR}\\..\\tools\\static_data\\dlls
+DLLSPATH = $${DESTDIR}\\dlls
+
+otherlibs.path = $$DLLSPATH
+otherlibs.files += $${STATICDATAPATH}\\7z.dll \
+ $$(BOOSTPATH)\\stage\\lib\\boost_python-vc*-mt-1*.dll
+
+qtlibs.path = $$DLLSPATH
+
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QTLIBNAMES += Core Gui Network OpenGL Script Sql Svg Qml Quick Webkit Widgets Xml XmlPatterns
+} else {
+ QTLIBNAMES += Core Declarative Gui Network OpenGL Script Sql Svg Webkit Xml XmlPatterns
+}
+
+QTLIBSUFFIX = $${QT_MAJOR_VERSION}.dll
+CONFIG(debug, debug|release): QTLIBSUFFIX = "d$${QTLIBSUFFIX}" # Can't use Debug: .. here, it ignores the line - no idea why, as it works in BossDummy.pro
+
+for(QTNAME, QTLIBNAMES) {
+ QTFILE = Qt$${QTNAME}
+ qtlibs.files += $$[QT_INSTALL_BINS]\\$${QTFILE}$${QTLIBSUFFIX}
+}
+
+INSTALLS += qtlibs otherlibs
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ce5ae865..f684fd82 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -3932,26 +3932,39 @@ void MainWindow::on_categoriesList_itemSelectionChanged()
void MainWindow::deleteSavegame_clicked()
{
- QListWidgetItem *selectedItem = ui->savegameList->item(m_SelectedSaveGame);
- if (selectedItem == NULL) {
- return;
+ QModelIndexList selectedIndexes = ui->savegameList->selectionModel()->selectedIndexes();
+
+ QString savesMsgLabel;
+ QRegExp saveSuffix(".ess$");
+ QStringList deleteFiles;
+
+ foreach (const QModelIndex &idx, selectedIndexes) {
+ QString name = idx.data().toString();
+ SaveGame *save = new SaveGame(this, idx.data(Qt::UserRole).toString());
+
+ savesMsgLabel += "<li>" + name.replace(saveSuffix, "") + "</li>";
+
+ deleteFiles << save->saveFiles();
}
- QString fileName = selectedItem->data(Qt::UserRole).toString();
+ bool multipleRows = (selectedIndexes.count() > 1);
- if (QMessageBox::question(this, tr("Confirm"), tr("Really delete \"%1\"?").arg(selectedItem->text()),
+ if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure you want to remove the following %1save%2?<br><ul>%3</ul><br>Removed saves will be sent to the Recycle Bin.")
+ .arg((multipleRows) ? QString::number(selectedIndexes.count()) + " " : "")
+ .arg((multipleRows) ? "s" : "")
+ .arg(savesMsgLabel),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
- shellDelete(QStringList() << fileName);
+ shellDelete(deleteFiles, true); // recycle bin delete.
}
}
void MainWindow::fixMods_clicked()
{
- QListWidgetItem *selectedItem = ui->savegameList->item(m_SelectedSaveGame);
- if (selectedItem == NULL) {
+ QListWidgetItem *selectedItem = ui->savegameList->currentItem();
+
+ if (selectedItem == NULL)
return;
- }
// if required, parse the save game
if (selectedItem->data(Qt::UserRole).isNull()) {
@@ -4042,16 +4055,21 @@ void MainWindow::fixMods_clicked()
void MainWindow::on_savegameList_customContextMenuRequested(const QPoint &pos)
{
- QListWidgetItem *selectedItem = ui->savegameList->itemAt(pos);
- if (selectedItem == NULL) {
+ QItemSelectionModel *selection = ui->savegameList->selectionModel();
+
+ if (!selection->hasSelection())
return;
- }
- m_SelectedSaveGame = ui->savegameList->row(selectedItem);
+ bool multipleSelected = (selection->selectedIndexes().count() > 1);
QMenu menu;
- menu.addAction(tr("Fix Mods..."), this, SLOT(fixMods_clicked()));
- menu.addAction(tr("Delete"), this, SLOT(deleteSavegame_clicked()));
+
+ if (!multipleSelected)
+ menu.addAction(tr("Fix Mods..."), this, SLOT(fixMods_clicked()));
+
+ QString deleteMenuLabel = tr("Delete save%1").arg((multipleSelected) ? "s" : "");
+
+ menu.addAction(deleteMenuLabel, this, SLOT(deleteSavegame_clicked()));
menu.exec(ui->savegameList->mapToGlobal(pos));
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index ef111078..89e883f9 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -336,7 +336,7 @@ private:
QTreeWidgetItem *m_ContextItem;
QAction *m_ContextAction;
- int m_SelectedSaveGame;
+ //int m_SelectedSaveGame;
Settings m_Settings;
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index 1a45e21b..4201babf 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -1100,6 +1100,12 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;If you click &amp;quot;Fix Mods...&amp;quot; in the context menu, MO will try to activate all mods and esps to fix those missing esps. It will not disable anything!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
</widget>
</item>
</layout>
diff --git a/src/organizer.pro b/src/organizer.pro
index 17618377..de7a3a35 100644
--- a/src/organizer.pro
+++ b/src/organizer.pro
@@ -5,15 +5,15 @@
#-------------------------------------------------
-contains(QT_VERSION, "^5.*") {
+TARGET = ModOrganizer
+TEMPLATE = app
+
+greaterThan(QT_MAJOR_VERSION, 4) {
QT += core gui widgets network xml sql xmlpatterns qml quick script webkit
} else {
QT += core gui network xml declarative script sql xmlpatterns webkit
}
-TARGET = ModOrganizer
-TEMPLATE = app
-
SOURCES += \
transfersavesdialog.cpp \
syncoverwritedialog.cpp \
@@ -204,28 +204,68 @@ FORMS += \
browserdialog.ui \
aboutdialog.ui
+RESOURCES += \
+ resources.qrc \
+ stylesheet_resource.qrc
+
+RC_FILE += \
+ app_icon.rc
+
+OTHER_FILES += \
+ version.rc \
+ tutorials/firststeps.qml \
+ tutorials/tutorials.js \
+ tutorials/tutorial_firststeps_main.js \
+ tutorials/tutorials_settingsdialog.qml \
+ tutorials/tutorials_mainwindow.qml \
+ tutorials/Highlight.qml \
+ tutorials/TutorialDescription.qml \
+ tutorials/TutorialOverlay.qml \
+ tutorials/tutorials_nexusdialog.qml \
+ tutorials/tutorials_modinfodialog.qml \
+ tutorials/tutorial_firststeps_modinfo.js \
+ tutorials/tutorial_conflictresolution_main.js \
+ tutorials/tutorial_conflictresolution_modinfo.js \
+ app_icon.rc \
+ dark.qss \
+ stylesheets/dark.qss \
+ tutorials/tutorial_window_installer.js \
+ tutorials/tutorials_installdialog.qml \
+ tutorials/tutorial_firststeps_settings.js
+
+
+# leak detection with vld
+#INCLUDEPATH += "E:/Visual Leak Detector/include"
+#LIBS += -L"E:/Visual Leak Detector/lib/Win32"
+#DEFINES += LEAK_CHECK_WITH_VLD
+
+#SOURCES += modeltest.cpp
+#HEADERS += modeltest.h
+#DEFINES += TEST_MODELS
+
+
INCLUDEPATH += ../shared ../archive ../uibase ../bsatk ../esptk ../boss_modified/boss-api "$(BOOSTPATH)"
LIBS += -L"$(BOOSTPATH)/stage/lib"
CONFIG(debug, debug|release) {
- OUTDIR = $$OUT_PWD/debug
- DSTDIR = $$PWD/../../outputd
LIBS += -L$$OUT_PWD/../shared/debug
LIBS += -L$$OUT_PWD/../bsatk/debug
LIBS += -L$$OUT_PWD/../uibase/debug
LIBS += -L$$OUT_PWD/../boss_modified/debug
LIBS += -lDbgHelp
+ PRE_TARGETDEPS += $$OUT_PWD/../shared/debug/mo_shared.lib \
+ $$OUT_PWD/../bsatk/debug/bsatk.lib
} else {
- OUTDIR = $$OUT_PWD/release
- DSTDIR = $$PWD/../../output
LIBS += -L$$OUT_PWD/../shared/release
LIBS += -L$$OUT_PWD/../bsatk/release
- LIBS += -L$$OUT_PWD/../uibase/release
+ LIBS += -L$$OUT_PWD/../uibase/release
LIBS += -L$$OUT_PWD/../boss_modified/release
QMAKE_CXXFLAGS += /Zi /GL
# QMAKE_CXXFLAGS -= -O2
QMAKE_LFLAGS += /DEBUG /LTCG /OPT:REF /OPT:ICF
+ PRE_TARGETDEPS += $$OUT_PWD/../shared/release/mo_shared.lib \
+ $$OUT_PWD/../bsatk/release/bsatk.lib
}
#QMAKE_CXXFLAGS_WARN_ON -= -W3
@@ -278,6 +318,13 @@ DEFINES += BOOST_DISABLE_ASSERTS NDEBUG
HGID = $$system(hg id -i)
DEFINES += HGID=\\\"$${HGID}\\\"
+CONFIG(debug, debug|release) {
+ OUTDIR = $$OUT_PWD/debug
+ DSTDIR = $$PWD/../../outputd
+} else {
+ OUTDIR = $$OUT_PWD/release
+ DSTDIR = $$PWD/../../output
+}
SRCDIR = $$PWD
SRCDIR ~= s,/,$$QMAKE_DIR_SEP,g
@@ -297,42 +344,3 @@ CONFIG(debug, debug|release) {
} else {
QMAKE_POST_LINK += xcopy /y /s /I $$quote($$SRCDIR\\..\\dlls.*manifest) $$quote($$DSTDIR)\\dlls $$escape_expand(\\n)
}
-
-RESOURCES += \
- resources.qrc \
- stylesheet_resource.qrc
-
-RC_FILE += \
- app_icon.rc
-
-OTHER_FILES += \
- version.rc \
- tutorials/firststeps.qml \
- tutorials/tutorials.js \
- tutorials/tutorial_firststeps_main.js \
- tutorials/tutorials_settingsdialog.qml \
- tutorials/tutorials_mainwindow.qml \
- tutorials/Highlight.qml \
- tutorials/TutorialDescription.qml \
- tutorials/TutorialOverlay.qml \
- tutorials/tutorials_nexusdialog.qml \
- tutorials/tutorials_modinfodialog.qml \
- tutorials/tutorial_firststeps_modinfo.js \
- tutorials/tutorial_conflictresolution_main.js \
- tutorials/tutorial_conflictresolution_modinfo.js \
- app_icon.rc \
- dark.qss \
- stylesheets/dark.qss \
- tutorials/tutorial_window_installer.js \
- tutorials/tutorials_installdialog.qml \
- tutorials/tutorial_firststeps_settings.js
-
-
-# leak detection with vld
-#INCLUDEPATH += "E:/Visual Leak Detector/include"
-#LIBS += -L"E:/Visual Leak Detector/lib/Win32"
-#DEFINES += LEAK_CHECK_WITH_VLD
-
-#SOURCES += modeltest.cpp
-#HEADERS += modeltest.h
-#DEFINES += TEST_MODELS
diff --git a/src/savegame.cpp b/src/savegame.cpp
index 0ddd5fd2..d09f291c 100644
--- a/src/savegame.cpp
+++ b/src/savegame.cpp
@@ -17,68 +17,86 @@ You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "savegame.h"
-#include <QFile>
-#include <QBuffer>
-#include <set>
-#include "gameinfo.h"
-#include <QFileInfo>
-#include <QDateTime>
-#include <limits>
-
-
-SaveGame::SaveGame(QObject *parent)
- : QObject(parent), m_FileName(), m_PCName(), m_PCLevel(0), m_PCLocation(), m_SaveNumber(0), m_Screenshot()
-{
-}
-
-
-SaveGame::SaveGame(QObject *parent, const QString &filename)
- : QObject(parent), m_FileName(filename), m_PCName(), m_PCLevel(0), m_PCLocation(), m_SaveNumber(0), m_Screenshot()
-{
-}
-
-
-SaveGame::SaveGame(const SaveGame& reference)
- : m_FileName(reference.m_FileName), m_PCName(reference.m_PCName), m_PCLevel(reference.m_PCLevel),
- m_PCLocation(reference.m_PCLocation), m_SaveNumber(reference.m_SaveNumber),
- m_Screenshot(reference.m_Screenshot)
-{
-}
-
-
-SaveGame& SaveGame::operator=(const SaveGame &reference)
-{
- if (&reference != this) {
- m_FileName = reference.m_FileName;
- m_PCName = reference.m_PCName;
- m_PCLevel = reference.m_PCLevel;
- m_PCLocation = reference.m_PCLocation;
- m_SaveNumber = reference.m_SaveNumber;
- m_Screenshot = reference.m_Screenshot;
- }
- return *this;
-}
-
-
-SaveGame::~SaveGame()
-{
-}
-
-
-void SaveGame::setCreationTime(const QString &fileName)
-{
- QFileInfo creationTime(fileName);
- QDateTime modified = creationTime.lastModified();
- memset(&m_CreationTime, 0, sizeof(SYSTEMTIME));
-
- m_CreationTime.wDay = static_cast<WORD>(modified.date().day());
- m_CreationTime.wDayOfWeek = static_cast<WORD>(modified.date().dayOfWeek());
- m_CreationTime.wMonth = static_cast<WORD>(modified.date().month());
- m_CreationTime.wYear =static_cast<WORD>( modified.date().year());
-
- m_CreationTime.wHour = static_cast<WORD>(modified.time().hour());
- m_CreationTime.wMinute = static_cast<WORD>(modified.time().minute());
- m_CreationTime.wSecond = static_cast<WORD>(modified.time().second());
- m_CreationTime.wMilliseconds = static_cast<WORD>(modified.time().msec());
-}
+#include "savegame.h"
+#include <QFile>
+#include <QBuffer>
+#include <set>
+#include "gameinfo.h"
+#include <QFileInfo>
+#include <QDateTime>
+#include <limits>
+
+
+SaveGame::SaveGame(QObject *parent)
+ : QObject(parent), m_FileName(), m_PCName(), m_PCLevel(0), m_PCLocation(), m_SaveNumber(0), m_Screenshot()
+{
+}
+
+
+SaveGame::SaveGame(QObject *parent, const QString &filename)
+ : QObject(parent), m_FileName(filename), m_PCName(), m_PCLevel(0), m_PCLocation(), m_SaveNumber(0), m_Screenshot()
+{
+}
+
+
+SaveGame::SaveGame(const SaveGame& reference)
+ : m_FileName(reference.m_FileName), m_PCName(reference.m_PCName), m_PCLevel(reference.m_PCLevel),
+ m_PCLocation(reference.m_PCLocation), m_SaveNumber(reference.m_SaveNumber),
+ m_Screenshot(reference.m_Screenshot)
+{
+}
+
+
+SaveGame& SaveGame::operator=(const SaveGame &reference)
+{
+ if (&reference != this) {
+ m_FileName = reference.m_FileName;
+ m_PCName = reference.m_PCName;
+ m_PCLevel = reference.m_PCLevel;
+ m_PCLocation = reference.m_PCLocation;
+ m_SaveNumber = reference.m_SaveNumber;
+ m_Screenshot = reference.m_Screenshot;
+ }
+ return *this;
+}
+
+
+SaveGame::~SaveGame()
+{
+}
+
+QStringList SaveGame::attachedFiles() const
+{
+ QStringList result;
+ QString seFileFile = fileName().mid(0).replace(".ess", ".skse");
+ QFileInfo seFile(seFileFile);
+ if (seFile.exists()) {
+ result.append(seFile.absoluteFilePath());
+ }
+ return result;
+}
+
+QStringList SaveGame::saveFiles() const
+{
+ QStringList result = attachedFiles();
+ result.append(fileName());
+ return result;
+}
+
+
+void SaveGame::setCreationTime(const QString &fileName)
+{
+ QFileInfo creationTime(fileName);
+ QDateTime modified = creationTime.lastModified();
+ memset(&m_CreationTime, 0, sizeof(SYSTEMTIME));
+
+ m_CreationTime.wDay = static_cast<WORD>(modified.date().day());
+ m_CreationTime.wDayOfWeek = static_cast<WORD>(modified.date().dayOfWeek());
+ m_CreationTime.wMonth = static_cast<WORD>(modified.date().month());
+ m_CreationTime.wYear =static_cast<WORD>( modified.date().year());
+
+ m_CreationTime.wHour = static_cast<WORD>(modified.time().hour());
+ m_CreationTime.wMinute = static_cast<WORD>(modified.time().minute());
+ m_CreationTime.wSecond = static_cast<WORD>(modified.time().second());
+ m_CreationTime.wMilliseconds = static_cast<WORD>(modified.time().msec());
+}
diff --git a/src/savegame.h b/src/savegame.h
index e3eb8546..9a5f7036 100644
--- a/src/savegame.h
+++ b/src/savegame.h
@@ -17,110 +17,115 @@ You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SAVEGAME_H
-#define SAVEGAME_H
-
-
-#include <QString>
-#include <QObject>
-#include <QImage>
-#include <QMetaType>
-#include <QFile>
-#include <QStringList>
-
-#define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
-
-
-/**
- * @brief represents a single save game
- **/
-class SaveGame : public QObject {
-
-Q_OBJECT
-
-public:
-
- /**
- * @brief construct an empty object
- **/
- SaveGame(QObject *parent = 0);
-
- /**
- * @brief construct a save game and immediately read out information from the file
- *
- * @param filename absolute path of the save game file
- **/
- SaveGame(QObject *parent, const QString &filename);
-
- SaveGame(const SaveGame& reference);
-
- SaveGame& operator=(const SaveGame &reference);
-
- ~SaveGame();
-
- /**
- * @brief read out information from a savegame
- *
- * @param fileName absolute path of the save game file
- **/
- virtual void readFile(const QString &fileName) = 0;
-
- /**
- * @return filename of this savegame
- */
- const QString &fileName() const { return m_FileName; }
-
- /**
- * @return a list of additional files that belong to this savegame
- */
- virtual QStringList attachedFiles() const { return QStringList(); }
-
- /**
- * @return name of the player character
- **/
- const QString &pcName() const { return m_PCName; }
-
- /**
- * @return level of the player character
- **/
- unsigned short pcLevel() const { return m_PCLevel; }
-
- /**
- * @return location of the player character
- **/
- const QString &pcLocation() const { return m_PCLocation; }
-
- /**
- * @return index of the save game
- **/
- unsigned long saveNumber() const { return m_SaveNumber; }
-
- /**
- * @return creation time of the save game
- **/
- SYSTEMTIME creationTime() const { return m_CreationTime; }
-
- /**
- * @return screenshot in the savegame
- **/
- const QImage &screenshot() const { return m_Screenshot; }
-
-private:
-
- void setCreationTime(const QString &fileName);
-
-protected:
-
- QString m_FileName;
- QString m_PCName;
- unsigned short m_PCLevel;
- QString m_PCLocation;
- unsigned long m_SaveNumber;
- SYSTEMTIME m_CreationTime;
- QImage m_Screenshot;
-
-};
-
-
-#endif // SAVEGAME_H
+#ifndef SAVEGAME_H
+#define SAVEGAME_H
+
+
+#include <QString>
+#include <QObject>
+#include <QImage>
+#include <QMetaType>
+#include <QFile>
+#include <QStringList>
+
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+
+
+/**
+ * @brief represents a single save game
+ **/
+class SaveGame : public QObject {
+
+Q_OBJECT
+
+public:
+
+ /**
+ * @brief construct an empty object
+ **/
+ SaveGame(QObject *parent = 0);
+
+ /**
+ * @brief construct a save game and immediately read out information from the file
+ *
+ * @param filename absolute path of the save game file
+ **/
+ SaveGame(QObject *parent, const QString &filename);
+
+ SaveGame(const SaveGame& reference);
+
+ SaveGame& operator=(const SaveGame &reference);
+
+ ~SaveGame();
+
+ /**
+ * @brief read out information from a savegame
+ *
+ * @param fileName absolute path of the save game file
+ **/
+ virtual void readFile(const QString) { }
+
+ /**
+ * @return filename of this savegame
+ */
+ const QString &fileName() const { return m_FileName; }
+
+ /**
+ * @return a list of additional files that belong to this savegame
+ */
+ virtual QStringList attachedFiles() const;
+
+ /**
+ * @return a list of all files that belong to this savegame
+ */
+ virtual QStringList saveFiles() const;
+
+ /**
+ * @return name of the player character
+ **/
+ const QString &pcName() const { return m_PCName; }
+
+ /**
+ * @return level of the player character
+ **/
+ unsigned short pcLevel() const { return m_PCLevel; }
+
+ /**
+ * @return location of the player character
+ **/
+ const QString &pcLocation() const { return m_PCLocation; }
+
+ /**
+ * @return index of the save game
+ **/
+ unsigned long saveNumber() const { return m_SaveNumber; }
+
+ /**
+ * @return creation time of the save game
+ **/
+ SYSTEMTIME creationTime() const { return m_CreationTime; }
+
+ /**
+ * @return screenshot in the savegame
+ **/
+ const QImage &screenshot() const { return m_Screenshot; }
+
+private:
+
+ void setCreationTime(const QString &fileName);
+
+protected:
+
+ QString m_FileName;
+ QString m_PCName;
+ unsigned short m_PCLevel;
+ QString m_PCLocation;
+ unsigned long m_SaveNumber;
+ SYSTEMTIME m_CreationTime;
+ QImage m_Screenshot;
+
+};
+
+
+#endif // SAVEGAME_H
diff --git a/src/savegamegamebryo.cpp b/src/savegamegamebryo.cpp
index f3794347..bf113254 100644
--- a/src/savegamegamebryo.cpp
+++ b/src/savegamegamebryo.cpp
@@ -117,16 +117,7 @@ SaveGameGamebryo::~SaveGameGamebryo()
}
-QStringList SaveGameGamebryo::attachedFiles() const
-{
- QStringList result;
- QString seFileFile = fileName().mid(0).replace(".ess", ".skse");
- QFileInfo seFile(seFileFile);
- if (seFile.exists()) {
- result.append(seFile.absoluteFilePath());
- }
- return result;
-}
+
void SaveGameGamebryo::readSkyrimFile(QFile &saveFile)
diff --git a/src/savegamegamebyro.h b/src/savegamegamebyro.h
index 25822b0c..70400636 100644
--- a/src/savegamegamebyro.h
+++ b/src/savegamegamebyro.h
@@ -17,91 +17,86 @@ You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SAVEGAMEGAMEBRYO_H
-#define SAVEGAMEGAMEBRYO_H
-
-
-#include "savegame.h"
-#include <gameinfo.h>
-#include <QString>
-#include <QObject>
-#include <QImage>
-#include <QMetaType>
-#include <QFile>
-
-#define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
-
-
-/**
- * @brief represents a single save game
- **/
-class SaveGameGamebryo : public SaveGame {
-
-Q_OBJECT
-
-public:
-
- /**
- * @brief construct an empty object
- **/
- SaveGameGamebryo(QObject *parent = 0);
-
- /**
- * @brief construct a save game and immediately read out information from the file
- *
- * @param filename absolute path of the save game file
- **/
- SaveGameGamebryo(QObject *parent, const QString &filename);
-
-
- SaveGameGamebryo(const SaveGameGamebryo &reference);
-
- SaveGameGamebryo &operator=(const SaveGameGamebryo &reference);
-
- ~SaveGameGamebryo();
-
- /**
- * @return a list of additional files that belong to this savegame
- */
- virtual QStringList attachedFiles() const;
-
- /**
- * @brief read out information from a savegame
- *
- * @param fileName absolute path of the save game file
- **/
- virtual void readFile(const QString &fileName);
-
- /**
- * @return number of plugins that were enabled when the save game was created
- **/
- int numPlugins() const { return m_Plugins.size(); }
-
- /**
- * retrieve the name of one of the plugins that were enabled when the save game
- * was created. valid indices are in the range between [0, numPlugins()[
- * @param index plugin index
- * @return name of the plugin
- **/
- const QString &plugin(int index) const { return m_Plugins.at(index); }
-
-
-private:
-
- void readESSFile(QFile &saveFile);
- void readFOSFile(QFile &saveFile, bool newVegas);
- void readSkyrimFile(QFile &saveFile);
-
- void setCreationTime(const QString &fileName);
-
-private:
-
- std::vector<QString> m_Plugins;
-
-};
-
-Q_DECLARE_METATYPE(SaveGameGamebryo)
-Q_DECLARE_METATYPE(SaveGameGamebryo*)
-
-#endif // SAVEGAMEGAMEBRYO_H
+#ifndef SAVEGAMEGAMEBRYO_H
+#define SAVEGAMEGAMEBRYO_H
+
+
+#include "savegame.h"
+#include <gameinfo.h>
+#include <QString>
+#include <QObject>
+#include <QImage>
+#include <QMetaType>
+#include <QFile>
+
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+
+
+/**
+ * @brief represents a single save game
+ **/
+class SaveGameGamebryo : public SaveGame {
+
+Q_OBJECT
+
+public:
+
+ /**
+ * @brief construct an empty object
+ **/
+ SaveGameGamebryo(QObject *parent = 0);
+
+ /**
+ * @brief construct a save game and immediately read out information from the file
+ *
+ * @param filename absolute path of the save game file
+ **/
+ SaveGameGamebryo(QObject *parent, const QString &filename);
+
+
+ SaveGameGamebryo(const SaveGameGamebryo &reference);
+
+ SaveGameGamebryo &operator=(const SaveGameGamebryo &reference);
+
+ ~SaveGameGamebryo();
+
+ /**
+ * @brief read out information from a savegame
+ *
+ * @param fileName absolute path of the save game file
+ **/
+ virtual void readFile(const QString &fileName);
+
+ /**
+ * @return number of plugins that were enabled when the save game was created
+ **/
+ int numPlugins() const { return m_Plugins.size(); }
+
+ /**
+ * retrieve the name of one of the plugins that were enabled when the save game
+ * was created. valid indices are in the range between [0, numPlugins()[
+ * @param index plugin index
+ * @return name of the plugin
+ **/
+ const QString &plugin(int index) const { return m_Plugins.at(index); }
+
+
+private:
+
+ void readESSFile(QFile &saveFile);
+ void readFOSFile(QFile &saveFile, bool newVegas);
+ void readSkyrimFile(QFile &saveFile);
+
+ void setCreationTime(const QString &fileName);
+
+private:
+
+ std::vector<QString> m_Plugins;
+
+};
+
+Q_DECLARE_METATYPE(SaveGameGamebryo)
+Q_DECLARE_METATYPE(SaveGameGamebryo*)
+
+#endif // SAVEGAMEGAMEBRYO_H
diff --git a/src/shared/shared.pro b/src/shared/shared.pro
index 992fd7f2..c5925c24 100644
--- a/src/shared/shared.pro
+++ b/src/shared/shared.pro
@@ -21,11 +21,13 @@ INCLUDEPATH += ../bsatk "$(BOOSTPATH)"
CONFIG(debug, debug|release) {
LIBS += -L$$OUT_PWD/../bsatk/debug
- LIBS += -lDbgHelp
+ LIBS += -lDbgHelp
QMAKE_CXXFLAGS_DEBUG -= -Zi
QMAKE_CXXFLAGS += -Z7
+ PRE_TARGETDEPS += $$OUT_PWD/../bsatk/debug/bsatk.lib
} else {
- LIBS += -L$$OUT_PWD/../bsatk/release
+ LIBS += -L$$OUT_PWD/../bsatk/release
+ PRE_TARGETDEPS += $$OUT_PWD/../bsatk/release/bsatk.lib
}
LIBS += -lbsatk
diff --git a/src/transfersavesdialog.cpp b/src/transfersavesdialog.cpp
index e69e4ab2..8e2b9b59 100644
--- a/src/transfersavesdialog.cpp
+++ b/src/transfersavesdialog.cpp
@@ -151,13 +151,6 @@ bool TransferSavesDialog::testOverwrite(OverwriteMode &overwriteMode, const QStr
return res == QMessageBox::Yes;
}
-QStringList TransferSavesDialog::getFilesToProcess(const SaveGame *save)
-{
- QStringList result = save->attachedFiles();
- result.append(save->fileName());
- return result;
-}
-
void TransferSavesDialog::on_moveToLocalBtn_clicked()
{
QString selectedCharacter = ui->globalCharacterList->currentItem()->text();
@@ -170,7 +163,7 @@ void TransferSavesDialog::on_moveToLocalBtn_clicked()
for (std::vector<SaveGame*>::const_iterator iter = m_GlobalSaves.begin();
iter != m_GlobalSaves.end(); ++iter) {
if ((*iter)->pcName() == selectedCharacter) {
- QStringList files = getFilesToProcess(*iter);
+ QStringList files = (*iter)->saveFiles();
foreach (const QString &file, files) {
QFileInfo fileInfo(file);
QString destinationFile = destination.mid(0).append("/").append(fileInfo.fileName());
@@ -207,7 +200,7 @@ void TransferSavesDialog::on_copyToLocalBtn_clicked()
for (std::vector<SaveGame*>::const_iterator iter = m_GlobalSaves.begin();
iter != m_GlobalSaves.end(); ++iter) {
if ((*iter)->pcName() == selectedCharacter) {
- QStringList files = getFilesToProcess(*iter);
+ QStringList files = (*iter)->saveFiles();
foreach (const QString &file, files) {
QFileInfo fileInfo(file);
QString destinationFile = destination.mid(0).append("/").append(fileInfo.fileName());
@@ -244,7 +237,7 @@ void TransferSavesDialog::on_moveToGlobalBtn_clicked()
for (std::vector<SaveGame*>::const_iterator iter = m_LocalSaves.begin();
iter != m_LocalSaves.end(); ++iter) {
if ((*iter)->pcName() == selectedCharacter) {
- QStringList files = getFilesToProcess(*iter);
+ QStringList files = (*iter)->saveFiles();
foreach (const QString &file, files) {
QFileInfo fileInfo(file);
QString destinationFile = destination.mid(0).append("/").append(fileInfo.fileName());
@@ -283,7 +276,7 @@ void TransferSavesDialog::on_copyToGlobalBtn_clicked()
for (std::vector<SaveGame*>::const_iterator iter = m_LocalSaves.begin();
iter != m_LocalSaves.end(); ++iter) {
if ((*iter)->pcName() == selectedCharacter) {
- QStringList files = getFilesToProcess(*iter);
+ QStringList files = (*iter)->saveFiles();
foreach (const QString &file, files) {
QFileInfo fileInfo(file);
QString destinationFile = destination.mid(0).append("/").append(fileInfo.fileName());
diff --git a/src/transfersavesdialog.h b/src/transfersavesdialog.h
index 923259f6..4306b960 100644
--- a/src/transfersavesdialog.h
+++ b/src/transfersavesdialog.h
@@ -67,7 +67,6 @@ private:
void refreshGlobalSaves();
void refreshLocalSaves();
bool testOverwrite(OverwriteMode &overwriteMode, const QString &destinationFile);
- QStringList getFilesToProcess(const SaveGame *save);
private: