Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonzqt/dvmimedata.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qstringlist></qstringlist>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// DvMimedata
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
DvMimeData::DvMimeData() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
DvMimeData::~DvMimeData() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// cloneData
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
QMimeData *cloneData(const QMimeData *data) {
Shinya Kitaoka 120a6e
  const DvMimeData *dvData = dynamic_cast<const *="" dvmimedata="">(data);</const>
Shinya Kitaoka 120a6e
  if (dvData) return dvData->clone();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QMimeData *newData = new QMimeData();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QStringList list = data->formats();
Shinya Kitaoka 120a6e
  if (list.isEmpty()) return newData;
Shinya Kitaoka 120a6e
  QString format = list.first();
Shinya Kitaoka 120a6e
  if (format.isEmpty()) return newData;
Shinya Kitaoka 120a6e
  QByteArray byteArray = data->data(format);
Shinya Kitaoka 120a6e
  if (byteArray.isEmpty()) return newData;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  newData->setData(format, byteArray);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  return newData;
Toshihiro Shimizu 890ddd
}