From dc80bfff554404fa998d5b762da9afc62ed50f1d Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Tue, 4 Feb 2014 09:13:40 +0100 Subject: [PATCH] Attempt to get basic tablemimedata subclass. --- apps/opencs/model/world/tablemimedata.cpp | 21 +++++++++++++++++++++ apps/opencs/model/world/tablemimedata.hpp | 20 ++++++++++++++++++-- apps/opencs/view/world/table.cpp | 1 + 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/world/tablemimedata.cpp b/apps/opencs/model/world/tablemimedata.cpp index a8947394a..457f5af1b 100644 --- a/apps/opencs/model/world/tablemimedata.cpp +++ b/apps/opencs/model/world/tablemimedata.cpp @@ -1 +1,22 @@ #include "tablemimedata.hpp" +#include "universalid.hpp" + +CSMWorld::TableMimeData::TableMimeData (CSMWorld::UniversalId& UniversalId) : +mUniversalId(UniversalId) +{ + mSupportedFormats << UniversalId.toString().c_str(); +} + +QStringList CSMWorld::TableMimeData::formats() const +{ + return QMimeData::formats(); +} + +CSMWorld::TableMimeData::~TableMimeData() +{ +} + +CSMWorld::UniversalId& CSMWorld::TableMimeData::getId() +{ + return mUniversalId; +} diff --git a/apps/opencs/model/world/tablemimedata.hpp b/apps/opencs/model/world/tablemimedata.hpp index d96263ae2..d142c66c1 100644 --- a/apps/opencs/model/world/tablemimedata.hpp +++ b/apps/opencs/model/world/tablemimedata.hpp @@ -1,10 +1,26 @@ +/*This class provides way to construct mimedata object holding the reference to the +* universalid. universalid is used in the majority of the tables to store type, id, argument types*/ + #ifndef TABLEMIMEDATA_H #define TABLEMIMEDATA_H #include +#include -class TableMimeData : public QMimeData +namespace CSMWorld { -}; + class UniversalId; + class TableMimeData : public QMimeData + { + public: + TableMimeData(UniversalId& UniversalId); + ~TableMimeData(); + virtual QStringList formats() const; + UniversalId& getId(); + private: + QStringList mSupportedFormats; + UniversalId& mUniversalId; + }; +} #endif // TABLEMIMEDATA_H diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 71bdb9000..7d0255529 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -13,6 +13,7 @@ #include "../../model/world/idtable.hpp" #include "../../model/world/record.hpp" #include "../../model/world/columns.hpp" +#include "../../model/world/tablemimedata.hpp" #include "recordstatusdelegate.hpp" #include "util.hpp"