1
/* ============================================================
2
* File : cameradragobject.cpp
3
* Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
7
* Copyright 2003 by Renchi Raju
9
* This program is free software; you can redistribute it
10
* and/or modify it under the terms of the GNU General
11
* Public License as published bythe Free Software Foundation;
12
* either version 2, or (at your option)
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* ============================================================ */
26
#include <qdatastream.h>
28
#include "cameratype.h"
29
#include "cameradragobject.h"
31
CameraDragObject::CameraDragObject(const CameraType& ctype,
33
: QStoredDrag("camera/unknown", dragSource)
38
CameraDragObject::~CameraDragObject()
42
void CameraDragObject::setCameraType(const CameraType& ctype)
45
QDataStream ds(byteArray, IO_WriteOnly);
52
setEncodedData(byteArray);
56
bool CameraDragObject::canDecode(const QMimeSource* e)
58
return e->provides("camera/unknown");
61
bool CameraDragObject::decode(const QMimeSource* e,
64
QByteArray payload = e->encodedData("camera/unknown");
67
QString title, model, port, path;
69
QDataStream ds(payload, IO_ReadOnly);
75
ctype = CameraType(title, model, port, path);