summaryrefslogtreecommitdiff
path: root/src/transfersavesdialog.h
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-12-13 18:30:40 +0000
committerThomas Tanner <trtanner@btinternet.com>2015-12-13 18:30:40 +0000
commitba176e5e9b639ac0770192987833a3b40e71409a (patch)
tree2c1a82d3fcede23e82bddf5b31768e03982d8950 /src/transfersavesdialog.h
parentc344714661a2404a54428439f0cf7dbb1573d01f (diff)
Remove dependency of TransferSave on SaveGameBryo, part of fix for #418
Added a method to Profile class to get location of save games for the profile. I haven't added this to IProfile as am in two minds. Aside from this have done cleanups of issues suggested by include-what-you-use, and some OCD sorting of #includes
Diffstat (limited to 'src/transfersavesdialog.h')
-rw-r--r--src/transfersavesdialog.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/transfersavesdialog.h b/src/transfersavesdialog.h
index e2c556b4..d3f079e3 100644
--- a/src/transfersavesdialog.h
+++ b/src/transfersavesdialog.h
@@ -23,10 +23,19 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "tutorabledialog.h"
#include "profile.h"
+class QListWidget;
+#include <QObject>
+class QPushButton;
+#include <QString>
+class QWidget;
+
+#include <memory>
+#include <map>
+#include <vector>
+
namespace Ui { class TransferSavesDialog; }
namespace MOBase { class IPluginGame; }
-
-class SaveGame;
+namespace MOBase { class ISaveGame; }
class TransferSavesDialog : public MOBase::TutorableDialog
{
@@ -76,8 +85,25 @@ private:
MOBase::IPluginGame const *m_GamePlugin;
- std::vector<SaveGame*> m_GlobalSaves;
- std::vector<SaveGame*> m_LocalSaves;
+ typedef std::unique_ptr<MOBase::ISaveGame const> SaveListItem;
+ typedef std::vector<SaveListItem> SaveList;
+ typedef std::map<QString, SaveList> SaveCollection;
+ SaveCollection m_GlobalSaves;
+ SaveCollection m_LocalSaves;
+
+ void refreshSaves(SaveCollection &saveCollection, const QString &savedir);
+ void refreshCharacters(SaveCollection const &saveCollection,
+ QListWidget *charList,
+ QPushButton *copy,
+ QPushButton *move);
+
+ bool transferCharacters(QString const &character,
+ char const *message,
+ SaveList &saves,
+ QString const &dest,
+ bool (method)(QString const &, QString const &),
+ char const *errmsg
+ );
};