Index: /extensions/digikam_export/piwigoexport/CMakeLists.txt
===================================================================
--- /extensions/digikam_export/piwigoexport/CMakeLists.txt	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/CMakeLists.txt	(revision 4874)
@@ -3,5 +3,4 @@
 SET(kipiplugin_piwigoexport_PART_SRCS
     plugin_piwigoexport.cpp
-    albumdlg.cpp
     piwigos.cpp
     piwigoconfig.cpp
@@ -9,6 +8,4 @@
     piwigotalker.cpp
    )
-
-KDE4_ADD_UI_FILES(kipiplugin_piwigoexport_PART_SRCS piwigoalbumwidget.ui)
 
 KDE4_ADD_PLUGIN(kipiplugin_piwigoexport ${kipiplugin_piwigoexport_PART_SRCS})
Index: tensions/digikam_export/piwigoexport/albumdlg.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/albumdlg.cpp	(revision 4873)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/* ============================================================
- *
- * This file is a part of kipi-plugins project
- * http://www.kipi-plugins.org
- *
- * Date        : 2010-01-07
- * Description : a plugin to export to a remote Piwigo server.
- *
- * Copyright (C) 2008 by Andrea Diamantini <adjam7 at gmail dot com>
- * Copyright (C) 2010 by Frederic Coiffier <frederic dot coiffier at free dot com>
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation;
- * either version 2, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * ============================================================ */
-
-// Local includes.
-
-#include "albumdlg.h"
-#include "albumdlg.moc"
-
-namespace KIPIPiwigoExportPlugin
-{
-
-AlbumDlg::AlbumDlg(QWidget *parent)
-        : QDialog(parent)
-{
-    setupUi(this);
-
-    connect(buttonOk, SIGNAL(clicked()),
-            this, SLOT(accept()));
-
-    connect(buttonCancel, SIGNAL(clicked()),
-            this, SLOT(reject()));
-}
-
-AlbumDlg:: ~AlbumDlg()
-{
-}
-
-} // namespace KIPIPiwigoExportPlugin
Index: tensions/digikam_export/piwigoexport/albumdlg.h
===================================================================
--- /extensions/digikam_export/piwigoexport/albumdlg.h	(revision 4873)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/* ============================================================
- *
- * This file is a part of kipi-plugins project
- * http://www.kipi-plugins.org
- *
- * Date        : 2010-01-07
- * Description : a plugin to export to a remote Piwigo server.
- *
- * Copyright (C) 2008 by Andrea Diamantini <adjam7 at gmail dot com>
- * Copyright (C) 2010 by Frederic Coiffier <frederic dot coiffier at free dot com>
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation;
- * either version 2, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * ============================================================ */
-
-#ifndef ALBUMDLG_H
-#define ALBUMDLG_H
-
-#include "ui_piwigoalbumwidget.h"
-
-// Qt includes.
-
-#include <QDialog>
-#include <QWidget>
-
-namespace KIPIPiwigoExportPlugin
-{
-
-class AlbumDlg : public QDialog , public Ui::PiwigoAlbumWidget
-{
-    Q_OBJECT
-
-public:
-
-    AlbumDlg(QWidget *parent = 0);
-    ~AlbumDlg();
-};
-
-} // namespace KIPIPiwigoExportPlugin
-
-#endif // ALBUMDLG_H
Index: tensions/digikam_export/piwigoexport/piwigoalbumwidget.ui
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigoalbumwidget.ui	(revision 4873)
+++ 	(revision )
@@ -1,153 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PiwigoAlbumWidget</class>
- <widget class="QWidget" name="PiwigoAlbumWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>212</width>
-    <height>177</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QLabel" name="header">
-     <property name="text">
-      <string>&lt;h3&gt;Enter New Album Name&lt;/h3&gt;</string>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="Line" name="hline1">
-     <property name="frameShape">
-      <enum>QFrame::HLine</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QGridLayout">
-     <item row="0" column="0">
-      <widget class="QLabel" name="titleLabel">
-       <property name="text">
-        <string>Title:</string>
-       </property>
-       <property name="wordWrap">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="nameLabel">
-       <property name="text">
-        <string>Name (optional):</string>
-       </property>
-       <property name="wordWrap">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="captionLabel">
-       <property name="text">
-        <string>Caption (optional):</string>
-       </property>
-       <property name="wordWrap">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="KLineEdit" name="titleEdit"/>
-     </item>
-     <item row="1" column="1">
-      <widget class="KLineEdit" name="nameEdit"/>
-     </item>
-     <item row="2" column="1">
-      <widget class="KLineEdit" name="captionEdit"/>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="Line" name="hline2">
-     <property name="frameShape">
-      <enum>QFrame::HLine</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="_2">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <spacer name="Horizontal Spacing2">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="buttonOk">
-       <property name="text">
-        <string>&amp;OK</string>
-       </property>
-       <property name="shortcut">
-        <string/>
-       </property>
-       <property name="autoDefault">
-        <bool>true</bool>
-       </property>
-       <property name="default">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="buttonCancel">
-       <property name="text">
-        <string>&amp;Cancel</string>
-       </property>
-       <property name="shortcut">
-        <string/>
-       </property>
-       <property name="autoDefault">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: /extensions/digikam_export/piwigoexport/piwigoitem.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigoitem.h	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigoitem.h	(revision 4874)
@@ -35,23 +35,4 @@
 {
 
-class GPhoto
-{
-public:
-
-    GPhoto() {
-        ref_num = -1;
-    }
-
-    int     ref_num;
-    int     album_num;
-
-    QString name;
-    QString caption;
-    QString thumbName;
-    QString albumURL;
-};
-
-// ------------------------------------------------------------------------
-
 class GAlbum
 {
@@ -70,16 +51,11 @@
     }
 
-    // permissions
     int                ref_num;         // album reference number
     int                parent_ref_num;  // parent's album reference number
 
-    QString            name;            // ?
-    /*QString            parentName;      // ?
-    QString            title;           // album title*/
-    //QString            summary;         // album summary
+    QString            name;            // Album name
     QString            baseurl;         // album partial (gallery) URL
 };
 
-//category id="3" nb_images="80" total_nb_images="80" date_last="2010-01-03 22:06:29" max_date_last="2010-01-03 22:06:29" nb_categories="0" url="http://fcoiffie.free.fr/piwigo-2.0.7/index.php?/category/3"
 } // namespace KIPIPiwigoExportPlugin
 
Index: /extensions/digikam_export/piwigoexport/piwigos.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigos.cpp	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigos.cpp	(revision 4874)
@@ -71,9 +71,4 @@
 }
 
-unsigned int Piwigo::galleryId() const
-{
-    return mPiwigoId;
-}
-
 // -------------------------------------
 
@@ -96,9 +91,4 @@
 {
     mPassword = password;
-}
-
-void Piwigo::setPiwigoId(unsigned int galleryId)
-{
-    mPiwigoId = galleryId;
 }
 
Index: /extensions/digikam_export/piwigoexport/piwigos.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigos.h	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigos.h	(revision 4874)
@@ -52,6 +52,4 @@
     QString username()       const;
     QString password()       const;
-    unsigned int version()   const;
-    unsigned int galleryId() const;
 
     void setName(const QString& name);
@@ -59,5 +57,4 @@
     void setUsername(const QString& username);
     void setPassword(const QString& password);
-    void setPiwigoId(unsigned int galleryId);
 
 public:
@@ -70,6 +67,4 @@
 
 private:
-
-    unsigned int     mPiwigoId;
 
     QString          mName;
Index: /extensions/digikam_export/piwigoexport/piwigotalker.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigotalker.cpp	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigotalker.cpp	(revision 4874)
@@ -28,9 +28,4 @@
 #include "piwigotalker.moc"
 
-// C++ includes
-
-#include <cstring>
-#include <cstdio>
-
 // Qt includes
 
@@ -72,5 +67,4 @@
         : m_parent(parent),  m_job(0),  m_loggedIn(false)
 {
-    kDebug() << "BEGIN\n";
 }
 
@@ -143,6 +137,4 @@
     m_job->addMetaData("content-type", "Content-Type: application/x-www-form-urlencoded" );
     m_job->addMetaData("customHTTPHeader", "Authorization: " + s_authToken );
-    /*    m_job->addMetaData("cookies", "manual");
-        m_job->addMetaData("setcookies", m_cookie);*/
 
     connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -153,71 +145,4 @@
 
     emit signalBusy(true);
-}
-
-void PiwigoTalker::listPhotos(const QString& albumName)
-{
-    m_job   = 0;
-    m_state = GE_LISTPHOTOS;
-    m_talker_buffer.resize(0);
-#if 0
-    PiwigoMPForm form;
-    form.addPair("cmd", "fetch-album-images");
-    form.addPair("protocol_version", "2.11");
-    form.addPair("set_albumName", albumName);
-    form.finish();
-
-    m_job = KIO::http_post(m_url, form.formData(), KIO::HideProgressInfo);
-    m_job->addMetaData("content-type", form.contentType());
-    m_job->addMetaData("cookies", "manual");
-    m_job->addMetaData("setcookies", m_cookie);
-
-    connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
-            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
-
-    connect(m_job, SIGNAL(result(KJob *)),
-            this, SLOT(slotResult(KJob *)));
-
-    emit signalBusy(true);
-#endif
-}
-
-void PiwigoTalker::createAlbum(const QString& parentAlbumName,
-                               const QString& albumName,
-                               const QString& albumTitle,
-                               const QString& albumCaption)
-{
-    m_job   = 0;
-    m_state = GE_CREATEALBUM;
-    m_talker_buffer.resize(0);
-#if 0
-    PiwigoMPForm form;
-    form.addPair("cmd", "new-album");
-    form.addPair("protocol_version", "2.11");
-    form.addPair("set_albumName", parentAlbumName);
-
-    if (!albumName.isEmpty())
-        form.addPair("newAlbumName", albumName);
-
-    if (!albumTitle.isEmpty())
-        form.addPair("newAlbumTitle", albumTitle);
-
-    if (!albumCaption.isEmpty())
-        form.addPair("newAlbumDesc", albumCaption);
-
-    form.finish();
-
-    m_job = KIO::http_post(m_url, form.formData(), KIO::HideProgressInfo);
-    m_job->addMetaData("content-type", form.contentType());
-    m_job->addMetaData("cookies", "manual");
-    m_job->addMetaData("setcookies", m_cookie);
-
-    connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
-            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
-
-    connect(m_job, SIGNAL(result(KJob*)),
-            this, SLOT(slotResult(KJob*)));
-
-    emit signalBusy(true);
-#endif
 }
 
@@ -269,5 +194,5 @@
 
         // Complete name and comment for summary sending
-        m_comment = m_name = KUrl(photoPath).fileName();
+        m_comment = m_name = caption;
         m_date = fi.created();
 
@@ -301,11 +226,7 @@
     buffer.append(dataParameters.toUtf8());
 
-    //kDebug() << "Request " << m_url << buffer << "\n";
-
     m_job = KIO::http_post(m_url, buffer, KIO::HideProgressInfo);
     m_job->addMetaData("content-type", "Content-Type: application/x-www-form-urlencoded" );
     m_job->addMetaData("customHTTPHeader", "Authorization: " + s_authToken );
-    /*    m_job->addMetaData("cookies", "manual");
-        m_job->addMetaData("setcookies", m_cookie);*/
 
     connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -336,6 +257,4 @@
     m_talker_buffer.resize(oldSize + data.size());
     memcpy(m_talker_buffer.data() + oldSize, data.data(), data.size());
-
-    kDebug() << data;
 }
 
@@ -349,5 +268,5 @@
             kDebug() << tempjob->errorString();
         } else {
-            if (m_state == GE_CHECKPHOTOEXIST || m_state == GE_ADDPHOTO) {
+            if (m_state == GE_CHECKPHOTOEXIST || m_state == GE_ADDPHOTO || m_state == GE_ADDTHUMB || m_state == GE_ADDPHOTOSUMMARY) {
                 emit signalAddPhotoFailed(tempjob->errorString());
             } else {
@@ -366,10 +285,4 @@
     case(GE_LISTALBUMS):
         parseResponseListAlbums(m_talker_buffer);
-        break;
-    case(GE_LISTPHOTOS):
-        parseResponseListPhotos(m_talker_buffer);
-        break;
-    case(GE_CREATEALBUM):
-        parseResponseCreateAlbum(m_talker_buffer);
         break;
     case(GE_CHECKPHOTOEXIST):
@@ -391,28 +304,4 @@
 
     if (m_state == GE_LOGIN && m_loggedIn) {
-        /*
-        		const QStringList cookielist = (tempjob->queryMetaData("setcookies")).split('\n');
-                m_cookie = "Cookie:";
-
-
-                if(!cookielist.isEmpty())
-                {
-                    QRegExp rx("^PIWIGOSID=.+");
-                    QString app;
-                    foreach(const QString &str, cookielist)
-                    {
-                        if(str.contains("Set-Cookie: "))
-                        {
-                            const QStringList cl = str.split(' ');
-                            int n = cl.lastIndexOf(rx);
-                            if(n!= -1)
-                            {
-                                app = cl.at(n);
-                            }
-                        }
-                    }
-                    m_cookie += app;
-                }
-        */
         listAlbums();
     }
@@ -427,4 +316,6 @@
     bool foundResponse = false;
     m_loggedIn         = false;
+
+    kDebug() << "parseResponseLogin: " << QString(data);
 
     while (!ts.atEnd()) {
@@ -461,5 +352,5 @@
     GAlbumList::iterator iter = albumList.begin();
 
-    kDebug() << QString(data);
+    kDebug() << "parseResponseListAlbums: " << QString(data);
 
     while (!ts.atEnd()) {
@@ -517,101 +408,4 @@
 }
 
-void PiwigoTalker::parseResponseListPhotos(const QByteArray &data)
-{
-    QString str = QString::fromUtf8(data);
-    QTextStream ts(&str, QIODevice::ReadOnly);
-    QString line;
-    bool foundResponse = false;
-    bool success       = false;
-
-    typedef QList<GPhoto> GPhotoList;
-    GPhotoList photoList;
-    GPhotoList::iterator iter = photoList.begin();
-
-    QString albumURL;
-
-    while (!ts.atEnd()) {
-        line = ts.readLine();
-
-        if (!foundResponse) {
-            foundResponse = line.startsWith(QLatin1String(("#__GR2PROTO__")));
-        } else {
-            QStringList strlist = line.split('=');
-            if (strlist.count() == 2) {
-                QString key   = strlist[0];
-                QString value = strlist[1];
-
-                if (key == "status") {
-                    success = (value == "0");
-                } else if (key.startsWith(QLatin1String(("image.name")))) {
-                    GPhoto photo;
-                    photo.name    = value;
-                    photo.ref_num = key.section('.', 2, 2).toInt();
-                    iter = photoList.insert(iter, photo);
-                } else if (key.startsWith(QLatin1String(("image.caption")))) {
-                    (*iter).caption = value;
-                } else if (key.startsWith(QLatin1String(("image.thumbName")))) {
-                    (*iter).thumbName = value;
-                } else if (key.startsWith(QLatin1String(("baseurl")))) {
-                    albumURL = value.replace("\\", "");     // doesn't compile fixing EBN Krazy issue!!
-                }
-            }
-        }
-    }
-
-    if (!foundResponse) {
-        emit signalError(i18n("Invalid response received from remote Piwigo"));
-        return;
-    }
-
-    if (!success) {
-        emit signalError(i18n("Failed to list photos"));
-        return;
-    }
-
-    emit signalPhotos(photoList);
-}
-
-void PiwigoTalker::parseResponseCreateAlbum(const QByteArray& data)
-{
-    QString str = QString::fromUtf8(data);
-    QTextStream ts(&str, QIODevice::ReadOnly);
-    QString line;
-    bool foundResponse = false;
-    bool success       = false;
-
-    while (!ts.atEnd()) {
-        line = ts.readLine();
-
-        if (!foundResponse) {
-            foundResponse = line.startsWith(QLatin1String(("#__GR2PROTO__")));
-        } else {
-            QStringList strlist = line.split('=');
-            if (strlist.count() == 2) {
-                QString key   = strlist[0];
-                QString value = strlist[1];
-                if (key == "status") {    // key == "status" NOT FOUND!!!
-                    success = (value == "0");
-                    kWarning() << "Create Album. success: " << success ;
-                } else if (key.startsWith(QLatin1String(("status_text")))) {
-                    kDebug() << "STATUS: Create Album: " << value ;
-                }
-            }
-        }
-    }
-
-    if (!foundResponse) {
-        emit signalError(i18n("Invalid response received from remote Piwigo"));
-        return;
-    }
-
-    if (!success) {
-        emit signalError(i18n("Failed to create new album"));
-        return;
-    }
-
-    listAlbums();
-}
-
 void PiwigoTalker::parseResponseDoesPhotoExist(const QByteArray& data)
 {
@@ -622,9 +416,5 @@
     bool success       = false;
 
-//    typedef QList<GAlbum> GAlbumList;
-//    GAlbumList albumList;
-//    GAlbumList::iterator iter = albumList.begin();
-
-    kDebug() << QString(data);
+    kDebug() << "parseResponseDoesPhotoExist: " << QString(data);
 
     while (!ts.atEnd()) {
@@ -667,11 +457,7 @@
     imagefile.close();
 
-    //kDebug() << "Request " << m_url << buffer << "\n";
-
     m_job = KIO::http_post(m_url, buffer, KIO::HideProgressInfo);
     m_job->addMetaData("content-type", "Content-Type: application/x-www-form-urlencoded" );
     m_job->addMetaData("customHTTPHeader", "Authorization: " + s_authToken );
-    /*    m_job->addMetaData("cookies", "manual");
-        m_job->addMetaData("setcookies", m_cookie);*/
 
     connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -680,48 +466,4 @@
     connect(m_job, SIGNAL(result(KJob *)),
             this, SLOT(slotResult(KJob *)));
-
-#if 0
-    QString str = QString::fromUtf8(data);
-    QTextStream ts(&str, QIODevice::ReadOnly);
-    QString line;
-    bool foundResponse = false;
-    bool success       = false;
-
-    while (!ts.atEnd()) {
-        line = ts.readLine();
-
-        if (!foundResponse) {
-            // Piwigo1 sends resizing debug code sometimes so we
-            // have to detect things slightly differently
-            foundResponse = (line.startsWith(QLatin1String(("#__GR2PROTO__")))
-                             || (line.startsWith(QLatin1String(("<br>- Resizing")))
-                                 && line.endsWith(QLatin1String(("#__GR2PROTO__")))));
-        } else {
-            QStringList strlist = line.split('=');
-            if (strlist.count() == 2) {
-                QString key   = strlist[0];
-                QString value = strlist[1];
-
-                if (key == "status") {
-                    success = (value == "0");
-                    kWarning() << "Add photo. success: " << success ;
-                } else if (key.startsWith(QLatin1String(("status_text")))) {
-                    kDebug() << "STATUS: Add Photo: " << value ;
-                }
-            }
-        }
-    }
-
-    if (!foundResponse) {
-        emit signalAddPhotoFailed(i18n("Invalid response received from remote Piwigo"));
-        return;
-    }
-
-    if (!success) {
-        emit signalAddPhotoFailed(i18n("Failed to upload photo"));
-    } else {
-        emit signalAddPhotoSucceeded();
-    }
-#endif
 }
 
@@ -735,5 +477,5 @@
     bool success       = false;
 
-    kDebug() << QString(data);
+    kDebug() << "parseResponseAddPhoto: " << QString(data);
 
     while (!ts.atEnd()) {
@@ -776,11 +518,7 @@
     imagefile.close();
 
-    //kDebug() << "Request " << m_url << buffer << "\n";
-
     m_job = KIO::http_post(m_url, buffer, KIO::HideProgressInfo);
     m_job->addMetaData("content-type", "Content-Type: application/x-www-form-urlencoded" );
     m_job->addMetaData("customHTTPHeader", "Authorization: " + s_authToken );
-    /*    m_job->addMetaData("cookies", "manual");
-        m_job->addMetaData("setcookies", m_cookie);*/
 
     connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -800,5 +538,5 @@
     bool success       = false;
 
-    kDebug() << QString(data);
+    kDebug() << "parseResponseAddThumbnail: " << QString(data);
 
     while (!ts.atEnd()) {
@@ -826,7 +564,4 @@
     m_state = GE_ADDPHOTOSUMMARY;
 
-    //name=img_9738&author=Fr%E9d%E9ric+COIFFIER&categories=12&file_sum=8aa81afb8f15a5dbcf463e210e0cc6f2&thumbnail_sum=8d30dd047bd8d44ea099c461bd87ff7c&original_sum=278d66d52b278fbf531a4c7a74a0dd21&date_creation=2009%3A06%3A16&tag_ids=&comment=&mthod=pwg.images.add
-
-
     QFile imagefile(m_thumbpath);
     imagefile.open(QIODevice::ReadOnly);
@@ -836,9 +571,9 @@
     qsl.append("original_sum=" + m_md5sum.toHex());
     qsl.append("name=" + m_name.toUtf8().toPercentEncoding());
-    qsl.append("author="); // TODO
+    qsl.append("author="); // TODO Retrieve author name from EXIF/IPTC tags
     qsl.append("categories=" + QString::number(m_albumId));
     qsl.append("file_sum=" + computeMD5Sum(m_path).toHex());
     qsl.append("thumbnail_sum=" + computeMD5Sum(m_thumbpath).toHex());
-    qsl.append("date_creation=" + m_date.toString("yyyy:MM:dd").toUtf8().toPercentEncoding()); // 2007%3A06%3A23
+    qsl.append("date_creation=" + m_date.toString("yyyy:MM:dd").toUtf8().toPercentEncoding());
     qsl.append("tag_ids=");
     qsl.append("comment=" + m_comment.toUtf8().toPercentEncoding());
@@ -849,11 +584,7 @@
     imagefile.close();
 
-    kDebug() << "Request " << m_url << buffer << "\n";
-
     m_job = KIO::http_post(m_url, buffer, KIO::HideProgressInfo);
     m_job->addMetaData("content-type", "Content-Type: application/x-www-form-urlencoded" );
     m_job->addMetaData("customHTTPHeader", "Authorization: " + s_authToken );
-    /*    m_job->addMetaData("cookies", "manual");
-        m_job->addMetaData("setcookies", m_cookie);*/
 
     connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -872,5 +603,5 @@
     bool success       = false;
 
-    kDebug() << QString(data);
+    kDebug() << "parseResponseAddPhotoSummary: " << QString(data);
 
     while (!ts.atEnd()) {
@@ -896,34 +627,16 @@
     }
 
-#if 0
-    while (!ts.atEnd()) {
-        line = ts.readLine();
-
-        if (!foundResponse) {
-            // Piwigo1 sends resizing debug code sometimes so we
-            // have to detect things slightly differently
-            foundResponse = (line.startsWith(QLatin1String(("#__GR2PROTO__")))
-                             || (line.startsWith(QLatin1String(("<br>- Resizing")))
-                                 && line.endsWith(QLatin1String(("#__GR2PROTO__")))));
-        } else {
-            QStringList strlist = line.split('=');
-            if (strlist.count() == 2) {
-                QString key   = strlist[0];
-                QString value = strlist[1];
-
-                if (key == "status") {
-                    success = (value == "0");
-                    kWarning() << "Add photo. success: " << success ;
-                } else if (key.startsWith(QLatin1String(("status_text")))) {
-                    kDebug() << "STATUS: Add Photo: " << value ;
-                }
-            }
-        }
-    }
-#endif
     if (!foundResponse) {
         emit signalAddPhotoFailed(i18n("Invalid response received from remote Piwigo"));
         return;
     }
+
+    if (m_path.size())
+        QFile(m_path).remove();
+    if (m_thumbpath.size())
+        QFile(m_thumbpath).remove();
+
+    m_path = "";
+    m_thumbpath = "";
 
     if (!success) {
Index: /extensions/digikam_export/piwigoexport/piwigotalker.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigotalker.h	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigotalker.h	(revision 4874)
@@ -65,6 +65,4 @@
         GE_LOGIN = 0,
         GE_LISTALBUMS,
-        GE_LISTPHOTOS,
-        GE_CREATEALBUM,
         GE_CHECKPHOTOEXIST,
         GE_ADDPHOTO,
@@ -97,5 +95,5 @@
                   const QString& caption = QString(),
                   bool  captionIsTitle = true, bool captionIsDescription = false,
-                  bool rescale = false, int maxDim = 600, int thumbDim = 120);
+                  bool rescale = false, int maxDim = 600, int thumbDim = 128);
 
     void cancel();
@@ -107,5 +105,4 @@
     void signalBusy(bool val);
     void signalAlbums(const QList<GAlbum>& albumList);
-    void signalPhotos(const QList<GPhoto>& photoList);
     void signalAddPhotoSucceeded();
     void signalAddPhotoFailed(const QString& msg);
@@ -115,6 +112,4 @@
     void parseResponseLogin(const QByteArray& data);
     void parseResponseListAlbums(const QByteArray& data);
-    void parseResponseListPhotos(const QByteArray& data);
-    void parseResponseCreateAlbum(const QByteArray& data);
     void parseResponseDoesPhotoExist(const QByteArray& data);
     void parseResponseAddPhoto(const QByteArray& data);
Index: /extensions/digikam_export/piwigoexport/piwigowindow.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigowindow.cpp	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigowindow.cpp	(revision 4874)
@@ -39,4 +39,6 @@
 #include <QTreeWidgetItem>
 #include <QPointer>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
 
 // KDE includes
@@ -63,5 +65,4 @@
 // Local includes
 
-#include "albumdlg.h"
 #include "piwigos.h"
 #include "piwigoconfig.h"
@@ -84,5 +85,4 @@
     QTreeWidget*           albumView;
 
-    QPushButton*           newAlbumBtn;
     QPushButton*           addPhotoBtn;
 
@@ -111,5 +111,5 @@
     logo = new KUrlLabel;
     logo->setText(QString());
-    logo->setUrl("http://piwigo.menalto.com");
+    logo->setUrl("http://piwigo.org");
     logo->setPixmap(QPixmap(KStandardDirs::locate("data", "kipiplugin_piwigoexport/pics/piwigo_logo.png")));
     logo->setAlignment(Qt::AlignLeft);
@@ -119,5 +119,5 @@
     albumView = new QTreeWidget;
     QStringList labels;
-    labels << i18n("Albums"); // << i18n("ID");
+    labels << i18n("Albums");
     albumView->setHeaderLabels(labels);
 
@@ -126,10 +126,4 @@
     QFrame *optionFrame = new QFrame;
     QVBoxLayout *vlay   = new QVBoxLayout();
-
-    newAlbumBtn = new QPushButton;
-    newAlbumBtn->setText(i18n("&New Album"));
-    newAlbumBtn->setIcon(KIcon("folder-new"));
-    newAlbumBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    newAlbumBtn->setEnabled(false);
 
     addPhotoBtn = new QPushButton;
@@ -163,5 +157,5 @@
     thumbDimensionSpinBox = new QSpinBox;
     thumbDimensionSpinBox->setRange(32,800);
-    thumbDimensionSpinBox->setValue(120);
+    thumbDimensionSpinBox->setValue(128);
 
     captTitleCheckBox->setChecked(true);
@@ -199,5 +193,4 @@
     // ---------------------------------------------------------------------------
 
-    vlay->addWidget(newAlbumBtn);
     vlay->addWidget(addPhotoBtn);
     vlay->addWidget(optionsBox);
@@ -226,7 +219,4 @@
         d(new Private(this))
 {
-    kDebug() << "BEGIN Window\n";
-
-
     setWindowTitle( i18n("Piwigo Export") );
     setButtons( KDialog::Close | KDialog::User1 | KDialog::Help);
@@ -310,4 +300,5 @@
     group.writeEntry("Set description", d->captDescrCheckBox->isChecked());
     group.writeEntry("Maximum Width",   d->dimensionSpinBox->value());
+    group.writeEntry("Thumbnail Width", d->thumbDimensionSpinBox->value());
 
     delete m_talker;
@@ -324,7 +315,4 @@
             this , SLOT( slotAlbumSelected() ) );
 
-    connect(d->newAlbumBtn, SIGNAL(clicked()),
-            this, SLOT(slotNewAlbum()));
-
     connect(d->addPhotoBtn, SIGNAL(clicked()),
             this, SLOT(slotAddPhoto()));
@@ -350,7 +338,4 @@
     connect(m_talker, SIGNAL(signalAlbums(const QList<GAlbum>&)),
             this, SLOT(slotAlbums(const QList<GAlbum>&)));
-
-    connect(m_talker, SIGNAL(signalPhotos(const QList<GPhoto>&)),
-            this, SLOT(slotPhotos(const QList<GPhoto>&)));
 
     connect(m_talker, SIGNAL(signalAddPhotoSucceeded()),
@@ -391,4 +376,6 @@
         d->captDescrCheckBox->setChecked(false);
 
+
+    d->thumbDimensionSpinBox->setValue(group.readEntry("Thumbnail Width", 128));
 }
 
@@ -443,11 +430,8 @@
     if (val) {
         setCursor(Qt::WaitCursor);
-        d->newAlbumBtn->setEnabled(false);
         d->addPhotoBtn->setEnabled(false);
     } else {
         setCursor(Qt::ArrowCursor);
         bool loggedIn = m_talker->loggedIn();
-// TODO Enable the button to implement the feature
-        //d->newAlbumBtn->setEnabled(loggedIn);
         d->addPhotoBtn->setEnabled(loggedIn && d->albumView->currentItem());
     }
@@ -492,10 +476,6 @@
             int i                       = 0;
 
-            kDebug() << "Parent : " << parentRefNum << "\n";
-
             while ( !found && i < parentItemList.size() ) {
                 parentItem = parentItemList.at(i);
-
-                kDebug() << "User : " << parentItem->data(1, Qt::UserRole).toInt() << "\n";
 
                 if (parentItem && (parentItem->data(1, Qt::UserRole).toInt() == parentRefNum)) {
@@ -505,6 +485,4 @@
                     item->setData(1, Qt::UserRole, album.ref_num );
                     item->setText(2, i18n("Album") );
-
-                    kDebug() << "Child : " << album.name << " " << album.ref_num << "\n";
 
                     parentItem->addChild(item);
@@ -515,41 +493,15 @@
                 i++;
             }
-
-            /*if (!found && i == parentItemList.size() )
-            {
-                workList.append(album);
-            }*/
         }
     }
 }
 
-// FIXME: avoid duplications
-void PiwigoWindow::slotPhotos(const QList<GPhoto>& photoList)
-{
-    QTreeWidgetItem* parentItem = d->albumView->currentItem();
-
-    typedef QList<GPhoto> GPhotoList;
-    GPhotoList::const_iterator iterator;
-    for (iterator = photoList.begin(); iterator != photoList.end(); ++iterator) {
-        QString plain = (*iterator).caption;
-        QTreeWidgetItem *item = new QTreeWidgetItem(parentItem);
-        item->setText(0, cleanName(plain) );
-        item->setIcon(0, KIcon("image-x-generic") );
-        item->setText(1, (*iterator).name);
-        item->setText(2, i18n("Image") );
-    }
-}
-
 void PiwigoWindow::slotAlbumSelected()
 {
     QTreeWidgetItem* item = d->albumView->currentItem();
-
-    kDebug() << "slotAlbumSelected\n";
 
     // stop loading if user clicked an image
     if ( item->text(2) == i18n("Image") )
         return;
-
-    kDebug() << "Album\n";
 
     if (!item) {
@@ -562,5 +514,4 @@
         if (m_talker->loggedIn() && albumId ) {
             d->addPhotoBtn->setEnabled(true);
-            //m_talker->listPhotos(albumName);
         } else {
             d->addPhotoBtn->setEnabled(false);
@@ -569,119 +520,14 @@
 }
 
-void PiwigoWindow::slotNewAlbum()
-{
-    QPointer<AlbumDlg> dlg = new AlbumDlg(d->widget);
-    dlg->titleEdit->setFocus();
-    if ( dlg->exec() != QDialog::Accepted ) {
-        delete dlg;
+void PiwigoWindow::slotAddPhoto()
+{
+    KUrl::List *urls = new KUrl::List(m_interface->currentSelection().images());
+
+    if (urls == NULL || urls->isEmpty()) {
+        KMessageBox::error(this, i18n("Nothing to upload - please select photos to upload."));
         return;
     }
 
-    QString name    = dlg->nameEdit->text();
-    QString title   = dlg->titleEdit->text();
-    QString caption = dlg->captionEdit->text();
-
-    delete dlg;
-
-    // check for prohibited chars in the album name
-    // \ / * ? " ' & < > | . + # ( ) or spaces
-    // TODO: Change this to a QRegExp check.
-    QChar ch;
-    bool  clean = true;
-
-    for (int i = 0; i < name.length(); ++i) {
-        ch = name[i];
-        if (ch == '\\') {
-            clean = false;
-            break;
-        } else if (ch == '/') {
-            clean = false;
-            break;
-        } else if (ch == '*') {
-            clean = false;
-            break;
-        } else if (ch == '?') {
-            clean = false;
-            break;
-        } else if (ch == '"') {
-            clean = false;
-            break;
-        } else if (ch == '\'') {
-            clean = false;
-            break;
-        } else if (ch == '&') {
-            clean = false;
-            break;
-        } else if (ch == '<') {
-            clean = false;
-            break;
-        } else if (ch == '>') {
-            clean = false;
-            break;
-        } else if (ch == '|') {
-            clean = false;
-            break;
-        } else if (ch == '.') {
-            clean = false;
-            break;
-        } else if (ch == '+') {
-            clean = false;
-            break;
-        } else if (ch == '#') {
-            clean = false;
-            break;
-        } else if (ch == '(') {
-            clean = false;
-            break;
-        } else if (ch == ')') {
-            clean = false;
-            break;
-        }
-        /*
-        else if (ch == ' ')
-        {
-            clean = false;
-            break;
-        }
-        */
-    }
-
-    if (!clean) {
-        KMessageBox::error(this, i18n("Sorry, these characters are not allowed in album name: \\ / * ? \" \' & &lt; &gt; | . + # ( ) or spaces"));
-        return;
-    }
-
-    QString parentAlbumName;
-
-    QTreeWidgetItem* item = d->albumView->currentItem();
-    int column            = d->albumView->currentColumn();
-    if (item) {
-        const GAlbum& album = d->albumDict.value( item->text(column) );
-        parentAlbumName     = album.name;
-        m_talker->createAlbum( parentAlbumName, name, title, caption);
-    } else {
-        m_talker->createAlbum( firstAlbumName, name, title, caption );
-    }
-}
-
-void PiwigoWindow::slotAddPhoto()
-{
-#if 0
-    QTreeWidgetItem* item = d->albumView->currentItem();
-    int column            = d->albumView->currentColumn();
-    if (!item)
-        return;     // NO album selected: FIXME: do something
-
-    // albumName
-    QString albumTitle = item->text(column);
-    if (!d->albumDict.contains(albumTitle))
-        return;     // NO album name found: FIXME: do something
-
-    // photoPath
-    KUrl::List urls = KIPIPlugins::ImageDialog::getImageUrls(this, m_interface);
-    if (urls.isEmpty())
-        return; // NO photo selected: FIXME: do something
-
-    for (KUrl::List::iterator it = urls.begin(); it != urls.end(); ++it) {
+    for (KUrl::List::iterator it = urls->begin(); it != urls->end(); ++it) {
         mpUploadList->append( (*it).path() );
     }
@@ -692,21 +538,4 @@
     m_uploadCount = 0;
     slotAddPhotoNext();
-#endif
-    KUrl::List *urls = new KUrl::List(m_interface->currentSelection().images());
-
-    if (urls == NULL || urls->isEmpty()) {
-        KMessageBox::error(this, i18n("Nothing to upload - please select photos to upload."));
-        return;
-    }
-
-    for (KUrl::List::iterator it = urls->begin(); it != urls->end(); ++it) {
-        mpUploadList->append( (*it).path() );
-    }
-
-    m_uploadTotal = mpUploadList->count();
-    m_progressDlg->reset();
-    m_progressDlg->setMaximum(m_uploadTotal);
-    m_uploadCount = 0;
-    slotAddPhotoNext();
 }
 
@@ -716,5 +545,4 @@
         m_progressDlg->reset();
         m_progressDlg->hide();
-        //slotAlbumSelected();        // ?
         return;
     }
Index: /extensions/digikam_export/piwigoexport/piwigowindow.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigowindow.h	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/piwigowindow.h	(revision 4874)
@@ -80,8 +80,5 @@
     void slotError(const QString& msg);
     void slotAlbums(const QList<GAlbum>& albumList);
-    void slotPhotos(const QList<GPhoto>& photoList);
     void slotAlbumSelected();
-//    void slotOpenPhoto(const KUrl& url);      // DISABLED for NOW!
-    void slotNewAlbum();
     void slotAddPhoto();
     void slotAddPhotoNext();
Index: /extensions/digikam_export/piwigoexport/plugin_piwigoexport.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/plugin_piwigoexport.cpp	(revision 4873)
+++ /extensions/digikam_export/piwigoexport/plugin_piwigoexport.cpp	(revision 4874)
@@ -125,7 +125,5 @@
     if (action == m_action)
         return KIPI::ExportPlugin;
-//     if (action == m_action_configure)
-//         return KIPI::ToolsPlugin;
-//
+
     kWarning() << "Unrecognized action for plugin category identification";
     return KIPI::ExportPlugin;
