[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [ring-kde/profile] src: sdfsdfsd
From: Emmanuel Lepage Vallee <emmanuel.lepage () savoirfairelinux ! com>
Date: 2015-07-17 18:00:59
Message-ID: E1ZG9wR-0000B1-Kj () scm ! kde ! org
[Download RAW message or body]
Git commit 8e02dc092ddf30449c7c10142c80620d8aaeda2e by Emmanuel Lepage Vallee.
Committed on 17/07/2015 at 18:00.
Pushed by lepagevalleeemmanuel into branch 'profile'.
sdfsdfsd
M +1 -1 src/cmd.cpp
M +3 -3 src/conf/account/accountpages/dlgprofiles.cpp
M +11 -3 src/delegates/kdepixmapmanipulation.cpp
M +3 -0 src/ring.cpp
M +1 -1 src/view.cpp
http://commits.kde.org/ring-kde/8e02dc092ddf30449c7c10142c80620d8aaeda2e
diff --git a/src/cmd.cpp b/src/cmd.cpp
index badfb31..2bbfb89 100644
--- a/src/cmd.cpp
+++ b/src/cmd.cpp
@@ -120,7 +120,7 @@ void Cmd::sendText(const QString& number, const QString& text)
call->setProperty("message",text);
QObject::connect(call,&Call::lifeCycleStateChanged,[text,call](const Call::LifeCycleState st) {
if (st == Call::LifeCycleState::PROGRESS) {
- call->addOutgoingMedia<Media::Text>()->send(call->property("message").toString());
+ call->addOutgoingMedia<Media::Text>()->send({{"text/plain",call->property("message").toString()}});
call->performAction(Call::Action::REFUSE); //HangUp
}
});
diff --git a/src/conf/account/accountpages/dlgprofiles.cpp b/src/conf/account/accountpages/dlgprofiles.cpp
index 7fccf7d..ff54333 100644
--- a/src/conf/account/accountpages/dlgprofiles.cpp
+++ b/src/conf/account/accountpages/dlgprofiles.cpp
@@ -53,7 +53,7 @@ void DlgProfiles::loadPerson(Person* profile)
edit_email ->setText( profile->preferredEmail() );
edit_organization ->setText( profile->organization () );
- if(photoView->pixmap()) {
+ if(!profile->photo().value<QPixmap>().isNull()) {
const QPixmap photo = profile->photo().value<QPixmap>();
photoView->setPixmap(photo);
}
@@ -175,11 +175,11 @@ void DlgProfiles::choosePhoto()
qDebug() << "Maximum size is 96px";
return;
}
-
+/*
if(pic.width() < 32) {
qDebug() << "Minimum size is 32px";
return;
- }
+ }*/
photoView->setPixmap(pic);
}
diff --git a/src/delegates/kdepixmapmanipulation.cpp b/src/delegates/kdepixmapmanipulation.cpp
index f751bcb..4db5a08 100644
--- a/src/delegates/kdepixmapmanipulation.cpp
+++ b/src/delegates/kdepixmapmanipulation.cpp
@@ -219,7 +219,7 @@ QByteArray KDEPixmapManipulation::toByteArray(const QVariant& pxm)
buffer.open(QIODevice::WriteOnly);
//PNG ?
- (qvariant_cast<QPixmap>(pxm)).save(&buffer, "PNG");
+ (qvariant_cast<QPixmap>(pxm)).save(&buffer, "JPEG");
buffer.close();
return bArray;
@@ -227,11 +227,19 @@ QByteArray KDEPixmapManipulation::toByteArray(const QVariant& pxm)
QVariant KDEPixmapManipulation::personPhoto(const QByteArray& data, const QString& type)
{
+ if (data.isEmpty()) {
+ qDebug() << "vCard image loading failed, the image is empty";
+ return {};
+ }
+
QImage image;
//For now, ENCODING is only base64 and image type PNG or JPG
- const bool ret = image.loadFromData(QByteArray::fromBase64(data),type.toLatin1());
- if (!ret)
+ const bool ret = image.loadFromData(QByteArray::fromBase64(data),type.toLower().toLatin1());
+ qDebug() << "\n\nICI!!!!!!" << type << image.width() << QPixmap::fromImage(image).width() << data.left(20);
+ if (!ret) {
qDebug() << "vCard image loading failed";
+ return {};
+ } //TODO check is width || height == 0
return QPixmap::fromImage(image);
}
diff --git a/src/ring.cpp b/src/ring.cpp
index 3eaacb2..d2c68fc 100755
--- a/src/ring.cpp
+++ b/src/ring.cpp
@@ -41,6 +41,7 @@
//Models
#include <accountmodel.h>
+#include <profilemodel.h>
#include <certificatemodel.h>
#include <availableaccountmodel.h>
#include <numbercategorymodel.h>
@@ -181,6 +182,8 @@ Ring::Ring(QWidget* parent)
// PresenceCollectionModelExtension* ext = new PresenceCollectionModelExtension(this);
// PersonModel::instance()->backendModel()->addExtension(ext); //FIXME
+
+ ProfileModel::instance();
}
//Belong to setupActions(), but is needed now
diff --git a/src/view.cpp b/src/view.cpp
index 028b361..e711474 100644
--- a/src/view.cpp
+++ b/src/view.cpp
@@ -262,7 +262,7 @@ void View::sendMessage()
{
Call* call = CallModel::instance()->selectedCall();
if (dynamic_cast<Call*>(call) && !m_pSendMessageLE->text().isEmpty()) {
- call->addOutgoingMedia<Media::Text>()->send(m_pSendMessageLE->text());
+ call->addOutgoingMedia<Media::Text>()->send({{"text/plain",m_pSendMessageLE->text()}});
}
m_pSendMessageLE->clear();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic