summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
index 27807cadc..c1d42c2b4 100644
--- a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
+++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
@@ -204,11 +204,6 @@ void FacebookManager::sendDive()
setDesiredAlbumName(dialog.album());
requestAlbumId();
- QPixmap pix = grabProfilePixmap();
- QByteArray bytes;
- QBuffer buffer(&bytes);
- buffer.open(QIODevice::WriteOnly);
- pix.save(&buffer, "PNG");
QUrl url(graphApi + QString(prefs.facebook.album_id) + "/photos?" +
"&access_token=" + QString(prefs.facebook.access_token) +
"&source=image" +
@@ -227,6 +222,12 @@ void FacebookManager::sendDive()
//name of the input is "uploaded" in my form, next one is a file name.
data.append("Content-Disposition: form-data; name=\"uploaded\"; filename=\"" + QString::number(qrand()) + ".png\"\r\n");
data.append("Content-Type: image/jpeg\r\n\r\n"); //data type
+
+ QPixmap pix = grabProfilePixmap();
+ QByteArray bytes;
+ QBuffer buffer(&bytes);
+ buffer.open(QIODevice::WriteOnly);
+ pix.save(&buffer, "PNG");
data.append(bytes); //let's read the file
data.append("\r\n");
data.append("--" + bound + "--\r\n"); //closing boundary according to rfc 1867