Index: /extensions/digikam_export/AUTHORS
===================================================================
--- /extensions/digikam_export/AUTHORS	(revision 4770)
+++ /extensions/digikam_export/AUTHORS	(revision 4770)
@@ -0,0 +1,80 @@
+MODIFICATION OF KIPI-PLUGINS TO ADD PIWIGOEXPORT PLUGIN
+
+ORIGINAL KIPI-PLUGINS TEAM :
+
+MAIN DEVELOPERS:
+Gilles Caulier       <caulier dot gilles at gmail dot com>
+Marcel Wiesweg       <marcel dot wiesweg at gmx dot de>
+Andi Clemens         <andi dot clemens at gmx dot net>
+Pieter Edelman       <p dot edelman at gmx dot net>
+Michael G. Hansen    <mike at mghansen dot de>
+Johannes Wienke      <languitar at semipol dot de>
+Patrick Spendrin     <patrick_spendrin at gmx dot de>
+Luka Renko           <lure at kubuntu dot org>
+Laurent Montel       <montel at kde dot org>
+Aurelien Gateau      <aurelien dot gateau at free dot fr>
+Angelo Naselli       <anaselli at linux dot it>
+Kare Sars            <kare dot sars at iki dot fi>
+Valerio Fuoglio      <valerio dot fuoglio at gmail dot com>
+Andrea Diamantini    <adjam7 at gmail dot com>
+Timothee Groleau     <kde at timotheegroleau dot com>
+
+CONTRIBUTORS:
+Martin Engelmann     <murphi dot oss at googlemail dot com>
+Gerhard Kulzer       <gerhard at kulzer dot net>
+Orgad Shaneh         <orgads at gmail dot com>
+Seb Ruiz             <ruiz at kde dot org>
+Julien Narboux       <Julien at narboux dot fr>
+Nicolas Lécureuil    <neoclust at mandriva dot org>
+Ruediger Bente       <ruediger dot bente at gmx dot de>
+Beth Marmorstein     <purplegamba at cox dot net>
+Robert Marmorstein   <rmmarm at sdf dot lonestar dot org>
+Markus Leuthold      <kusi at forum dot titlis dot org>
+Vardhman Jain        <vardhman at gmail.com>
+Colin Guthrie        <kde at colin dot guthr dot ie>
+Achim Bohnet         <ach at mpe dot mpg dot de>
+
+OLD CONTRIBUTORS:
+Tudor Calin          <tudor at 1xtech dot com>
+Owen Hirst           <n8rider at sbcglobal dot net>
+Todd Shoemaker       <todd at theshoemakers dot net>
+Gregory Kokanosky    <gregory dot kokanosky at free dot fr>
+Richard Groult       <Richard dot Groult at jalix dot org>
+Michael Hoechstetter <michael dot hoechstetter at gmx dot de>
+
+PLUGINS MAINTAINERS
+Acquire images          : Gilles Caulier and Kare Sars
+Advanced Slideshow      : Valerio Fuoglio
+Calendar                : Orgad Shaneh
+DngConverter            : Gilles Caulier
+Facebook import/export  : Luka Renko
+Flash export            : Gilles Caulier
+Flickr export           : Pieter Edelman and Gilles Caulier
+GPSSync                 : Gilles Caulier
+Gallery export          : Colin Guthrie and Andrea Diamantini
+HTML export             : Aurelien Gateau
+Image viewer            : Markus Leuthold
+Ipod export             : Seb Ruiz
+Jpeglossless            : Gilles Caulier and Marcel Wiesweg
+MetadataEdit            : Gilles Caulier
+PicasaWeb export        : Vardhman jain and Gilles Caulier
+Print images            : Angelo Naselli
+Raw converter           : Gilles Caulier and Marcel Wiesweg
+RemoveRedEyes           : Andi Clemens
+Sendimages              : Gilles Caulier
+Smug import/export      : Luka Renko
+Time adjust             : Gilles Caulier
+Wallpaper               : Laurent Montel
+KIOExport               : Johannes Wienke
+ShwupExport             : Timothee Groleau
+PiwigoExport            : Frederic Coiffier
+
+PROJECT COORDINATORS:
+Angelo Naselli and Gilles Caulier
+
+FORMER MAINTAINER:
+Renchi Raju         <renchi dot raju at gmail dot com> 
+Tom Albers          <tomalbers at kde dot nl>
+Ralf Hoelzer        <kde at ralfhoelzer dot com>
+Joern Ahrens        <joern dot ahrens at kdemail dot net>
+Jesper K. Pedersen  <blackie at kde dot org>
Index: /extensions/digikam_export/CMakeLists.txt
===================================================================
--- /extensions/digikam_export/CMakeLists.txt	(revision 4770)
+++ /extensions/digikam_export/CMakeLists.txt	(revision 4770)
@@ -0,0 +1,225 @@
+PROJECT(kipi-plugins)
+
+# =======================================================
+# Information to update before to release this package.
+
+# kipi-plugins version
+#SET(KIPIPLUGINS_MAJOR_VERSION "1")
+#SET(KIPIPLUGINS_MINOR_VERSION "0")
+#SET(KIPIPLUGINS_PATCH_VERSION "0")
+
+# kipi-plugins release date
+#SET (KIPIPLUGINS_RELEASE_DATE "2009-12-21")
+
+# Suffix to add at end of version string. Usual values are:
+# "-svn"   : alpha code unstable from svn. Do not use in production
+# "-beta1" : beta1 release.
+# "-beta2" : beta2 release.
+# "-beta3" : beta3 release.
+# "-rc"    : release candidate.
+# ""       : final relase. Can be used in production.
+#SET(KIPIPLUGINS_SUFFIX_VERSION "")
+
+# =======================================================
+# Set env. variables accordinly.
+
+SET(KIPIPLUGINS_VERSION_STRING
+    "0.0.1-piwigo"
+   )
+
+# =======================================================
+
+FIND_PACKAGE(KDE4 REQUIRED)
+
+INCLUDE(MacroOptionalFindPackage)
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(KDE4Defaults)
+INCLUDE(MacroLibrary)
+
+# Depencies detection required by all plugins
+FIND_PACKAGE(Kexiv2 REQUIRED)
+FIND_PACKAGE(Kdcraw REQUIRED)
+FIND_PACKAGE(Kipi REQUIRED)
+FIND_PACKAGE(JPEG REQUIRED)
+FIND_PACKAGE(PNG REQUIRED)
+FIND_PACKAGE(TIFF REQUIRED)
+
+# Optional depencies detection required by some plugins
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+
+#MACRO_OPTIONAL_FIND_PACKAGE(EXPAT)      # For DNGConverter: XMP SDK need Expat library to compile.
+#MACRO_OPTIONAL_FIND_PACKAGE(Threads)    # For DNGConverter: DNG SDK need native threads support.
+#MACRO_OPTIONAL_FIND_PACKAGE(LibXml2)    # For Htmlexport.
+#MACRO_OPTIONAL_FIND_PACKAGE(LibXslt)    # For Htmlexport.
+#MACRO_OPTIONAL_FIND_PACKAGE(OpenGL)     # For AdvancedSlideshow and ImageViewer.
+#MACRO_OPTIONAL_FIND_PACKAGE(OpenCV)     # For RemoveRedEyes.
+#MACRO_OPTIONAL_FIND_PACKAGE(Gpod)       # For ipodexport.
+#MACRO_OPTIONAL_FIND_PACKAGE(Gdk)        # For ipodexport.
+#MACRO_OPTIONAL_FIND_PACKAGE(GLIB2)      # For ipodexport.
+#MACRO_OPTIONAL_FIND_PACKAGE(GObject)    # For ipodexport.
+#MACRO_OPTIONAL_FIND_PACKAGE(KdepimLibs) # For Calendar (libkcal).
+#MACRO_OPTIONAL_FIND_PACKAGE(QCA2)       # For Shwup.
+#MACRO_OPTIONAL_FIND_PACKAGE(KSane)      # For AcquireImages.
+
+IF(NOT WIN32)
+    # Check KDcraw version installed to compile fine DngConverter plugin.
+    FIND_PACKAGE(PkgConfig)
+    PKG_CHECK_MODULES(Kdcraw libkdcraw>=0.4.0)
+    IF(Kdcraw_FOUND)
+        SET(KDCRAW_FOR_DNGCONVERTER TRUE)
+    ELSE(Kdcraw_FOUND)
+        SET(KDCRAW_FOR_DNGCONVERTER FALSE)
+    ENDIF(Kdcraw_FOUND)
+ELSE(NOT WIN32)
+    SET(KDCRAW_FOR_DNGCONVERTER TRUE)
+ENDIF(NOT WIN32)
+
+INCLUDE(MacroOptionalDependPackage)
+
+# ==================================================================================================
+# Log messages
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "----------------------------------------------------------------------------------")
+MESSAGE(STATUS " kipi-plugins ${KIPIPLUGINS_VERSION_STRING} dependencies results   <http://www.kipi-plugins.org>")
+MESSAGE(STATUS "")
+
+# Require shared libraries results.
+
+IF(JPEG_FOUND)
+    MESSAGE(STATUS " libjpeg library found............... YES")
+ELSE(JPEG_FOUND)
+    MESSAGE(STATUS " libjpeg library found............... NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " kipi-plugins needs libjpeg. You need to install the libjpeg development package.")
+    MESSAGE(STATUS " libjpeg website is at http://www.ijg.org")
+    MESSAGE(STATUS "")
+ENDIF(JPEG_FOUND)
+
+IF(TIFF_FOUND)
+    MESSAGE(STATUS " libtiff library found............... YES")
+ELSE(TIFF_FOUND)
+    MESSAGE(STATUS " libtiff library found............... NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " kipi-plugins needs libtiff. You need to install the libtiff development package.")
+    MESSAGE(STATUS " libtiff website is at http://www.remotesensing.org/libtiff")
+    MESSAGE(STATUS "")
+ENDIF(TIFF_FOUND)
+
+IF(PNG_FOUND)
+    MESSAGE(STATUS " libpng library found................ YES")
+ELSE(PNG_FOUND)
+    MESSAGE(STATUS " libpng library found................ NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " kipi-plugins needs libpng. You need to install the correct version (>= 1.2.7).")
+    MESSAGE(STATUS " Libpng website is at http://www.libpng.org/pub/png/libpng.html")
+    MESSAGE(STATUS "")
+ENDIF(PNG_FOUND)
+
+IF(KIPI_FOUND)
+    MESSAGE(STATUS " libkipi library found............... YES")
+ELSE(KIPI_FOUND)
+    MESSAGE(STATUS " libkipi library found............... NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " kipi-plugins needs libkipi library >= 0.2.0. You need to install libkipi first")
+    MESSAGE(STATUS " libkipi website is at http://www.digikam.org/sharedlibs")
+    MESSAGE(STATUS "")
+ENDIF(KIPI_FOUND)
+
+IF(KEXIV2_FOUND)
+    MESSAGE(STATUS " libkexiv2 library found............. YES")
+ELSE(KEXIV2_FOUND)
+    MESSAGE(STATUS " libkexiv2 library found............. NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " kipi-plugins needs libkexiv2 library >= 0.2.0. You need to install libkexiv2 first")
+    MESSAGE(STATUS " libkexiv2 website is at http://www.digikam.org/sharedlibs")
+    MESSAGE(STATUS "")
+ENDIF(KEXIV2_FOUND)
+
+IF(KDCRAW_FOUND)
+    MESSAGE(STATUS " libkdcraw library found............. YES")
+ELSE(KDCRAW_FOUND)
+    MESSAGE(STATUS " libkdcraw library found............. NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " kipi-plugins needs libkdcraw library >= 0.4.0. You need to install libkdcraw first")
+    MESSAGE(STATUS " libkdcraw website is at http://www.digikam.org/sharedlibs")
+    MESSAGE(STATUS "")
+ENDIF(KDCRAW_FOUND)
+
+# Optional plugins results ----------------------------------------------------------------------------
+
+MESSAGE(STATUS "")
+
+IF(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND)
+    MESSAGE(STATUS " kipi-plugins will be compiled....... YES")
+    SET(KIPIPLUGINS_CAN_BE_COMPILED true)
+ELSE(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND)
+    MESSAGE(FATAL_ERROR " kipi-plugins will not be compiled! Look README file for more details about dependencies...")
+    SET(KIPIPLUGINS_CAN_BE_COMPILED false)
+ENDIF(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND)
+
+MESSAGE(STATUS "----------------------------------------------------------------------------------")
+MESSAGE(STATUS "")
+
+# ==================================================================================================
+
+IF(KIPIPLUGINS_CAN_BE_COMPILED)
+
+    # ==================================================================================================
+    # Create svn version header
+
+    # See http://public.kitware.com/pipermail/cmake/2006-July/010299.html
+    # We only do this IF we are in a .svn dir
+
+    FIND_FILE(SVN_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.svn)
+
+    IF(NOT SVN_MARKER)
+        SET (SVN_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt)  # Dummy file
+    ENDIF(NOT SVN_MARKER)
+
+    # Add a custom command to drive the svn script whenever the svn entries
+    # file changes.
+    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/svnscript.cmake.in_cmake"
+                   "${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake"
+                   @ONLY)
+
+    ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins/svnversion.h"
+                       DEPENDS ${SVN_MARKER}
+                       COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake")
+
+    # Add a custom target to drive the custom command.
+    ADD_CUSTOM_TARGET(kipiplugins-svnversion
+                      ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins/svnversion.h")
+
+    # ==================================================================================================
+
+    INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins
+                        ${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins
+                        ${KEXIV2_INCLUDE_DIR}
+                        ${KDCRAW_INCLUDE_DIR}
+                        ${KIPI_INCLUDE_DIR}
+                        ${KDE4_INCLUDES}
+                        ${QT4_INCLUDES}
+                       )
+                     
+    # debug settings
+    SET(AREA_CODE_GENERAL "51000")
+    SET(AREA_CODE_LOADING "51001")
+    ADD_DEFINITIONS(-DKDE_DEFAULT_DEBUG_AREA=${AREA_CODE_GENERAL}) 
+    ADD_DEFINITIONS(-DAREA_CODE_GENERAL=${AREA_CODE_GENERAL})
+    ADD_DEFINITIONS(-DAREA_CODE_LOADING=${AREA_CODE_LOADING})
+
+    # Plugins which will be always compiled
+
+    #ADD_SUBDIRECTORY(common)
+    ADD_SUBDIRECTORY(piwigoexport)
+    #ADD_SUBDIRECTORY(picasawebexport)
+
+    IF(NOT WIN32)
+        CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/kipi-plugins.lsm.cmake ${CMAKE_CURRENT_BINARY_DIR}/kipi-plugins.lsm)
+    ENDIF(NOT WIN32)
+
+ENDIF(KIPIPLUGINS_CAN_BE_COMPILED)
+include(MacroOptionalAddSubdirectory)
+macro_optional_add_subdirectory( po )
Index: /extensions/digikam_export/COPYING
===================================================================
--- /extensions/digikam_export/COPYING	(revision 4770)
+++ /extensions/digikam_export/COPYING	(revision 4770)
@@ -0,0 +1,345 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 of the License, 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.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: /extensions/digikam_export/INSTALL
===================================================================
--- /extensions/digikam_export/INSTALL	(revision 4770)
+++ /extensions/digikam_export/INSTALL	(revision 4770)
@@ -0,0 +1,3 @@
+Build instructions can be found at
+http://techbase.kde.org/Getting_Started/Build/KDE4
+
Index: /extensions/digikam_export/Messages.sh
===================================================================
--- /extensions/digikam_export/Messages.sh	(revision 4770)
+++ /extensions/digikam_export/Messages.sh	(revision 4770)
@@ -0,0 +1,5 @@
+#! /bin/sh
+$PREPARETIPS >> tips.cpp
+$XGETTEXT tips.cpp common/libkipiplugins/*.cpp common/libkipiplugins/*.h common/libkipiplugins/*.h.cmake -o $podir/kipiplugins.pot
+rm -f tips.cpp
+
Index: /extensions/digikam_export/README
===================================================================
--- /extensions/digikam_export/README	(revision 4770)
+++ /extensions/digikam_export/README	(revision 4770)
@@ -0,0 +1,136 @@
+KIPIPLUGINS PROJECT (http://www.kipi-plugins.org)
+
+-- AUTHORS ------------------------------------------------------------
+
+See AUTHORS file for details.
+
+-- ABOUT --------------------------------------------------------------
+
+Libkipi and kipi-plugins allows image applications as digiKam (http://www.digikam.org)
+to use a plugin architecture for additional functionalities.
+
+Notes:
+
+Most of the Kipi-plugins have previously been DigikamPlugins.
+kipi-plugins is based in part on the work of the Independent JPEG Group.
+
+Current plugins ported to Qt4/KDE4:
+
+AcquireImages      : A tool to acquire images using flat scanner.
+Calendar           : A tool to create calendars.
+DngConverter       : A tool to convert Raw Image to Digital NeGative (DNG - http://en.wikipedia.org/wiki/Digital_Negative_(file_format)).
+Facebook           : A tool to import/export images to/from a remote Facebook web service (http://www.facebook.com).
+FlickrExport       : A tool to export images to a remote Flickr based web service (http://www.flickr.com). Also compatible with Zooomr and 23HQ 
+GalleryExport      : A tool to export images to a remote Gallery (and Gallery 2) server (http://gallery.sf.net).
+GPSSync            : A tool to geolocalize pictures.
+HTMLExport         : A tool to export images collections into a static XHTML page.
+ImageViewer        : A tool to preview images using OpenGL.
+JpegLossLess       : A tool to rotate/flip images without losing quality.
+MetadataEdit       : A tool to edit EXIF, IPTC and XMP metadata.
+PicasaWebExport    : A tool to export images to a remote Picasa web service (http://www.picasaweb.com).
+PrintImage         : A tool to print images in various format.
+RawConverter       : A tool to convert Raw Image to JPEG/PNG/TIFF.
+RemoveRedEyes      : A tool to remove red eyes on image automatically.
+SendImages         : A tool to send images by e-mail.
+SimpleViewerExport : A tool to export images to Flash using SimpleViewer (http://www.airtightinteractive.com/simpleviewer).
+SlideShow          : A tool to Slide images with 2D and 3D effects using OpenGL.
+Smug               : A tool to import/export images to/from a remote SmugMug web service (http://www.smugmug.com).
+TimeAdjust         : A tool to adjust date and time.
+IpodExport         : A tool to export pictures to an Ipod device.
+BatchProcess       : A tool to batch process images (convert, resize, rename, etc.).
+KIOExport          : A tool to export images to remote computer using network protocol (FTP, SSH, SAMBA, etc...).
+Shwup              : A tool to export images to Shwup web service (http://www.shwup.com).
+
+Porting under progress to Qt4/KDE4:
+
+WallPaper          : A tool to set image as background on your desktop.
+
+Not yet ported to Qt4/KDE4:
+
+CDArchiving        : A tool to archive your image collections to a CD or DVD.
+MpegEncoder        : A tool to create an MPEG slideshow with a set of images.
+
+-- DEPENDENCIES -------------------------------------------------------
+
+CMake           >= 2.4.5                        http://www.cmake.org
+libqt           >= 4.3.x                        http://www.qtsoftware.com
+libkde          >= 4.0.x                        http://www.kde.org
+libtiff         >= 3.6.x (>=3.8.2 recommended)  http://www.remotesensing.org/libtiff
+libjpeg         >= 6b                           http://www.ijg.org
+libpng          >= 1.2.x                        http://www.libpng.org/pub/png/libpng.html
+libkipi         >= 0.2.0                        http://www.digikam.org/sharedlibs
+libkexiv2       >= 0.5.0                        http://www.digikam.org/sharedlibs
+libkdcraw       >= 0.4.0                        http://www.digikam.org/sharedlibs          Using LibRaw decoder instead dcraw.
+ImageMagick     >= 5.5.4 (runtime dependency)   http://www.imagemagick.org
+
+Optional:
+
+libxslt         >= 1.1                          http://xmlsoft.org/XSLT
+libxml2         >= 2.7.x                        http://xmlsoft.org
+libX11          >= 1.1.5                        http://www.x11.org                         Linux Only.
+libexpat        >= 2.0.1                        http://expat.sourceforge.net
+libqtopengl     >= 4.3.x                        http://www.trolltech.com
+Mesa3D          >= 7.0.4                        http://mesa3d.sourceforge.net
+libopencv       >= 1.0                          http://opencv.willowgarage.com
+libgpod         >= 0.7.0                        http://www.gtkpod.org/libgpod.html
+libgdk          >= 2.0.0                        http://library.gnome.org/devel/gdk-pixbuf
+libqca          >= 2.0.0                        http://delta.affinix.com/qca
+
+Plugin Specific Dependencies (for compiling and for running) :
+
+SlideShow          : X11 (Linux Only), Mesa3D, and OpenGL support for libqt
+ImageViewer        : X11 (Linux Only), Mesa3D, and OpenGL support for libqt
+DngConverter       : libexpat and libkdcraw 0.4.0
+AcquireImages      : libksane
+HtmlZxport         : libxslt and libxml2
+JpegLossless       : imagemagick (runtime dependency)
+WallPaper          : kdebase (runtime dependency)
+RemoveRedEyes      : libopencv.
+IpodExport         : libgpod, libgdk.
+Calendar           : libkcal (kdepimlibs)
+Shwup              : libqca
+
+-- CONTACT ------------------------------------------------------------
+
+If you have questions, comments, suggestions to make do email at :
+
+kde-imaging@kde.org
+
+IRC channel from irc.freenode.org server: #kde-imaging
+                                          #digikam
+
+IMPORTANT : the bugreports and wishlist are hosted by the KDE bugs report 
+system who can be contacted by the standard Kde help menu of plugins dialog. 
+A mail will be automaticly sent to the Kipi mailing list.
+There is no need to contact directly the Kipi mailing list for a bug report 
+or a devel wish.
+
+The current Kipi bugs and devel wish reported to the Kde bugs report can be see 
+at this url :
+
+http://bugs.kde.org/buglist.cgi?product=kipiplugins&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED
+
+-- INSTALL ------------------------------------------------------------
+
+In order to compile, especially when QT3/Qt4 are installed at the same time, 
+just use something like that:
+
+# export VERBOSE=1
+# export QTDIR=/usr/lib/qt4/  
+# export PATH=$QTDIR/bin:$PATH 
+# cmake .
+# make
+
+Usual CMake options :
+
+-DCMAKE_INSTALL_PREFIX : decide where the program will be install on your computer.
+-DCMAKE_BUILD_TYPE     : decide which type of build you want. You can chose between "debugfull", "debug", "profile", "relwithdebinfo" and "release". The default is "relwithdebinfo" (-O2 -g).
+
+Compared to old KDE3 autoconf options:
+
+"cmake . -DCMAKE_BUILD_TYPE=debugfull" is equivalent to "./configure --enable-debug=full"
+"cmake . -DCMAKE_INSTALL_PREFIX=/usr"  is equivalent to "./configure --prefix=/usr"
+
+More details can be found ata this url: http://techbase.kde.org/Development/Tutorials/CMake#Environment_Variables
+
+Note: To know KDE install path on your computer, use 'kde-config --prefix' command line.
Index: /extensions/digikam_export/cmake/templates/svnscript.cmake.in_cmake
===================================================================
--- /extensions/digikam_export/cmake/templates/svnscript.cmake.in_cmake	(revision 4770)
+++ /extensions/digikam_export/cmake/templates/svnscript.cmake.in_cmake	(revision 4770)
@@ -0,0 +1,17 @@
+# Magnus Homann svn hack
+# Required?
+SET(CMAKE_BACKWARDS_COMPATIBILITY "2.4")
+
+# See if we have svn installed
+FIND_PROGRAM(SVNVERSION svnversion)
+
+# Read the version if installed, else set to "unknown"
+IF (SVNVERSION)
+        EXEC_PROGRAM(${SVNVERSION} ARGS @CMAKE_CURRENT_SOURCE_DIR@ OUTPUT_VARIABLE MYVERSION)
+ELSE (SVNVERSION)
+        SET(MYVERSION unknown)
+ENDIF (SVNVERSION)
+
+# Configure the svnversion.h
+CONFIGURE_FILE("@CMAKE_CURRENT_SOURCE_DIR@/cmake/templates/svnversion.h.in_cmake"
+               "@CMAKE_CURRENT_BINARY_DIR@/common/libkipiplugins/svnversion.h")
Index: /extensions/digikam_export/common/libkipiplugins/imagedialog.h
===================================================================
--- /extensions/digikam_export/common/libkipiplugins/imagedialog.h	(revision 4770)
+++ /extensions/digikam_export/common/libkipiplugins/imagedialog.h	(revision 4770)
@@ -0,0 +1,136 @@
+/* ============================================================
+ *
+ * This file is a part of kipi-plugins project
+ * http://www.kipi-plugins.org
+ *
+ * Date        : 2004-05-01
+ * Description : image files selector dialog.
+ *
+ * Copyright (C) 2004-2009 by Gilles Caulier <caulier dot gilles at gmail 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 IMAGEDIALOG_H
+#define IMAGEDIALOG_H
+
+// Qt includes
+
+#include <QThread>
+#include <QImage>
+
+// KDE includes
+
+#include <kurl.h>
+#include <kpreviewwidgetbase.h>
+
+// LibKIPI includes
+
+#include <libkipi/interface.h>
+
+// Local includes
+
+#include "kipiplugins_export.h"
+
+namespace KIPIPlugins
+{
+
+class ImageDialogPrivate;
+class ImageDialogPreviewPrivate;
+
+class KIPIPLUGINS_EXPORT ImageDialogPreview : public KPreviewWidgetBase
+{
+    Q_OBJECT
+
+public:
+
+    explicit ImageDialogPreview(KIPI::Interface *iface, QWidget *parent=0);
+    ~ImageDialogPreview();
+
+    QSize sizeHint() const;
+
+private Q_SLOTS:
+
+    void showPreview();
+    void showPreview(const KUrl&);
+    void slotThumbnail(const KUrl&, const QPixmap&);
+    void slotKDEPreview(const KFileItem&, const QPixmap&);
+    void slotKDEPreviewFailed(const KFileItem&);
+    void slotRawThumb(const KUrl&, const QImage&);
+    void clearPreview();
+
+private:
+
+    void resizeEvent(QResizeEvent *e);
+
+private:
+
+    ImageDialogPreviewPrivate* const d;
+};
+
+// ------------------------------------------------------------------------
+
+class KIPIPLUGINS_EXPORT ImageDialog
+{
+
+public:
+
+    ImageDialog(QWidget* parent, KIPI::Interface* iface, bool singleSelect=false, bool onlyRaw=false);
+    ~ImageDialog();
+
+    KUrl       url() const;
+    KUrl::List urls() const;
+
+    bool       onlyRaw() const;
+    bool       singleSelect() const;
+    QString    fileFormats() const;
+
+    static KUrl getImageUrl(QWidget* parent, KIPI::Interface* iface, bool onlyRaw=false);
+    static KUrl::List getImageUrls(QWidget* parent, KIPI::Interface* iface, bool onlyRaw=false);
+
+private:
+
+    ImageDialogPrivate* const d;
+};
+
+// ------------------------------------------------------------------------
+
+class LoadRawThumbThreadPriv;
+
+class KIPIPLUGINS_EXPORT LoadRawThumbThread : public QThread
+{
+    Q_OBJECT
+
+public:
+
+    explicit LoadRawThumbThread(QObject *parent, int size=256);
+    ~LoadRawThumbThread();
+
+    void getRawThumb(const KUrl& url);
+    void cancel();
+
+Q_SIGNALS:
+
+    void signalRawThumb(const KUrl&, const QImage& img);
+
+private:
+
+    void run();
+
+private:
+
+    LoadRawThumbThreadPriv* const d;
+};
+
+} // namespace KIPIPlugins
+
+#endif /* IMAGEDIALOG_H */
Index: /extensions/digikam_export/common/libkipiplugins/kipiplugins_export.h
===================================================================
--- /extensions/digikam_export/common/libkipiplugins/kipiplugins_export.h	(revision 4770)
+++ /extensions/digikam_export/common/libkipiplugins/kipiplugins_export.h	(revision 4770)
@@ -0,0 +1,40 @@
+/*  This file is part of the KDE project
+    Copyright (C) 2007 David Faure <faure@kde.org>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KIPIPLUGINS_EXPORT_H
+#define KIPIPLUGINS_EXPORT_H
+
+/* needed for KDE_EXPORT and KDE_IMPORT macros */
+#include <kdemacros.h>
+
+#ifndef KIPIPLUGINS_EXPORT
+# if defined(MAKE_KIPIPLUGINS_LIB)
+   /* We are building this library */ 
+#  define KIPIPLUGINS_EXPORT KDE_EXPORT
+# else
+   /* We are using this library */ 
+#  define KIPIPLUGINS_EXPORT KDE_IMPORT
+# endif
+#endif
+
+# ifndef KIPIPLUGINS_EXPORT_DEPRECATED
+#  define KIPIPLUGINS_EXPORT_DEPRECATED KDE_DEPRECATED KIPIPLUGINS_EXPORT
+# endif
+
+#endif
Index: /extensions/digikam_export/common/libkipiplugins/kpaboutdata.h
===================================================================
--- /extensions/digikam_export/common/libkipiplugins/kpaboutdata.h	(revision 4770)
+++ /extensions/digikam_export/common/libkipiplugins/kpaboutdata.h	(revision 4770)
@@ -0,0 +1,51 @@
+/* ============================================================
+ *
+ * This file is a part of kipi-plugins project
+ * http://www.kipi-plugins.org
+ *
+ * Date        : 2006-14-09
+ * Description : Kipi-Plugins shared library.
+ *
+ * Copyright (C) 2006-2009 Angelo Naselli <anaselli at linux dot it>
+ *
+ * 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 KPABOUTDATA_H
+#define KPABOUTDATA_H
+
+// KDE includes
+
+#include <kaboutdata.h>
+
+// LibKIPI includes
+
+#include "kipiplugins_export.h"
+
+namespace KIPIPlugins
+{
+
+class KIPIPLUGINS_EXPORT KPAboutData : public KAboutData
+{
+
+    public:
+
+      explicit KPAboutData(const KLocalizedString& pluginName,
+                           const QByteArray& pluginVersion            = QByteArray(),
+                           enum LicenseKey licenseType                = License_Unknown,
+                           const KLocalizedString& pluginDescription  = KLocalizedString(),
+                           const KLocalizedString& copyrightStatement = ki18n("Copyright 2003-2009, kipi-plugins team"));
+};
+
+} // namespace KIPIPlugins
+
+#endif //KPABOUTDATA_H
Index: /extensions/digikam_export/common/libkipiplugins/pluginsversion.h
===================================================================
--- /extensions/digikam_export/common/libkipiplugins/pluginsversion.h	(revision 4770)
+++ /extensions/digikam_export/common/libkipiplugins/pluginsversion.h	(revision 4770)
@@ -0,0 +1,52 @@
+/* ============================================================
+ *
+ * This file is a part of kipi-plugins project
+ * http://www.kipi-plugins.org
+ *
+ * Date        : 2006-14-09
+ * Description : Kipi-Plugins release ID header.
+ * 
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail 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 KIPIPLUGINS_VERSION_H
+#define KIPIPLUGINS_VERSION_H
+
+// Qt includes.
+
+#include <QString>
+
+// KDE includes.
+
+#include <klocale.h>
+
+// Local includes.
+
+#include <svnversion.h>
+
+static const char kipiplugins_version[] = "1.0.0";
+
+static inline const QString kipipluginsVersion()
+{
+    // We only take the mixed revision
+    QString svnVer         = QString(SVNVERSION).section(":", 0, 0);
+        
+    QString kipipluginsVer = QString(kipiplugins_version);
+    if (!svnVer.isEmpty() && !svnVer.startsWith("unknow") && !svnVer.startsWith("export"))
+    kipipluginsVer = i18nc("%1 is kipi-plugins version, %2 is the svn revision", "%1 (rev.: %2)", kipiplugins_version, svnVer);
+                    
+    return kipipluginsVer;
+}
+
+#endif // KIPIPLUGINS_VERSION_H
Index: /extensions/digikam_export/kipi-plugins.lsm.cmake
===================================================================
--- /extensions/digikam_export/kipi-plugins.lsm.cmake	(revision 4770)
+++ /extensions/digikam_export/kipi-plugins.lsm.cmake	(revision 4770)
@@ -0,0 +1,18 @@
+Begin4
+Title:          kipi-plugins
+Version:        ${KIPIPLUGINS_VERSION_STRING}
+Entered-date:   ${KIPIPLUGINS_RELEASE_DATE}
+Description:    Plugins for KIPI, the KDE Image Plugin Interface
+Keywords:       kde image plugins, digiKam, photo management, KDE, Graphics, Digital Photo Management, Exif, Iptc, Makenotes, Xmp, Geolocation, Batch process, Raw workflow
+Author:         caulier dot gilles at gmail dot com (Gilles Caulier)
+                marcel dot wiesweg at gmx dot de (Marcel Wiesweg)
+                aurelien dot gateau at free dot fr (Aurelien Gateau)
+                blackie at kde dot org (Jesper K. Pedersen)
+                renchi dot raju at gmail dot com (Renchi Raju)
+Maintained-by:
+Primary-site:   http://www.kipi-plugins.org
+Alternate-site: http://www.digikam.org
+Original-site:
+Platforms:      Linux and other Unices, MacOs-X, Win32. Needs KDE 4.x
+Copying-policy: GPL
+End
Index: /extensions/digikam_export/piwigoexport/CMakeLists.txt
===================================================================
--- /extensions/digikam_export/piwigoexport/CMakeLists.txt	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/CMakeLists.txt	(revision 4770)
@@ -0,0 +1,27 @@
+SUBDIRS(icons)
+
+SET(kipiplugin_piwigoexport_PART_SRCS
+    plugin_piwigoexport.cpp
+    albumdlg.cpp
+    piwigos.cpp
+    piwigoconfig.cpp
+    piwigowindow.cpp
+    piwigotalker.cpp
+   )
+
+KDE4_ADD_UI_FILES(kipiplugin_piwigoexport_PART_SRCS piwigoalbumwidget.ui)
+
+KDE4_ADD_PLUGIN(kipiplugin_piwigoexport ${kipiplugin_piwigoexport_PART_SRCS})
+
+TARGET_LINK_LIBRARIES(kipiplugin_piwigoexport
+                      ${KDCRAW_LIBRARIES}
+                      ${KIPI_LIBRARIES}
+                      ${KEXIV2_LIBRARIES}
+                      ${KDE4_KIO_LIBS}
+                      ${KDE4_KDEUI_LIBS}
+                      kipiplugins
+                     )
+
+INSTALL(TARGETS kipiplugin_piwigoexport DESTINATION ${PLUGIN_INSTALL_DIR})
+INSTALL(FILES kipiplugin_piwigoexport.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+INSTALL(FILES piwigo_logo.png DESTINATION ${DATA_INSTALL_DIR}/kipiplugin_piwigoexport/pics)
Index: /extensions/digikam_export/piwigoexport/albumdlg.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/albumdlg.cpp	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/albumdlg.cpp	(revision 4770)
@@ -0,0 +1,48 @@
+/* ============================================================
+ *
+ * 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: /extensions/digikam_export/piwigoexport/albumdlg.h
===================================================================
--- /extensions/digikam_export/piwigoexport/albumdlg.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/albumdlg.h	(revision 4770)
@@ -0,0 +1,49 @@
+/* ============================================================
+ *
+ * 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: /extensions/digikam_export/piwigoexport/icons/CMakeLists.txt
===================================================================
--- /extensions/digikam_export/piwigoexport/icons/CMakeLists.txt	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/icons/CMakeLists.txt	(revision 4770)
@@ -0,0 +1,3 @@
+KDE4_INSTALL_ICONS( ${ICON_INSTALL_DIR} )
+
+
Index: /extensions/digikam_export/piwigoexport/kipiplugin_piwigoexport.desktop
===================================================================
--- /extensions/digikam_export/piwigoexport/kipiplugin_piwigoexport.desktop	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/kipiplugin_piwigoexport.desktop	(revision 4770)
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Remote Piwigo Export
+Name[fr]=Module externe pour l'export vers Piwigo
+Comment=A tool to export images to a remote Pwigo
+Comment[fr]=Outil pour l'exportation vers Piwigo
+Type=Service
+ServiceTypes=KIPI/Plugin
+X-KDE-Library=kipiplugin_piwigoexport
Index: /extensions/digikam_export/piwigoexport/piwigoalbumwidget.ui
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigoalbumwidget.ui	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigoalbumwidget.ui	(revision 4770)
@@ -0,0 +1,153 @@
+<?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/piwigoconfig.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigoconfig.cpp	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigoconfig.cpp	(revision 4770)
@@ -0,0 +1,132 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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.
+ *
+ * ============================================================ */
+
+#include "piwigoconfig.h"
+#include "piwigoconfig.moc"
+
+// Qt includes
+
+#include <QFrame>
+#include <QGridLayout>
+#include <QPushButton>
+
+// KDE includes
+
+#include <kdebug.h>
+#include <klocale.h>
+
+// LibKIPI includes
+
+#include <libkipi/version.h>
+#include <libkipi/interface.h>
+
+// Local includes
+
+#include "piwigos.h"
+
+namespace KIPIPiwigoExportPlugin
+{
+
+PiwigoEdit::PiwigoEdit(QWidget* pParent, Piwigo* pPiwigo, const QString& title)
+        : KDialog(pParent, Qt::Dialog)
+{
+    mpPiwigo = pPiwigo;
+
+    setCaption(title);
+
+    QFrame *page = new QFrame(this);
+    QGridLayout* centerLayout = new QGridLayout();
+    page->setMinimumSize(500, 200);
+    setMainWidget(page);
+
+    mpNameEdit = new KLineEdit(this);
+    centerLayout->addWidget(mpNameEdit, 0, 1);
+
+    mpUrlEdit = new KLineEdit(this);
+    centerLayout->addWidget(mpUrlEdit, 1, 1);
+
+    mpUsernameEdit = new KLineEdit(this);
+    centerLayout->addWidget(mpUsernameEdit, 2, 1);
+
+    mpPasswordEdit = new KLineEdit(this);
+    mpPasswordEdit->setEchoMode(KLineEdit::Password);
+    centerLayout->addWidget(mpPasswordEdit, 3, 1);
+
+    QLabel* namelabel = new QLabel(this);
+    namelabel->setText(i18nc("piwigo login settings", "Name:"));
+    centerLayout->addWidget(namelabel, 0, 0);
+
+    QLabel* urlLabel = new QLabel(this);
+    urlLabel->setText(i18nc("piwigo login settings", "URL:"));
+    centerLayout->addWidget(urlLabel, 1, 0);
+
+    QLabel* usernameLabel = new QLabel(this);
+    usernameLabel->setText(i18nc("piwigo login settings", "Username:"));
+    centerLayout->addWidget(usernameLabel, 2, 0);
+
+    QLabel* passwdLabel = new QLabel(this);
+    passwdLabel->setText(i18nc("piwigo login settings", "Password:"));
+    centerLayout->addWidget(passwdLabel, 3, 0);
+
+    //---------------------------------------------
+
+    page->setLayout(centerLayout);
+
+    resize(QSize(300, 150).expandedTo(minimumSizeHint()));
+
+    // setting initial data
+    mpNameEdit->setText(pPiwigo->name());
+    mpUrlEdit->setText(pPiwigo->url());
+    mpUsernameEdit->setText(pPiwigo->username());
+    mpPasswordEdit->setText(pPiwigo->password());
+
+    connect(this, SIGNAL( okClicked() ),
+            this, SLOT( slotOk() ));
+}
+
+PiwigoEdit::~PiwigoEdit()
+{
+}
+
+void PiwigoEdit::slotOk()
+{
+    if (mpNameEdit->isModified())
+        mpPiwigo->setName(mpNameEdit->text());
+
+    if (mpUrlEdit->isModified())
+        mpPiwigo->setUrl(mpUrlEdit->text());
+
+    if (mpUsernameEdit->isModified())
+        mpPiwigo->setUsername(mpUsernameEdit->text());
+
+    if (mpPasswordEdit->isModified())
+        mpPiwigo->setPassword(mpPasswordEdit->text());
+
+    mpPiwigo->save();
+    accept();
+}
+
+} // namespace KIPIPiwigoExportPlugin
Index: /extensions/digikam_export/piwigoexport/piwigoconfig.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigoconfig.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigoconfig.h	(revision 4770)
@@ -0,0 +1,72 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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 PIWIGOCONFIG_H
+#define PIWIGOCONFIG_H
+
+// Qt includes
+
+#include <QLabel>
+#include <QCheckBox>
+
+// KDE includes
+
+#include <kdialog.h>
+#include <klineedit.h>
+
+namespace KIPIPiwigoExportPlugin
+{
+
+class Piwigo;
+
+class PiwigoEdit : public KDialog
+{
+    Q_OBJECT
+
+public:
+
+    PiwigoEdit(QWidget* pParent, Piwigo* pPiwigo, const QString& title);
+    ~PiwigoEdit();
+
+private Q_SLOTS:
+
+    void slotOk();
+
+private:
+
+    QLabel*    mpHeaderLabel;
+
+    KLineEdit* mpNameEdit;
+    KLineEdit* mpUrlEdit;
+    KLineEdit* mpUsernameEdit;
+    KLineEdit* mpPasswordEdit;
+
+    Piwigo*   mpPiwigo;
+};
+
+} // namespace KIPIPiwigoExportPlugin
+
+#endif /* PIWIGOCONFIG_H */
Index: /extensions/digikam_export/piwigoexport/piwigoitem.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigoitem.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigoitem.h	(revision 4770)
@@ -0,0 +1,86 @@
+/* ============================================================
+*
+* 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+* Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+* 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 PIWIGOITEM_H
+#define PIWIGOITEM_H
+
+// Qt includes
+
+#include <QString>
+
+namespace KIPIPiwigoExportPlugin
+{
+
+class GPhoto
+{
+public:
+
+    GPhoto() {
+        ref_num = -1;
+    }
+
+    int     ref_num;
+    int     album_num;
+
+    QString name;
+    QString caption;
+    QString thumbName;
+    QString albumURL;
+};
+
+// ------------------------------------------------------------------------
+
+class GAlbum
+{
+public:
+
+    GAlbum() {
+        ref_num        = -1;
+        parent_ref_num = -1;
+    }
+
+    bool operator<(const GAlbum& rhs) const {
+        if (parent_ref_num == rhs.parent_ref_num) {
+            return ref_num < rhs.ref_num;
+        }
+        return parent_ref_num < rhs.parent_ref_num;
+    }
+
+    // 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            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
+
+#endif /* PIWIGOITEM_H */
Index: /extensions/digikam_export/piwigoexport/piwigos.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigos.cpp	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigos.cpp	(revision 4770)
@@ -0,0 +1,140 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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.
+ *
+ * ============================================================ */
+
+#include "piwigos.h"
+
+// Qt includes
+
+#include <QString>
+
+// KDE includes
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kconfiggroup.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+namespace KIPIPiwigoExportPlugin
+{
+
+Piwigo::Piwigo()
+{
+    load();
+}
+
+Piwigo::~Piwigo()
+{
+}
+
+QString Piwigo::name() const
+{
+    return mName;
+}
+
+QString Piwigo::url() const
+{
+    return mUrl;
+}
+
+QString Piwigo::username() const
+{
+    return mUsername;
+}
+
+QString Piwigo::password() const
+{
+    return mPassword;
+}
+
+unsigned int Piwigo::galleryId() const
+{
+    return mPiwigoId;
+}
+
+// -------------------------------------
+
+void Piwigo::setName(const QString& name)
+{
+    mName = name;
+}
+
+void Piwigo::setUrl(const QString& url)
+{
+    mUrl = url;
+}
+
+void Piwigo::setUsername(const QString& username)
+{
+    mUsername = username;
+}
+
+void Piwigo::setPassword(const QString& password)
+{
+    mPassword = password;
+}
+
+void Piwigo::setPiwigoId(unsigned int galleryId)
+{
+    mPiwigoId = galleryId;
+}
+
+void Piwigo::load()
+{
+    // FIXME: sure we need this?? (perhaps YES..)
+    static bool bln_loaded = false;
+    if (bln_loaded) return;
+    bln_loaded = true;
+
+    // read config
+    KConfig config("kipirc");
+    KConfigGroup group = config.group("Piwigo Settings");
+
+    kDebug() << "Reading data from kipirc file..";
+
+    mName     = group.readEntry("Name",     QString() );
+    mUrl      = group.readEntry("URL",      QString() );
+    mUsername = group.readEntry("Username", QString() );
+    mPassword = group.readEntry("Password", QString() );
+}
+
+void Piwigo::save()
+{
+    KConfig config("kipirc");
+    KConfigGroup group = config.group("Piwigo Settings");
+
+    kDebug() << "Saving data to kipirc file..";
+
+    group.writeEntry(QString("Name"),     name() );
+    group.writeEntry(QString("URL"),      url() );
+    group.writeEntry(QString("Username"), username() );
+    group.writeEntry(QString("Password"), password() );
+
+    kDebug() << "syncing..";
+    config.sync();
+}
+
+} // namespace KIPIPiwigoExportPlugin
Index: /extensions/digikam_export/piwigoexport/piwigos.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigos.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigos.h	(revision 4770)
@@ -0,0 +1,85 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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 GALLERIES_H
+#define GALLERIES_H
+
+// Qt includes
+
+#include <QString>
+
+namespace KWallet
+{
+class Wallet;
+}
+
+namespace KIPIPiwigoExportPlugin
+{
+
+class Piwigo
+{
+
+public:
+
+    Piwigo();
+    ~Piwigo();
+
+    QString name()           const;
+    QString url()            const;
+    QString username()       const;
+    QString password()       const;
+    unsigned int version()   const;
+    unsigned int galleryId() const;
+
+    void setName(const QString& name);
+    void setUrl(const QString& url);
+    void setUsername(const QString& username);
+    void setPassword(const QString& password);
+    void setPiwigoId(unsigned int galleryId);
+
+public:
+
+    void save();
+
+private:
+
+    void load();
+
+private:
+
+    unsigned int     mPiwigoId;
+
+    QString          mName;
+    QString          mUrl;
+    QString          mUsername;
+    QString          mPassword;
+
+    KWallet::Wallet* mpWallet;
+};
+
+} // namespace KIPIPiwigoExportPlugin
+
+#endif /* GALLERIES_H */
Index: /extensions/digikam_export/piwigoexport/piwigotalker.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigotalker.cpp	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigotalker.cpp	(revision 4770)
@@ -0,0 +1,935 @@
+/* ============================================================
+*
+* 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+* Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+* 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.
+*
+* ============================================================ */
+
+#include "piwigotalker.h"
+#include "piwigotalker.moc"
+
+// C++ includes
+
+#include <cstring>
+#include <cstdio>
+
+// Qt includes
+
+#include <QByteArray>
+#include <QImage>
+#include <QRegExp>
+#include <QXmlStreamReader>
+#include <QFileInfo>
+#include <QCryptographicHash>
+
+// KDE includes
+
+#include <kdebug.h>
+#include <kio/job.h>
+#include <kio/jobuidelegate.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+// LibKExiv2 includes
+
+#include <libkexiv2/kexiv2.h>
+
+// LibKDcraw includes
+
+#include <libkdcraw/version.h>
+#include <libkdcraw/kdcraw.h>
+
+// Local includes
+
+#include "piwigoitem.h"
+#include "pluginsversion.h"
+
+namespace KIPIPiwigoExportPlugin
+{
+
+QString PiwigoTalker::s_authToken   = "";
+
+PiwigoTalker::PiwigoTalker(QWidget* parent)
+        : m_parent(parent),  m_job(0),  m_loggedIn(false)
+{
+    kDebug() << "BEGIN\n";
+}
+
+PiwigoTalker::~PiwigoTalker()
+{
+    if (m_job)
+        m_job->kill();
+}
+
+QByteArray PiwigoTalker::computeMD5Sum(const QString &filepath)
+{
+    QFile file(filepath);
+
+    file.open(QIODevice::ReadOnly);
+    QByteArray md5sum = QCryptographicHash::hash(file.readAll(), QCryptographicHash::Md5);
+    file.close();
+
+    return md5sum;
+}
+
+bool PiwigoTalker::loggedIn() const
+{
+    return m_loggedIn;
+}
+
+void PiwigoTalker::login(const KUrl& url, const QString& name, const QString& passwd)
+{
+    m_job   = 0;
+    m_url   = url;
+    m_state = GE_LOGIN;
+    m_talker_buffer.resize(0);
+
+    QString auth = name + QString(":") + passwd;
+    s_authToken = "Basic " + auth.toUtf8().toBase64();
+
+    QStringList qsl;
+    qsl.append("password=" + passwd);
+    qsl.append("method=pwg.session.login");
+    qsl.append("username=" + name);
+    QString dataParameters = qsl.join("&");
+    QByteArray buffer;
+    buffer.append(dataParameters.toUtf8());
+    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 );
+
+    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);
+}
+
+void PiwigoTalker::listAlbums()
+{
+    m_job   = 0;
+    m_state = GE_LISTALBUMS;
+    m_talker_buffer.resize(0);
+
+    QStringList qsl;
+    qsl.append("method=pwg.categories.getList");
+    qsl.append("recursive=true");
+    QString dataParameters = qsl.join("&");
+    QByteArray buffer;
+    buffer.append(dataParameters.toUtf8());
+
+    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&)),
+            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
+
+    connect(m_job, SIGNAL(result(KJob *)),
+            this, SLOT(slotResult(KJob *)));
+
+    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
+}
+
+bool PiwigoTalker::addPhoto(int albumId,
+                            const QString& photoPath,
+                            const QString& caption,
+                            bool  captionIsTitle,
+                            bool  captionIsDescription,
+                            bool  rescale,
+                            int   maxDim,
+                            int   thumbDim)
+{
+    m_job        = 0;
+    m_state      = GE_CHECKPHOTOEXIST;
+    m_talker_buffer.resize(0);
+
+    m_path = photoPath;
+    m_albumId = albumId;
+    m_md5sum = computeMD5Sum(photoPath);
+
+    kDebug() << photoPath << " " << m_md5sum.toHex();
+
+    QImage image;
+
+    // Check if RAW file.
+    QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
+    QFileInfo fi(photoPath);
+
+    if (rawFilesExt.toUpper().contains( fi.suffix().toUpper() ))
+        KDcrawIface::KDcraw::loadDcrawPreview(image, photoPath);
+    else
+        image.load(photoPath);
+
+    if (!image.isNull()) {
+        QImage thumbnail = image.scaled(thumbDim, thumbDim, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+        m_thumbpath = KStandardDirs::locateLocal("tmp", "thumb-" + KUrl(photoPath).fileName());
+        thumbnail.save(m_thumbpath, "JPEG", 80);
+        kDebug() << "Thumbnail to temp file: " << m_thumbpath ;
+
+
+        // image file - see if we need to rescale it
+        if (rescale && (image.width() > maxDim || image.height() > maxDim)) {
+            image = image.scaled(maxDim, maxDim, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+        }
+
+        m_path = KStandardDirs::locateLocal("tmp", KUrl(photoPath).fileName());
+        image.save(m_path, "JPEG", 80);
+        kDebug() << "Resizing and saving to temp file: " << m_path ;
+
+        // Complete name and comment for summary sending
+        m_comment = m_name = KUrl(photoPath).fileName();
+        m_date = fi.created();
+
+        // Restore all metadata.
+        KExiv2Iface::KExiv2 exiv2Iface;
+
+        if (exiv2Iface.load(photoPath)) {
+            exiv2Iface.setImageProgramId(QString("Kipi-plugins"), QString(kipiplugins_version));
+            exiv2Iface.setImageDimensions(image.size());
+            exiv2Iface.save(m_path);
+            kDebug() << "Comment : " << exiv2Iface.getExifComment();
+            if (exiv2Iface.getExifComment().length()) {
+                if (captionIsTitle) m_name = exiv2Iface.getExifComment();
+                if (captionIsDescription) m_comment = exiv2Iface.getExifComment();
+            }
+            m_date = exiv2Iface.getImageDateTime();
+        } else {
+            kWarning() << "Image " << photoPath << " has no exif data";
+        }
+
+    } else {
+        // Invalid image
+        return false;
+    }
+
+    QStringList qsl;
+    qsl.append("method=pwg.images.exist");
+    qsl.append("md5sum_list=" + m_md5sum.toHex());
+    QString dataParameters = qsl.join("&");
+    QByteArray buffer;
+    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&)),
+            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
+
+    connect(m_job, SIGNAL(result(KJob *)),
+            this, SLOT(slotResult(KJob *)));
+
+    emit signalBusy(true);
+
+    return true;
+}
+
+void PiwigoTalker::cancel()
+{
+    if (m_job) {
+        m_job->kill();
+        m_job = 0;
+    }
+}
+
+void PiwigoTalker::slotTalkerData(KIO::Job*, const QByteArray& data)
+{
+    if (data.isEmpty())
+        return;
+
+    int oldSize = m_talker_buffer.size();
+    m_talker_buffer.resize(oldSize + data.size());
+    memcpy(m_talker_buffer.data() + oldSize, data.data(), data.size());
+
+    kDebug() << data;
+}
+
+void PiwigoTalker::slotResult(KJob *job)
+{
+    KIO::Job *tempjob = static_cast<KIO::Job*>(job);
+
+    if (tempjob->error()) {
+        if (m_state == GE_LOGIN) {
+            emit signalLoginFailed(tempjob->errorString());
+            kDebug() << tempjob->errorString();
+        } else {
+            if (m_state == GE_CHECKPHOTOEXIST || m_state == GE_ADDPHOTO) {
+                emit signalAddPhotoFailed(tempjob->errorString());
+            } else {
+                tempjob->ui()->setWindow(m_parent);
+                tempjob->ui()->showErrorMessage();
+            }
+        }
+        emit signalBusy(false);
+        return;
+    }
+
+    switch (m_state) {
+    case(GE_LOGIN):
+        parseResponseLogin(m_talker_buffer);
+        break;
+    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):
+        parseResponseDoesPhotoExist(m_talker_buffer);
+        break;
+    case(GE_ADDPHOTO):
+        parseResponseAddPhoto(m_talker_buffer);
+        break;
+    case(GE_ADDTHUMB):
+        parseResponseAddThumbnail(m_talker_buffer);
+        break;
+    case(GE_ADDPHOTOSUMMARY):
+        parseResponseAddPhotoSummary(m_talker_buffer);
+        break;
+    }
+
+    tempjob->kill();
+    m_job = 0;
+
+    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();
+    }
+    emit signalBusy(false);
+}
+
+
+void PiwigoTalker::parseResponseLogin(const QByteArray &data)
+{
+    QXmlStreamReader ts(data);
+    QString line;
+    bool foundResponse = false;
+    m_loggedIn         = false;
+
+    while (!ts.atEnd()) {
+        ts.readNext();
+
+        if (ts.isStartElement()) {
+            foundResponse = true;
+            if (ts.name() == "rsp" && ts.attributes().value("stat") == "ok") {
+                m_loggedIn = true;
+            }
+        }
+    }
+
+    if (!foundResponse) {
+        emit signalLoginFailed(i18n("Piwigo URL probably incorrect"));
+        return;
+    }
+
+    if (!m_loggedIn) {
+        emit signalLoginFailed(i18n("Incorrect username or password specified"));
+    }
+}
+
+void PiwigoTalker::parseResponseListAlbums(const QByteArray& data)
+{
+    QString str = QString::fromUtf8(data);
+    QXmlStreamReader ts(data);
+    QString line;
+    bool foundResponse = false;
+    bool success       = false;
+
+    typedef QList<GAlbum> GAlbumList;
+    GAlbumList albumList;
+    GAlbumList::iterator iter = albumList.begin();
+
+    kDebug() << QString(data);
+
+    while (!ts.atEnd()) {
+        ts.readNext();
+
+        if (ts.isEndElement() && ts.name() == "categories")
+            break;
+
+        if (ts.isStartElement()) {
+            if (ts.name() == "rsp" && ts.attributes().value("stat") == "ok") {
+                foundResponse = true;
+            }
+            if (ts.name() == "categories") {
+                success = true;
+            }
+            if (ts.name() == "category") {
+                GAlbum album;
+                album.ref_num = ts.attributes().value("id").toString().toInt();
+                album.parent_ref_num = -1;
+                album.baseurl = ts.attributes().value("url").toString();
+
+                kDebug() << album.ref_num << " " << album.baseurl << "\n";
+
+                iter = albumList.insert(iter, album);
+            }
+            if (ts.name() == "name") {
+                (*iter).name = ts.readElementText();
+                kDebug() << (*iter).name << "\n";
+            }
+            if (ts.name() == "uppercats") {
+                QString uppercats = ts.readElementText();
+                QStringList catlist = uppercats.split(',');
+                if (catlist.size() > 1 && catlist.at(catlist.size() - 2).toInt() != (*iter).ref_num) {
+                    (*iter).parent_ref_num = catlist.at(catlist.size() - 2).toInt();
+                    kDebug() << (*iter).parent_ref_num << "\n";
+                }
+            }
+        }
+    }
+
+    if (!foundResponse) {
+        emit signalError(i18n("Invalid response received from remote Piwigo"));
+        return;
+    }
+
+    if (!success) {
+        emit signalError(i18n("Failed to list albums"));
+        return;
+    }
+
+    // We need parent albums to come first for rest of the code to work
+    qSort(albumList);
+
+    emit signalAlbums(albumList);
+}
+
+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)
+{
+    QString str = QString::fromUtf8(data);
+    QXmlStreamReader ts(data);
+    QString line;
+    bool foundResponse = false;
+    bool success       = false;
+
+//    typedef QList<GAlbum> GAlbumList;
+//    GAlbumList albumList;
+//    GAlbumList::iterator iter = albumList.begin();
+
+    kDebug() << QString(data);
+
+    while (!ts.atEnd()) {
+        ts.readNext();
+
+        if (ts.isStartElement()) {
+            if (ts.name() == "rsp") {
+                foundResponse = true;
+                if (ts.attributes().value("stat") == "ok") success = true;
+                break;
+            }
+        }
+    }
+
+    if (!foundResponse) {
+        emit signalAddPhotoFailed(i18n("Invalid response received from remote Piwigo"));
+        return;
+    }
+
+    if (!success) {
+        emit signalAddPhotoFailed(i18n("Failed to upload photo"));
+        return;
+    }
+
+    m_state = GE_ADDPHOTO;
+
+    QFile imagefile(m_path);
+    imagefile.open(QIODevice::ReadOnly);
+
+    QStringList qsl;
+    qsl.append("method=pwg.images.addChunk");
+    qsl.append("original_sum=" + m_md5sum.toHex());
+    qsl.append("position=1");
+    qsl.append("type=file");
+    qsl.append("data=" + imagefile.readAll().toBase64().toPercentEncoding());
+    QString dataParameters = qsl.join("&");
+    QByteArray buffer;
+    buffer.append(dataParameters.toUtf8());
+
+    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&)),
+            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
+
+    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
+}
+
+
+void PiwigoTalker::parseResponseAddPhoto(const QByteArray& data)
+{
+    QString str = QString::fromUtf8(data);
+    QXmlStreamReader ts(data);
+    QString line;
+    bool foundResponse = false;
+    bool success       = false;
+
+    kDebug() << QString(data);
+
+    while (!ts.atEnd()) {
+        ts.readNext();
+
+        if (ts.isStartElement()) {
+            if (ts.name() == "rsp") {
+                foundResponse = true;
+                if (ts.attributes().value("stat") == "ok") success = true;
+                break;
+            }
+        }
+    }
+
+    if (!foundResponse) {
+        emit signalAddPhotoFailed(i18n("Invalid response received from remote Piwigo"));
+        return;
+    }
+
+    if (!success) {
+        emit signalAddPhotoFailed(i18n("Failed to upload photo"));
+        return;
+    }
+
+    m_state = GE_ADDTHUMB;
+
+    QFile imagefile(m_thumbpath);
+    imagefile.open(QIODevice::ReadOnly);
+
+    QStringList qsl;
+    qsl.append("method=pwg.images.addChunk");
+    qsl.append("original_sum=" + m_md5sum.toHex());
+    qsl.append("position=1");
+    qsl.append("type=thumb");
+    qsl.append("data=" + imagefile.readAll().toBase64().toPercentEncoding());
+    QString dataParameters = qsl.join("&");
+    QByteArray buffer;
+    buffer.append(dataParameters.toUtf8());
+
+    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&)),
+            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
+
+    connect(m_job, SIGNAL(result(KJob *)),
+            this, SLOT(slotResult(KJob *)));
+
+}
+
+void PiwigoTalker::parseResponseAddThumbnail(const QByteArray& data)
+{
+    QString str = QString::fromUtf8(data);
+    QXmlStreamReader ts(data);
+    QString line;
+    bool foundResponse = false;
+    bool success       = false;
+
+    kDebug() << QString(data);
+
+    while (!ts.atEnd()) {
+        ts.readNext();
+
+        if (ts.isStartElement()) {
+            if (ts.name() == "rsp") {
+                foundResponse = true;
+                if (ts.attributes().value("stat") == "ok") success = true;
+                break;
+            }
+        }
+    }
+
+    if (!foundResponse) {
+        emit signalAddPhotoFailed(i18n("Invalid response received from remote Piwigo"));
+        return;
+    }
+
+    if (!success) {
+        emit signalAddPhotoFailed(i18n("Failed to upload photo"));
+        return;
+    }
+
+    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);
+
+    QStringList qsl;
+    qsl.append("method=pwg.images.add");
+    qsl.append("original_sum=" + m_md5sum.toHex());
+    qsl.append("name=" + m_name.toUtf8().toPercentEncoding());
+    qsl.append("author="); // TODO
+    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("tag_ids=");
+    qsl.append("comment=" + m_comment.toUtf8().toPercentEncoding());
+    QString dataParameters = qsl.join("&");
+    QByteArray buffer;
+    buffer.append(dataParameters.toUtf8());
+
+    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&)),
+            this, SLOT(slotTalkerData(KIO::Job*, const QByteArray&)));
+
+    connect(m_job, SIGNAL(result(KJob *)),
+            this, SLOT(slotResult(KJob *)));
+}
+
+void PiwigoTalker::parseResponseAddPhotoSummary(const QByteArray& data)
+{
+    QString str = QString::fromUtf8(data);
+    QXmlStreamReader ts(data);
+    QString line;
+    bool foundResponse = false;
+    bool success       = false;
+
+    kDebug() << QString(data);
+
+    while (!ts.atEnd()) {
+        ts.readNext();
+
+        if (ts.isStartElement()) {
+            if (ts.name() == "rsp") {
+                foundResponse = true;
+                if (ts.attributes().value("stat") == "ok") success = true;
+                break;
+            }
+        }
+    }
+
+    if (!foundResponse) {
+        emit signalAddPhotoFailed(i18n("Invalid response received from remote Piwigo"));
+        return;
+    }
+
+    if (!success) {
+        emit signalAddPhotoFailed(i18n("Failed to upload photo"));
+        return;
+    }
+
+#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 (!success) {
+        emit signalAddPhotoFailed(i18n("Failed to upload photo"));
+    } else {
+        emit signalAddPhotoSucceeded();
+    }
+}
+} // namespace KIPIPiwigoExportPlugin
Index: /extensions/digikam_export/piwigoexport/piwigotalker.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigotalker.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigotalker.h	(revision 4770)
@@ -0,0 +1,154 @@
+/* ============================================================
+*
+* 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+* Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+* 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 PIWIGOTALKER_H
+#define PIWIGOTALKER_H
+
+// Qt includes
+
+#include <QObject>
+#include <QList>
+#include <QDateTime>
+// Debug
+#include <QTextStream>
+#include <QFile>
+
+// KDE includes
+
+#include <KUrl>
+#include <kio/job.h>
+
+namespace KIO
+{
+class Job;
+}
+
+class KUrl;
+template <class T> class QList;
+
+namespace KIPIPiwigoExportPlugin
+{
+
+class GAlbum;
+class GPhoto;
+
+class PiwigoTalker : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    enum State {
+        GE_LOGIN = 0,
+        GE_LISTALBUMS,
+        GE_LISTPHOTOS,
+        GE_CREATEALBUM,
+        GE_CHECKPHOTOEXIST,
+        GE_ADDPHOTO,
+        GE_ADDTHUMB,
+        GE_ADDPHOTOSUMMARY
+    };
+
+public:
+
+    PiwigoTalker(QWidget* parent);
+    ~PiwigoTalker();
+
+    static QString getAuthToken() {
+        return s_authToken;
+    };
+
+    bool loggedIn() const;
+
+    void login(const KUrl& url, const QString& name, const QString& passwd);
+    void listAlbums();
+    void listPhotos(const QString& albumName);
+
+    void createAlbum(const QString& parentAlbumName,
+                     const QString& albumName,
+                     const QString& albumTitle,
+                     const QString& albumCaption);
+
+    bool addPhoto(int albumId,
+                  const QString& photoPath,
+                  const QString& caption = QString(),
+                  bool  captionIsTitle = true, bool captionIsDescription = false,
+                  bool rescale = false, int maxDim = 600, int thumbDim = 120);
+
+    void cancel();
+
+Q_SIGNALS:
+
+    void signalError(const QString& msg);
+    void signalLoginFailed(const QString& msg);
+    void signalBusy(bool val);
+    void signalAlbums(const QList<GAlbum>& albumList);
+    void signalPhotos(const QList<GPhoto>& photoList);
+    void signalAddPhotoSucceeded();
+    void signalAddPhotoFailed(const QString& msg);
+
+private:
+
+    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);
+    void parseResponseAddThumbnail(const QByteArray& data);
+    void parseResponseAddPhotoSummary(const QByteArray& data);
+
+    QByteArray computeMD5Sum(const QString &filepath);
+
+private Q_SLOTS:
+
+    void slotTalkerData(KIO::Job *job, const QByteArray& data);
+    void slotResult(KJob *job);
+
+private:
+
+    QWidget*          m_parent;
+    State             m_state;
+    QString           m_cookie;
+    KUrl              m_url;
+    KIO::TransferJob* m_job;
+    bool              m_loggedIn;
+    QByteArray        m_talker_buffer;
+
+    QByteArray        m_md5sum;
+    QString           m_path;
+    int               m_albumId;
+    QString           m_thumbpath;
+    QString           m_comment;
+    QString           m_name;
+    QDateTime         m_date;
+
+    static QString    s_authToken;
+};
+
+} // namespace KIPIPiwigoExportPlugin
+
+#endif /* PIWIGOTALKER_H */
Index: /extensions/digikam_export/piwigoexport/piwigowindow.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigowindow.cpp	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigowindow.cpp	(revision 4770)
@@ -0,0 +1,815 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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.
+ *
+ * ============================================================ */
+
+#include "piwigowindow.h"
+#include "piwigowindow.moc"
+
+// Qt includes
+
+#include <QCheckBox>
+#include <QDialog>
+#include <QFileInfo>
+#include <QGroupBox>
+#include <QPushButton>
+#include <QSpinBox>
+#include <Qt>
+#include <QTreeWidgetItem>
+#include <QPointer>
+
+// KDE includes
+
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <khelpmenu.h>
+#include <kicon.h>
+#include <klocale.h>
+#include <kmenu.h>
+#include <kmessagebox.h>
+#include <kpushbutton.h>
+#include <krun.h>
+#include <ktoolinvocation.h>
+#include <kurllabel.h>
+#include <kstandarddirs.h>
+
+// LibKIPI includes
+
+#include <libkipi/interface.h>
+
+// Local includes
+
+#include "albumdlg.h"
+#include "piwigos.h"
+#include "piwigoconfig.h"
+#include "piwigoitem.h"
+#include "piwigotalker.h"
+#include "imagedialog.h"
+#include "kpaboutdata.h"
+
+namespace KIPIPiwigoExportPlugin
+{
+
+class PiwigoWindow::Private
+{
+public:
+
+    Private(PiwigoWindow* parent);
+
+    QWidget*               widget;
+
+    QTreeWidget*           albumView;
+
+    QPushButton*           newAlbumBtn;
+    QPushButton*           addPhotoBtn;
+
+    QCheckBox*             captTitleCheckBox;
+    QCheckBox*             captDescrCheckBox;
+    QCheckBox*             resizeCheckBox;
+
+    QSpinBox*              dimensionSpinBox;
+    QSpinBox*              thumbDimensionSpinBox;
+
+    QHash<QString, GAlbum> albumDict;
+
+    KUrlLabel*             logo;
+};
+
+PiwigoWindow::Private::Private(PiwigoWindow* parent)
+{
+    widget = new QWidget(parent);
+    parent->setMainWidget(widget);
+    parent->setModal(false);
+
+    QHBoxLayout *hlay = new QHBoxLayout(widget);
+
+    // ---------------------------------------------------------------------------
+
+    logo = new KUrlLabel;
+    logo->setText(QString());
+    logo->setUrl("http://piwigo.menalto.com");
+    logo->setPixmap(QPixmap(KStandardDirs::locate("data", "kipiplugin_piwigoexport/pics/piwigo_logo.png")));
+    logo->setAlignment(Qt::AlignLeft);
+
+    // ---------------------------------------------------------------------------
+
+    albumView = new QTreeWidget;
+    QStringList labels;
+    labels << i18n("Albums"); // << i18n("ID");
+    albumView->setHeaderLabels(labels);
+
+    // ---------------------------------------------------------------------------
+
+    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;
+    addPhotoBtn->setText(i18n("&Add Selected Photos"));
+    addPhotoBtn->setIcon(KIcon("list-add"));
+    addPhotoBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+    addPhotoBtn->setEnabled(false);
+
+    QGroupBox *optionsBox = new QGroupBox(i18n("Override Default Options"));
+    QVBoxLayout *vlay2    = new QVBoxLayout();
+
+    captTitleCheckBox     = new QCheckBox(optionsBox);
+    captTitleCheckBox->setText(i18n("EXIF Comment (instead of file name) sets Title"));
+
+    captDescrCheckBox     = new QCheckBox(optionsBox);
+    captDescrCheckBox->setText(i18n("EXIF Comment (instead of file name) sets Comment"));
+
+    resizeCheckBox        = new QCheckBox(optionsBox);
+    resizeCheckBox->setText(i18n("Resize photos before uploading"));
+
+    QHBoxLayout *hlay2    = new QHBoxLayout;
+    QLabel *resizeLabel   = new QLabel(i18n("Maximum dimension:"));
+
+    dimensionSpinBox      = new QSpinBox;
+    dimensionSpinBox->setRange(1,1600);
+    dimensionSpinBox->setValue(600);
+
+    QHBoxLayout *hlay3    = new QHBoxLayout;
+    QLabel *resizeThumbLabel= new QLabel(i18n("Maximum thumbnail dimension:"));
+
+    thumbDimensionSpinBox = new QSpinBox;
+    thumbDimensionSpinBox->setRange(32,800);
+    thumbDimensionSpinBox->setValue(120);
+
+    captTitleCheckBox->setChecked(true);
+    captDescrCheckBox->setChecked(false);
+    resizeCheckBox->setChecked(false);
+    dimensionSpinBox->setEnabled(false);
+    thumbDimensionSpinBox->setEnabled(true);
+
+    // ---------------------------------------------------------------------------
+
+    hlay2->addWidget(resizeLabel);
+    hlay2->addWidget(dimensionSpinBox);
+    hlay2->setSpacing(KDialog::spacingHint());
+    hlay2->setMargin(KDialog::spacingHint());
+
+    // ---------------------------------------------------------------------------
+
+    hlay3->addWidget(resizeThumbLabel);
+    hlay3->addWidget(thumbDimensionSpinBox);
+    hlay3->setSpacing(KDialog::spacingHint());
+    hlay3->setMargin(KDialog::spacingHint());
+
+    // ---------------------------------------------------------------------------
+
+    vlay2->addWidget(captTitleCheckBox);
+    vlay2->addWidget(captDescrCheckBox);
+    vlay2->addWidget(resizeCheckBox);
+    vlay2->addLayout(hlay2);
+    vlay2->addLayout(hlay3);
+    vlay2->setSpacing(KDialog::spacingHint());
+    vlay2->setMargin(KDialog::spacingHint());
+
+    optionsBox->setLayout(vlay2);
+
+    // ---------------------------------------------------------------------------
+
+    vlay->addWidget(newAlbumBtn);
+    vlay->addWidget(addPhotoBtn);
+    vlay->addWidget(optionsBox);
+    vlay->setSpacing(KDialog::spacingHint());
+    vlay->setMargin(KDialog::spacingHint());
+
+    optionFrame->setLayout(vlay);
+
+    // ---------------------------------------------------------------------------
+
+    hlay->addWidget(logo);
+    hlay->addWidget(albumView);
+    hlay->addWidget(optionFrame);
+    hlay->setSpacing(KDialog::spacingHint());
+    hlay->setMargin(KDialog::spacingHint());
+
+    widget->setLayout(hlay);
+}
+
+// --------------------------------------------------------------------------------------------------------------
+
+PiwigoWindow::PiwigoWindow(KIPI::Interface* interface, QWidget *parent, Piwigo* pPiwigo)
+        : KDialog(parent),
+        m_interface(interface),
+        mpPiwigo(pPiwigo),
+        d(new Private(this))
+{
+    kDebug() << "BEGIN Window\n";
+
+
+    setWindowTitle( i18n("Piwigo Export") );
+    setButtons( KDialog::Close | KDialog::User1 | KDialog::Help);
+    setModal(false);
+
+    // About data.
+    m_about = new KIPIPlugins::KPAboutData(ki18n("Piwigo Export"),
+                                           0,
+                                           KAboutData::License_GPL,
+                                           ki18n("A Kipi plugin to export image collections to a remote Piwigo server."),
+                                           ki18n("(c) 2003-2005, Renchi Raju\n"
+                                                 "(c) 2006-2007, Colin Guthrie\n"
+                                                 "(c) 2006-2009, Gilles Caulier\n"
+                                                 "(c) 2008, Andrea Diamantini\n"
+                                                 "(c) 2010, Frédéric Coiffier\n"));
+
+    m_about->addAuthor(ki18n("Renchi Raju"), ki18n("Author"),
+                       "renchi dot raju at gmail dot com");
+
+    m_about->addAuthor(ki18n("Colin Guthrie"), ki18n("Maintainer"),
+                       "kde at colin dot guthr dot ie");
+
+    m_about->addAuthor(ki18n("Andrea Diamantini"), ki18n("Developer"),
+                       "adjam7 at gmail dot com");
+
+    m_about->addAuthor(ki18n("Gilles Caulier"), ki18n("Developer"),
+                       "caulier dot gilles at gmail dot com");
+
+    m_about->addAuthor(ki18n("Frédéric Coiffier"), ki18n("Developer"),
+                       "fcoiffie at gmail dot com");
+
+    // help button
+
+    disconnect(this, SIGNAL(helpClicked()),
+               this, SLOT(slotHelp()));
+
+    KHelpMenu *helpMenu = new KHelpMenu(this, m_about, false);
+    helpMenu->menu()->removeAction(helpMenu->menu()->actions().first());
+    QAction *handbook   = new QAction(i18n("Handbook"), this);
+    connect(handbook, SIGNAL(triggered(bool)),
+            this, SLOT(slotHelp()));
+    helpMenu->menu()->insertAction(helpMenu->menu()->actions().first(), handbook);
+    button(Help)->setMenu(helpMenu->menu());
+
+    // User1 Button : to conf piwigo settings
+    KPushButton *confButton = button( User1 );
+    confButton->setText( i18n("Settings") );
+    confButton->setIcon( KIcon("configure") );
+    connect(confButton, SIGNAL(clicked()),
+            this, SLOT(slotSettings() ) );
+
+    // we need to let m_talker work..
+    m_talker = new PiwigoTalker(d->widget);
+
+    // setting progressDlg and its numeric hints
+    m_progressDlg = new QProgressDialog(this);
+    m_progressDlg->setModal(true);
+    m_progressDlg->setAutoReset(true);
+    m_progressDlg->setAutoClose(true);
+    m_uploadCount = 0;
+    m_uploadTotal = 0;
+    mpUploadList  = new QStringList;
+
+    // connect functions
+    connectSignals();
+
+    // read Settings
+    readSettings();
+
+    slotDoLogin();
+}
+
+PiwigoWindow::~PiwigoWindow()
+{
+    // write config
+    KConfig config("kipirc");
+    KConfigGroup group = config.group("PiwigoSync Galleries");
+
+    group.writeEntry("Resize",          d->resizeCheckBox->isChecked());
+    group.writeEntry("Set title",       d->captTitleCheckBox->isChecked());
+    group.writeEntry("Set description", d->captDescrCheckBox->isChecked());
+    group.writeEntry("Maximum Width",   d->dimensionSpinBox->value());
+
+    delete m_talker;
+
+    delete mpUploadList;
+    delete m_about;
+
+    delete d;
+}
+
+void PiwigoWindow::connectSignals()
+{
+    connect(d->albumView, SIGNAL(itemSelectionChanged()),
+            this , SLOT( slotAlbumSelected() ) );
+
+    connect(d->newAlbumBtn, SIGNAL(clicked()),
+            this, SLOT(slotNewAlbum()));
+
+    connect(d->addPhotoBtn, SIGNAL(clicked()),
+            this, SLOT(slotAddPhoto()));
+
+    connect(d->resizeCheckBox, SIGNAL(stateChanged(int)),
+            this, SLOT(slotEnableSpinBox(int)));
+
+    connect(d->logo, SIGNAL(leftClickedUrl(const QString&)),
+            this, SLOT(slotProcessUrl(const QString&)));
+
+    connect(m_progressDlg, SIGNAL( canceled() ),
+            this, SLOT( slotAddPhotoCancel() ));
+
+    connect(m_talker, SIGNAL(signalError(const QString&)),
+            this, SLOT(slotError(const QString&)));
+
+    connect(m_talker, SIGNAL(signalBusy(bool)),
+            this, SLOT(slotBusy(bool)));
+
+    connect(m_talker, SIGNAL(signalLoginFailed(const QString&)),
+            this, SLOT(slotLoginFailed(const QString&)));
+
+    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()),
+            this, SLOT(slotAddPhotoSucceeded()));
+
+    connect(m_talker, SIGNAL(signalAddPhotoFailed(const QString&)),
+            this, SLOT(slotAddPhotoFailed(const QString&)));
+}
+
+void PiwigoWindow::slotProcessUrl(const QString& url)
+{
+    KToolInvocation::self()->invokeBrowser(url);
+}
+
+void PiwigoWindow::readSettings()
+{
+    // read Config
+    KConfig config("kipirc");
+    KConfigGroup group = config.group("PiwigoSync Galleries");
+
+    if (group.readEntry("Resize", false)) {
+        d->resizeCheckBox->setChecked(true);
+        d->dimensionSpinBox->setEnabled(true);
+        d->dimensionSpinBox->setValue(group.readEntry("Maximum Width", 600));
+    } else {
+        d->resizeCheckBox->setChecked(false);
+        d->dimensionSpinBox->setEnabled(false);
+    }
+
+    if (group.readEntry("Set title", true))
+        d->captTitleCheckBox->setChecked(true);
+    else
+        d->captTitleCheckBox->setChecked(false);
+
+    if (group.readEntry("Set description", false))
+        d->captDescrCheckBox->setChecked(true);
+    else
+        d->captDescrCheckBox->setChecked(false);
+
+}
+
+void PiwigoWindow::slotHelp()
+{
+    KToolInvocation::invokeHelp("piwigoexport", "kipi-plugins");
+}
+
+void PiwigoWindow::slotDoLogin()
+{
+    KUrl url(mpPiwigo->url());
+    if (url.protocol().isEmpty()) {
+        url.setProtocol("http");
+        url.setHost(mpPiwigo->url());
+    }
+
+    if (!url.url().endsWith(QLatin1String(".php"))) {
+        url.addPath("ws.php");
+    }
+
+    // If we've done something clever, save it back to the piwigo.
+    if (mpPiwigo->url() != url.url()) {
+        mpPiwigo->setUrl(url.url());
+        mpPiwigo->save();
+    }
+
+    m_talker->login(url.url(), mpPiwigo->username(), mpPiwigo->password());
+}
+
+void PiwigoWindow::slotLoginFailed(const QString& msg)
+{
+    if (KMessageBox::warningYesNo(this,
+                                  i18n("Failed to login into remote piwigo. ")
+                                  + msg
+                                  + i18n("\nDo you want to check your settings and try again?"))
+            != KMessageBox::Yes) {
+        close();
+        return;
+    }
+
+    QPointer<PiwigoEdit> configDlg = new PiwigoEdit(kapp->activeWindow(), mpPiwigo, i18n("Edit Piwigo Data") );
+    if ( configDlg->exec() != QDialog::Accepted ) {
+        delete configDlg;
+        return;
+    }
+    slotDoLogin();
+    delete configDlg;
+}
+
+void PiwigoWindow::slotBusy(bool val)
+{
+    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());
+    }
+}
+
+void PiwigoWindow::slotError(const QString& msg)
+{
+    m_progressDlg->hide();
+    KMessageBox::error(this, msg);
+}
+
+void PiwigoWindow::slotAlbums(const QList<GAlbum>& albumList)
+{
+    d->albumDict.clear();
+    d->albumView->clear();
+
+    // album work list
+    QList<GAlbum> workList(albumList);
+    QList<QTreeWidgetItem *> parentItemList;
+
+    // fill QTreeWidget
+    while ( !workList.isEmpty() ) {
+        // the album to work on
+        GAlbum album = workList.takeFirst();
+
+        int parentRefNum = album.parent_ref_num;
+        if ( parentRefNum == -1 ) {
+            QTreeWidgetItem *item = new QTreeWidgetItem();
+            item->setText(0, cleanName(album.name) );
+            item->setIcon(0, KIcon("inode-directory") );
+            item->setData(1, Qt::UserRole, QVariant(album.ref_num) );
+            item->setText(2, i18n("Album") );
+
+            kDebug() << "Top : " << album.name << " " << album.ref_num << "\n";
+
+            d->albumView->addTopLevelItem(item);
+            d->albumDict.insert(album.name, album);
+            parentItemList << item;
+        } else {
+            QTreeWidgetItem *parentItem = 0;
+            bool found                  = false;
+            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)) {
+                    QTreeWidgetItem *item = new QTreeWidgetItem(parentItem);
+                    item->setText(0, cleanName(album.name) );
+                    item->setIcon(0, KIcon("inode-directory") );
+                    item->setData(1, Qt::UserRole, album.ref_num );
+                    item->setText(2, i18n("Album") );
+
+                    kDebug() << "Child : " << album.name << " " << album.ref_num << "\n";
+
+                    parentItem->addChild(item);
+                    d->albumDict.insert(album.name, album);
+                    parentItemList << item;
+                    found = true;
+                }
+                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) {
+        d->addPhotoBtn->setEnabled(false);
+    } else {
+        kDebug() << "Album selected\n";
+
+        int albumId = item->data(1, Qt::UserRole).toInt();
+        kDebug() << albumId << "\n";
+        if (m_talker->loggedIn() && albumId ) {
+            d->addPhotoBtn->setEnabled(true);
+            //m_talker->listPhotos(albumName);
+        } else {
+            d->addPhotoBtn->setEnabled(false);
+        }
+    }
+}
+
+void PiwigoWindow::slotNewAlbum()
+{
+    QPointer<AlbumDlg> dlg = new AlbumDlg(d->widget);
+    dlg->titleEdit->setFocus();
+    if ( dlg->exec() != QDialog::Accepted ) {
+        delete dlg;
+        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) {
+        mpUploadList->append( (*it).path() );
+    }
+
+    m_uploadTotal = mpUploadList->count();
+    m_progressDlg->reset();
+    m_progressDlg->setMaximum(m_uploadTotal);
+    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();
+}
+
+void PiwigoWindow::slotAddPhotoNext()
+{
+    if ( mpUploadList->isEmpty() ) {
+        m_progressDlg->reset();
+        m_progressDlg->hide();
+        //slotAlbumSelected();        // ?
+        return;
+    }
+
+    QTreeWidgetItem* item = d->albumView->currentItem();
+    int column            = d->albumView->currentColumn();
+    QString albumTitle    = item->text(column);
+    const GAlbum& album   = d->albumDict.value(albumTitle);
+    QString photoPath     = mpUploadList->takeFirst();
+    QString photoName     = QFileInfo(photoPath).baseName();
+    bool res              = m_talker->addPhoto(album.ref_num, photoPath, photoName,
+                            d->captTitleCheckBox->isChecked(),
+                            d->captDescrCheckBox->isChecked(),
+                            d->resizeCheckBox->isChecked(),
+                            d->dimensionSpinBox->value(),
+                            d->thumbDimensionSpinBox->value() );
+
+    if (!res) {
+        slotAddPhotoFailed( "" );
+        return;
+    }
+
+    m_progressDlg->setLabelText( i18n("Uploading file ") +  KUrl(photoPath).fileName() );
+
+    if (m_progressDlg->isHidden())
+        m_progressDlg->show();
+}
+
+void PiwigoWindow::slotAddPhotoSucceeded()
+{
+    m_uploadCount++;
+    m_progressDlg->setValue(m_uploadCount);
+    slotAddPhotoNext();
+}
+
+void PiwigoWindow::slotAddPhotoFailed(const QString& msg)
+{
+    m_progressDlg->reset();
+    m_progressDlg->hide();
+
+    if (KMessageBox::warningContinueCancel(this,
+                                           i18n("Failed to upload photo into "
+                                                "remote piwigo. ")
+                                           + msg
+                                           + i18n("\nDo you want to continue?"))
+            != KMessageBox::Continue) {
+    } else {
+        slotAddPhotoNext();
+    }
+}
+
+void PiwigoWindow::slotAddPhotoCancel()
+{
+    m_progressDlg->reset();
+    m_progressDlg->hide();
+    m_talker->cancel();
+}
+
+void PiwigoWindow::slotEnableSpinBox(int n)
+{
+    bool b;
+    switch (n) {
+    case 0:
+        b = false;
+        break;
+    case 1:
+    case 2:
+        b = true;
+        break;
+    default:
+        b = false;
+    }
+    d->dimensionSpinBox->setEnabled(b);
+}
+
+void PiwigoWindow::slotSettings()
+{
+    // TODO: reload albumlist if OK slot used.
+    QPointer<PiwigoEdit> dlg = new PiwigoEdit(kapp->activeWindow(), mpPiwigo, i18n("Edit Piwigo Data") );
+    if ( dlg->exec() == QDialog::Accepted ) {
+        slotDoLogin();
+    }
+    delete dlg;
+}
+
+
+QString PiwigoWindow::cleanName(const QString& str)
+{
+    QString plain = str;
+    plain.replace("&lt;", "<");
+    plain.replace("&gt;", ">");
+    plain.replace("&quot;", "\"");
+    plain.replace("&amp;", "&");
+
+    return plain;
+}
+
+} // namespace KIPIPiwigoExportPlugin
Index: /extensions/digikam_export/piwigoexport/piwigowindow.h
===================================================================
--- /extensions/digikam_export/piwigoexport/piwigowindow.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/piwigowindow.h	(revision 4770)
@@ -0,0 +1,115 @@
+/* ============================================================
+*
+* 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+* Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+* 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 PIWIGOWINDOW_H
+#define PIWIGOWINDOW_H
+
+// KDE includes
+
+#include <KDialog>
+
+// Qt includes
+
+#include <QList>
+#include <QProgressDialog>
+
+// Debug
+#include <QTextStream>
+#include <QFile>
+
+namespace KIPI
+{
+class Interface;
+}
+
+namespace KIPIPlugins
+{
+class KPAboutData;
+}
+
+namespace KIPIPiwigoExportPlugin
+{
+class Piwigo;
+class PiwigoTalker;
+class GAlbum;
+class GPhoto;
+
+class PiwigoWindow : public KDialog
+{
+    Q_OBJECT
+
+public:
+
+    PiwigoWindow(KIPI::Interface *interface, QWidget *parent, Piwigo* pPiwigo);
+    ~PiwigoWindow();
+
+private:
+
+    void connectSignals();
+    void readSettings();
+    QString cleanName(const QString&);
+
+private Q_SLOTS:
+
+    void slotDoLogin();
+    void slotLoginFailed(const QString& msg);
+    void slotBusy(bool val);
+    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();
+    void slotAddPhotoSucceeded();
+    void slotAddPhotoFailed(const QString& msg);
+    void slotAddPhotoCancel();
+    void slotHelp();
+    void slotEnableSpinBox(int n);
+    void slotSettings();
+    void slotProcessUrl(const QString&);
+
+private:
+
+    KIPI::Interface*          m_interface;
+    KIPIPlugins::KPAboutData* m_about;
+    PiwigoTalker*            m_talker;
+    Piwigo*                  mpPiwigo;
+
+    QProgressDialog*          m_progressDlg;
+    unsigned int              m_uploadCount;
+    unsigned int              m_uploadTotal;
+    QStringList*              mpUploadList;
+    QString                   firstAlbumName;
+
+    class Private;
+    Private* const d;
+};
+
+} // namespace KIPIPiwigoExportPlugin
+
+#endif /* PIWIGOWINDOW_H */
Index: /extensions/digikam_export/piwigoexport/plugin_piwigoexport.cpp
===================================================================
--- /extensions/digikam_export/piwigoexport/plugin_piwigoexport.cpp	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/plugin_piwigoexport.cpp	(revision 4770)
@@ -0,0 +1,132 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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.
+ *
+ * ============================================================ */
+
+#include "plugin_piwigoexport.h"
+#include "plugin_piwigoexport.moc"
+
+// Qt includes
+
+#include <QPointer>
+
+// KDE includes
+
+#include <kaction.h>
+#include <kactioncollection.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+// LibKIPI includes
+
+#include <libkipi/interface.h>
+#include <libkipi/plugin.h>
+
+// Local includes
+
+#include "piwigos.h"
+#include "piwigoconfig.h"
+#include "piwigowindow.h"
+
+K_PLUGIN_FACTORY(Factory, registerPlugin<Plugin_PiwigoExport>();)
+K_EXPORT_PLUGIN(Factory("kipiplugin_piwigoexport"))
+
+Plugin_PiwigoExport::Plugin_PiwigoExport(QObject *parent, const QVariantList&)
+        : KIPI::Plugin(Factory::componentData(), parent, "PiwigoExport"),
+        m_action(0), mpPiwigo(0)
+{
+    kDebug(AREA_CODE_LOADING) << "Plugin_PiwigoExport plugin loaded";
+}
+
+void Plugin_PiwigoExport::setup(QWidget* widget)
+{
+    KIconLoader::global()->addAppDir("kipiplugin_piwigoexport");
+
+    mpPiwigo = new KIPIPiwigoExportPlugin::Piwigo();
+
+    KIPI::Plugin::setup(widget);
+
+    KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
+    if (!interface) {
+        kError() << "Kipi interface is null!";
+        return;
+    }
+
+    m_action = actionCollection()->addAction("piwigoexport");
+    m_action->setText(i18n("Export to &Piwigo..."));
+    m_action->setIcon(KIcon("piwigo"));
+    m_action->setEnabled(true);
+
+    connect(m_action, SIGNAL(triggered(bool)),
+            this, SLOT(slotSync()));
+
+    addAction(m_action);
+}
+
+Plugin_PiwigoExport::~Plugin_PiwigoExport()
+{
+    if (mpPiwigo)
+        delete mpPiwigo;
+}
+
+// this slot uses PiwigoWindow Class
+void Plugin_PiwigoExport::slotSync()
+{
+    KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
+    if (!interface) {
+        kError() << "Kipi interface is null!";
+        return;
+    }
+
+    QPointer<KIPIPiwigoExportPlugin::PiwigoEdit>   configDlg;
+    QPointer<KIPIPiwigoExportPlugin::PiwigoWindow> dlg;
+
+    KConfig config("kipirc");
+    if (!config.hasGroup("Piwigo Settings") ) {
+        configDlg = new KIPIPiwigoExportPlugin::PiwigoEdit(kapp->activeWindow(),
+                mpPiwigo, i18n("Edit Piwigo Data") );
+        configDlg->exec();
+    }
+
+    dlg = new KIPIPiwigoExportPlugin::PiwigoWindow(interface, kapp->activeWindow(), mpPiwigo);
+    dlg->exec();
+
+    delete configDlg;
+    delete dlg;
+}
+
+KIPI::Category Plugin_PiwigoExport::category(KAction* action) const
+{
+    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;
+}
Index: /extensions/digikam_export/piwigoexport/plugin_piwigoexport.h
===================================================================
--- /extensions/digikam_export/piwigoexport/plugin_piwigoexport.h	(revision 4770)
+++ /extensions/digikam_export/piwigoexport/plugin_piwigoexport.h	(revision 4770)
@@ -0,0 +1,68 @@
+/* ============================================================
+ *
+ * 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) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
+ * Copyright (C) 2006 by Colin Guthrie <kde@colin.guthr.ie>
+ * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 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 PLUGIN_PIWIGOEXPORT_H
+#define PLUGIN_PIWIGOEXPORT_H
+
+// Qt includes
+
+#include <QVariantList>
+
+// LibKIPI includes
+
+#include <libkipi/plugin.h>
+
+class KAction;
+
+namespace KIPIPiwigoExportPlugin
+{
+class Piwigo;
+}
+
+class Plugin_PiwigoExport : public KIPI::Plugin
+{
+    Q_OBJECT
+
+public:
+
+    Plugin_PiwigoExport(QObject *parent, const QVariantList &args);
+    ~Plugin_PiwigoExport();
+
+    virtual KIPI::Category category(KAction* action) const;
+    virtual void setup(QWidget*);
+
+public Q_SLOTS:
+
+    void slotSync();
+
+private:
+
+    KAction                          *m_action;
+
+    KIPIPiwigoExportPlugin::Piwigo *mpPiwigo;
+};
+
+#endif /* PLUGIN_PIWIGOEXPORT_H */
