diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-07 09:28:22 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-07 09:28:22 +0000 |
| commit | 2e28d735032880dfeb3f9221cb070b0fbfd7c30c (patch) | |
| tree | f4f31afa025792ca33aeaef35b7ea4aaea1d06b5 /src | |
| parent | b4f4b09913489476c35acd26576b8f198f6a1751 (diff) | |
| download | qxmpp-2e28d735032880dfeb3f9221cb070b0fbfd7c30c.tar.gz | |
remove dependency on QtGui (Closes: #66)
Diffstat (limited to 'src')
| -rw-r--r-- | src/QXmppClient.h | 3 | ||||
| -rw-r--r-- | src/QXmppVCardIq.cpp | 36 | ||||
| -rw-r--r-- | src/QXmppVCardIq.h | 11 | ||||
| -rw-r--r-- | src/src.pro | 6 |
4 files changed, 2 insertions, 54 deletions
diff --git a/src/QXmppClient.h b/src/QXmppClient.h index e7316e4d..32ab8efe 100644 --- a/src/QXmppClient.h +++ b/src/QXmppClient.h @@ -72,9 +72,6 @@ class QXmppVersionManager; /// to the server on disconnections due to an error. User can have a custom /// reconnection mechanism as well. /// -/// For removing QXmpp dependency in QtGui, use DEFINES += QXMPP_NO_GUI -/// in the source.pro file and build as usual. -/// /// \ingroup Core class QXmppClient : public QXmppLoggable diff --git a/src/QXmppVCardIq.cpp b/src/QXmppVCardIq.cpp index f4e2b7d7..3fe12c00 100644 --- a/src/QXmppVCardIq.cpp +++ b/src/QXmppVCardIq.cpp @@ -25,11 +25,6 @@ #include <QBuffer> #include <QXmlStreamWriter> -#ifndef QXMPP_NO_GUI -#include <QImage> -#include <QImageReader> -#endif - #include "QXmppVCardIq.h" #include "QXmppUtils.h" #include "QXmppConstants.h" @@ -309,27 +304,6 @@ void QXmppVCardIq::toXmlElementFromChild(QXmlStreamWriter *writer) const writer->writeEndElement(); } -#ifndef QXMPP_NO_GUI -QImage QXmppVCardIq::photoAsImage() const -{ - QBuffer buffer; - buffer.setData(m_photo); - buffer.open(QIODevice::ReadOnly); - QImageReader imageReader(&buffer); - return imageReader.read(); -} - -void QXmppVCardIq::setPhoto(const QImage& image) -{ - QByteArray ba; - QBuffer buffer(&ba); - buffer.open(QIODevice::WriteOnly); - image.save(&buffer, "PNG"); - m_photo = ba; - m_photoType = "image/png"; -} -#endif - QString QXmppVCardIq::getFullName() const { return m_fullName; @@ -345,13 +319,3 @@ const QByteArray& QXmppVCardIq::getPhoto() const return m_photo; } -#ifndef QXMPP_NO_GUI -QImage QXmppVCardIq::getPhotoAsImage() const -{ - QBuffer buffer; - buffer.setData(m_photo); - buffer.open(QIODevice::ReadOnly); - QImageReader imageReader(&buffer); - return imageReader.read(); -} -#endif diff --git a/src/QXmppVCardIq.h b/src/QXmppVCardIq.h index cdb5d8b7..b56ef54a 100644 --- a/src/QXmppVCardIq.h +++ b/src/QXmppVCardIq.h @@ -79,21 +79,10 @@ public: static bool isVCard(const QDomElement &element); - /// \cond -// deprecated in release 0.3.0, as it drags in a dependency -// on QtGui, whilst the rest of QXmpp does not require QtGui -#ifndef QXMPP_NO_GUI - QImage Q_DECL_DEPRECATED photoAsImage() const; - void Q_DECL_DEPRECATED setPhoto(const QImage&); -#endif - // deprecated accessors, use the form without "get" instead // deprecated in release 0.2.0 QString Q_DECL_DEPRECATED getFullName() const; QString Q_DECL_DEPRECATED getNickName() const; -#ifndef QXMPP_NO_GUI - QImage Q_DECL_DEPRECATED getPhotoAsImage() const; -#endif const QByteArray Q_DECL_DEPRECATED & getPhoto() const; /// \endcond diff --git a/src/src.pro b/src/src.pro index 0eef9966..9586cae5 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,15 +1,13 @@ include(../qxmpp.pri) +QT -= gui + TEMPLATE = lib CONFIG += staticlib INCLUDEPATH += $$QXMPP_INCLUDE_DIR LIBS += $$QXMPP_INTERNAL_LIBS -# To disable the dependency on QtGui, uncomment the following: -# DEFINES += QXMPP_NO_GUI -# QT -= gui - # To enable support for the Speex codec, uncomment the following: # DEFINES += QXMPP_USE_SPEEX # LIBS += -lspeex |
