[niepce] IDs are now of type eng::library_id_t in as they are 64bits in the database.



commit 4c2ea99e204f902b88ad8f0cd9f664f8c921dfa5
Author: Hub Figuiere <hub figuiere net>
Date:   Sun Nov 6 23:41:36 2011 -0800

    IDs are now of type eng::library_id_t in as they are 64bits in the database.

 src/engine/db/Makefile.am                    |    1 +
 src/engine/db/fsfile.cpp                     |    2 +-
 src/engine/db/fsfile.hpp                     |    7 +-
 src/engine/db/keyword.cpp                    |    2 +-
 src/engine/db/keyword.hpp                    |    8 ++-
 src/engine/db/label.hpp                      |    7 +-
 src/engine/db/libfile.cpp                    |    2 +-
 src/engine/db/libfile.hpp                    |   11 ++--
 src/engine/db/libfolder.cpp                  |    2 +-
 src/engine/db/libfolder.hpp                  |    7 +-
 src/engine/db/libmetadata.cpp                |    2 +-
 src/engine/db/libmetadata.hpp                |    7 +-
 src/engine/db/library.cpp                    |   89 +++++++++++++-------------
 src/engine/db/library.hpp                    |   45 +++++++------
 src/engine/db/librarytypes.hpp               |   33 ++++++++++
 src/engine/library/clienttypes.hpp           |    7 ++
 src/engine/library/commands.cpp              |   22 +++---
 src/engine/library/commands.hpp              |   12 ++--
 src/engine/library/thumbnailcache.cpp        |    2 +-
 src/engine/library/thumbnailnotification.hpp |    4 +-
 src/fwk/toolkit/command.hpp                  |    1 +
 src/fwk/toolkit/metadatawidget.cpp           |    4 +-
 src/libraryclient/clientimpl.cpp             |   12 ++--
 src/libraryclient/clientimpl.hpp             |   12 ++--
 src/libraryclient/libraryclient.cpp          |   14 ++--
 src/libraryclient/libraryclient.hpp          |   13 ++--
 src/niepce/modules/darkroom/dritemwidget.cpp |    2 +-
 src/niepce/ui/filmstripcontroller.cpp        |    8 +-
 src/niepce/ui/filmstripcontroller.hpp        |    4 +-
 src/niepce/ui/gridviewmodule.cpp             |   16 ++--
 src/niepce/ui/gridviewmodule.hpp             |    4 +-
 src/niepce/ui/imageliststore.cpp             |   16 ++--
 src/niepce/ui/imageliststore.hpp             |    6 +-
 src/niepce/ui/metadatapanecontroller.cpp     |    2 +-
 src/niepce/ui/metadatapanecontroller.hpp     |    7 +-
 src/niepce/ui/selectioncontroller.cpp        |   18 +++---
 src/niepce/ui/selectioncontroller.hpp        |   11 ++--
 src/niepce/ui/workspacecontroller.cpp        |    9 ++-
 src/niepce/ui/workspacecontroller.hpp        |    2 +-
 39 files changed, 245 insertions(+), 188 deletions(-)
---
diff --git a/src/engine/db/Makefile.am b/src/engine/db/Makefile.am
index 21ae897..084d1fb 100644
--- a/src/engine/db/Makefile.am
+++ b/src/engine/db/Makefile.am
@@ -27,6 +27,7 @@ test_filebundle_LDADD = $(TEST_LIBS)
 noinst_LIBRARIES = libniepcedb.a
 
 libniepcedb_a_SOURCES = library.hpp library.cpp \
+	librarytypes.hpp \
 	libfile.hpp libfile.cpp \
 	libfolder.hpp libfolder.cpp \
 	label.hpp \
diff --git a/src/engine/db/fsfile.cpp b/src/engine/db/fsfile.cpp
index d4580bc..fb4c3a2 100644
--- a/src/engine/db/fsfile.cpp
+++ b/src/engine/db/fsfile.cpp
@@ -24,7 +24,7 @@
 
 namespace eng {
 
-FsFile::FsFile(int _id, const std::string & _path)
+FsFile::FsFile(library_id_t _id, const std::string & _path)
     : m_id(_id), m_path(_path)
 {
 }
diff --git a/src/engine/db/fsfile.hpp b/src/engine/db/fsfile.hpp
index d6e900b..1b45fcb 100644
--- a/src/engine/db/fsfile.hpp
+++ b/src/engine/db/fsfile.hpp
@@ -23,6 +23,7 @@
 #include <string>
 #include <tr1/memory>
 
+#include "engine/db/librarytypes.hpp"
 
 namespace eng {
 
@@ -32,14 +33,14 @@ class FsFile
 public:
     typedef std::tr1::shared_ptr< FsFile > Ptr;
 
-    FsFile(int id, const std::string & path);
+    FsFile(library_id_t id, const std::string & path);
 
-    int id()
+    library_id_t id()
         { return m_id; }
     const std::string & path() const
         { return m_path; }
 private:
-    int m_id;
+    library_id_t m_id;
     std::string m_path; /**< absolute path */
 };
 
diff --git a/src/engine/db/keyword.cpp b/src/engine/db/keyword.cpp
index de431ea..2848652 100644
--- a/src/engine/db/keyword.cpp
+++ b/src/engine/db/keyword.cpp
@@ -24,7 +24,7 @@
 
 namespace eng {
 
-	Keyword::Keyword(int _id, const std::string & _keyword)
+	Keyword::Keyword(library_id_t _id, const std::string & _keyword)
 		: m_id(_id), m_keyword(_keyword)
 	{
 	}
diff --git a/src/engine/db/keyword.hpp b/src/engine/db/keyword.hpp
index e718478..09686b6 100644
--- a/src/engine/db/keyword.hpp
+++ b/src/engine/db/keyword.hpp
@@ -25,6 +25,8 @@
 #include <vector>
 #include <tr1/memory>
 
+#include "engine/db/librarytypes.hpp"
+
 namespace eng {
 
 	class Keyword
@@ -35,14 +37,14 @@ namespace eng {
 		typedef std::tr1::shared_ptr<List> ListPtr;
 		typedef std::vector<int> IdList;
 
-		Keyword(int id, const std::string & keyword);
+		Keyword(library_id_t id, const std::string & keyword);
 		
-		int id() const
+		library_id_t id() const
 			{ return m_id; }
 		const std::string & keyword() 
 			{ return m_keyword; }
 	private:
-		int m_id;
+		library_id_t m_id;
 		std::string m_keyword;
 	};
 
diff --git a/src/engine/db/label.hpp b/src/engine/db/label.hpp
index bde82a0..dd2137b 100644
--- a/src/engine/db/label.hpp
+++ b/src/engine/db/label.hpp
@@ -27,6 +27,7 @@
 #include <tr1/memory>
 
 #include "fwk/base/color.hpp"
+#include "engine/db/librarytypes.hpp"
 
 namespace eng {
 
@@ -40,13 +41,13 @@ public:
     typedef std::vector<Ptr> List;
     typedef std::tr1::shared_ptr<List> ListPtr;
 
-    Label(int _id, const std::string & _label, const std::string & _colorstring)
+    Label(library_id_t _id, const std::string & _label, const std::string & _colorstring)
         : m_id(_id), m_label(_label)
         , m_color(_colorstring)
         {
         }
 		
-    int id() const
+    library_id_t id() const
         { return m_id; }
     const std::string & label() 
         { return m_label; }
@@ -58,7 +59,7 @@ public:
         { m_color = c; }
 
 private:
-    int              m_id;
+    library_id_t          m_id;
     std::string      m_label;
     fwk::RgbColor    m_color;
 };
diff --git a/src/engine/db/libfile.cpp b/src/engine/db/libfile.cpp
index 2a4ceee..3e781ee 100644
--- a/src/engine/db/libfile.cpp
+++ b/src/engine/db/libfile.cpp
@@ -25,7 +25,7 @@
 
 namespace eng {
 	
-LibFile::LibFile(int _id, int _folderId, int _fsfileid, const std::string & p,
+LibFile::LibFile(library_id_t _id, library_id_t _folderId, library_id_t _fsfileid, const std::string & p,
                  const std::string & _name )
 	: m_id(_id), m_folderId(_folderId),
 	  m_name(_name), 
diff --git a/src/engine/db/libfile.hpp b/src/engine/db/libfile.hpp
index 2289537..bbc3646 100644
--- a/src/engine/db/libfile.hpp
+++ b/src/engine/db/libfile.hpp
@@ -25,6 +25,7 @@
 #include <tr1/memory>
 
 #include "fwk/toolkit/mimetype.hpp"
+#include "engine/db/librarytypes.hpp"
 #include "engine/db/keyword.hpp"
 #include "engine/db/storage.hpp"
 #include "engine/db/fsfile.hpp"
@@ -49,14 +50,14 @@ public:
 
     static FileType mimetype_to_filetype(fwk::MimeType mime);
 
-    LibFile(int id, int folderId, int fsfileid, 
+    LibFile(library_id_t id, library_id_t folderId, library_id_t fsfileid, 
             const std::string & p,
             const std::string & name );
     virtual ~LibFile();
 
-    int id() const
+    library_id_t id() const
         { return m_id; }
-    int folderId() const
+    library_id_t folderId() const
         { return m_folderId; }
     const std::string & name() const
         { return m_name; }
@@ -101,8 +102,8 @@ public:
 //		bool isUri(const char * _uri) const
 //			{ return uri() == _uri; }
 private:
-    int         m_id;           /**< file ID */
-    int         m_folderId;     /**< parent folder */
+    library_id_t         m_id;           /**< file ID */
+    library_id_t         m_folderId;     /**< parent folder */
     std::string m_name;         /**< name */
     FsFile      m_main_file;
 //    boost::filesystem::path  m_path;/**< path name relative to the folder */
diff --git a/src/engine/db/libfolder.cpp b/src/engine/db/libfolder.cpp
index 9ed78c2..68a438e 100644
--- a/src/engine/db/libfolder.cpp
+++ b/src/engine/db/libfolder.cpp
@@ -28,7 +28,7 @@ const char* LibFolder::read_db_columns()
 
 LibFolder::Ptr LibFolder::read_from(const db::IConnectionDriver::Ptr & db)
 {
-  int32_t id;
+  library_id_t id;
   std::string name;
   int32_t virt_type, locked;
   db->get_column_content(0, id);
diff --git a/src/engine/db/libfolder.hpp b/src/engine/db/libfolder.hpp
index 9ae1886..f9a2ffc 100644
--- a/src/engine/db/libfolder.hpp
+++ b/src/engine/db/libfolder.hpp
@@ -26,6 +26,7 @@
 #include <list>
 #include <tr1/memory>
 
+#include "engine/db/librarytypes.hpp"
 #include "fwk/utils/db/iconnectiondriver.hpp"
 
 namespace eng {
@@ -43,13 +44,13 @@ public:
         _VIRTUAL_LAST
     } VirtualType;
 
-    LibFolder(int _id, std::string _name)
+    LibFolder(library_id_t _id, std::string _name)
         : m_id(_id), m_name(_name)
         , m_locked(false)
         , m_virtual(VIRTUAL_NONE)
         {
         }
-    int id() const
+    library_id_t id() const
         { return m_id; }
     const std::string & name() const
         { return m_name; }
@@ -67,7 +68,7 @@ public:
     static const char * read_db_columns();
     static Ptr read_from(const db::IConnectionDriver::Ptr & db);
 private:
-    int         m_id;
+    library_id_t         m_id;
     std::string m_name;
     bool m_locked;
     VirtualType m_virtual;
diff --git a/src/engine/db/libmetadata.cpp b/src/engine/db/libmetadata.cpp
index 972aecb..99ac4cf 100644
--- a/src/engine/db/libmetadata.cpp
+++ b/src/engine/db/libmetadata.cpp
@@ -28,7 +28,7 @@
 namespace eng {
 
 
-LibMetadata::LibMetadata(int _id)
+LibMetadata::LibMetadata(library_id_t _id)
 	: XmpMeta(),
       m_id(_id)
 {
diff --git a/src/engine/db/libmetadata.hpp b/src/engine/db/libmetadata.hpp
index 5f50dfc..f4f7a79 100644
--- a/src/engine/db/libmetadata.hpp
+++ b/src/engine/db/libmetadata.hpp
@@ -26,6 +26,7 @@
 #include <boost/any.hpp>
 
 #include "fwk/utils/exempi.hpp"
+#include "engine/db/librarytypes.hpp"
 #include "engine/db/metadata.hpp"
 
 namespace eng {
@@ -36,9 +37,9 @@ namespace eng {
 	public:
 		typedef std::tr1::shared_ptr<LibMetadata> Ptr;
 
-		LibMetadata(int _id);
+		LibMetadata(library_id_t _id);
 
-        int id() const
+        library_id_t id() const
             { return m_id; }
         bool setMetaData(int meta, const boost::any & value);
         /** do like the unix "touch". Update the MetadataDate 
@@ -47,7 +48,7 @@ namespace eng {
         bool touch();
     private:
         LibMetadata(const LibMetadata &);
-        int m_id;
+        library_id_t m_id;
 	};
 
 }
diff --git a/src/engine/db/library.cpp b/src/engine/db/library.cpp
index 7850273..91afce3 100644
--- a/src/engine/db/library.cpp
+++ b/src/engine/db/library.cpp
@@ -227,9 +227,9 @@ int Library::checkDatabaseVersion()
 }
 
 
-int Library::addFsFile(const std::string & file)
+int64_t Library::addFsFile(const std::string & file)
 {
-    int ret = -1;
+    int64_t ret = -1;
 
     SQLStatement sql(boost::format("INSERT INTO fsfiles (path)"
                                    " VALUES ('%1%')") 
@@ -242,7 +242,7 @@ int Library::addFsFile(const std::string & file)
     return ret;
 }
 
-std::string Library::getFsFile(int id)
+std::string Library::getFsFile(library_id_t id)
 {
     std::string p;
     SQLStatement sql(boost::format("SELECT path FROM fsfiles"
@@ -265,13 +265,14 @@ std::string Library::getFsFile(int id)
 }
 
 
-int Library::addFile(int folder_id, const std::string & file, bool manage)
+library_id_t Library::addFile(library_id_t folder_id, const std::string & file, bool manage)
 {
-    int ret = -1;
+    library_id_t ret = -1;
     DBG_ASSERT(!manage, "manage not supported");
     DBG_ASSERT(folder_id != -1, "invalid folder ID");
     try {
-        int32_t rating, label_id, orientation, flag;
+        int32_t rating, orientation, flag;
+		library_id_t label_id;
         std::string label;  
         fwk::MimeType mime = fwk::MimeType(file);
         eng::LibFile::FileType file_type = eng::LibFile::mimetype_to_filetype(mime);
@@ -286,7 +287,7 @@ int Library::addFile(int folder_id, const std::string & file, bool manage)
             creation_date = 0;
         }
 
-        int fs_file_id = addFsFile(file);
+        library_id_t fs_file_id = addFsFile(file);
         if(fs_file_id <= 0) {
             throw(fwk::Exception("add fsfile failed"));
         }
@@ -308,7 +309,7 @@ int Library::addFile(int folder_id, const std::string & file, bool manage)
         std::string buf = meta.serialize_inline();
         sql.bind(1, buf);
         if(m_dbdrv->execute_statement(sql)) {
-            int64_t id = m_dbdrv->last_row_id();
+            library_id_t id = m_dbdrv->last_row_id();
             DBG_OUT("last row inserted %d", (int)id);
             ret = id;
             const std::vector< std::string > &keywords(meta.keywords());
@@ -316,7 +317,7 @@ int Library::addFile(int folder_id, const std::string & file, bool manage)
             for(iter = keywords.begin();
                 iter != keywords.end(); iter++) 
             {
-                int kwid = makeKeyword(*iter);
+                library_id_t kwid = makeKeyword(*iter);
                 if(kwid != -1) {
                     assignKeyword(kwid, id);
                 }
@@ -337,7 +338,7 @@ int Library::addFile(int folder_id, const std::string & file, bool manage)
 }
 
 
-int Library::addFileAndFolder(const std::string & folder, const std::string & file, 
+library_id_t Library::addFileAndFolder(const std::string & folder, const std::string & file, 
                               bool manage)
 {
     LibFolder::Ptr f;
@@ -348,13 +349,13 @@ int Library::addFileAndFolder(const std::string & folder, const std::string & fi
     return addFile(f ? f->id() : -1, file, manage);
 }
 
-int Library::addBundle(int folder_id, const eng::FileBundle::Ptr & bundle, 
+library_id_t Library::addBundle(library_id_t folder_id, const eng::FileBundle::Ptr & bundle, 
                        bool manage)
 {
-    int file_id = 0;
+    library_id_t file_id = 0;
     file_id = addFile(folder_id, bundle->main_file(), manage);
     if(file_id > 0) {
-        int fsfile_id;
+        library_id_t fsfile_id;
         bool success;
         // addXmpSidecar
         if(!bundle->sidecar().empty()) {
@@ -374,7 +375,7 @@ int Library::addBundle(int folder_id, const eng::FileBundle::Ptr & bundle,
     return file_id;
 }
 
-bool Library::addSidecarFileToBundle(int file_id, int fsfile_id)
+bool Library::addSidecarFileToBundle(library_id_t file_id, library_id_t fsfile_id)
 {
     SQLStatement sql(boost::format("UPDATE files SET xmp_file='%2%'"
                                    " WHERE id='%1%';") 
@@ -390,7 +391,7 @@ bool Library::addSidecarFileToBundle(int file_id, int fsfile_id)
 }
 
 
-bool Library::addJpegFileToBundle(int file_id, int fsfile_id)
+bool Library::addJpegFileToBundle(library_id_t file_id, library_id_t fsfile_id)
 {
     SQLStatement sql(boost::format("UPDATE files SET jpeg_file='%2%',"
                                    " file_type='%3%' "
@@ -438,9 +439,9 @@ LibFolder::Ptr Library::addFolder(const std::string & folder)
                      % folder % fwk::path_basename(folder));
     try {
         if(m_dbdrv->execute_statement(sql)) {
-            int64_t id = m_dbdrv->last_row_id();
-            DBG_OUT("last row inserted %d", (int)id);
-            f = LibFolder::Ptr(new LibFolder((int)id, 
+            library_id_t id = m_dbdrv->last_row_id();
+            DBG_OUT("last row inserted %Ld", id);
+            f = LibFolder::Ptr(new LibFolder(id, 
                                              fwk::path_basename(folder)));
         }
     }
@@ -472,9 +473,9 @@ void Library::getAllFolders(const LibFolder::ListPtr & l)
 
 static LibFile::Ptr getFileFromDbRow(const db::IConnectionDriver::Ptr & dbdrv)
 {
-    int32_t id;
-    int32_t fid;
-    int32_t fsfid;
+    library_id_t id;
+    library_id_t fid;
+    library_id_t fsfid;
     std::string pathname;
     std::string name;
     DBG_ASSERT(dbdrv->get_number_of_columns() == 10, "wrong number of columns");
@@ -504,7 +505,7 @@ static LibFile::Ptr getFileFromDbRow(const db::IConnectionDriver::Ptr & dbdrv)
     return f;
 }
 
-void Library::getFolderContent(int folder_id, const LibFile::ListPtr & fl)
+void Library::getFolderContent(library_id_t folder_id, const LibFile::ListPtr & fl)
 {
     SQLStatement sql(boost::format("SELECT files.id,parent_id,fsfiles.path,"
                                    "name,"
@@ -528,7 +529,7 @@ void Library::getFolderContent(int folder_id, const LibFile::ListPtr & fl)
     }
 }
 
-int Library::countFolder(int folder_id)
+int Library::countFolder(library_id_t folder_id)
 {
     int count = -1;
     SQLStatement sql(boost::format("SELECT COUNT(id) FROM files WHERE parent_id='%1%';")
@@ -553,7 +554,7 @@ void Library::getAllKeywords(const Keyword::ListPtr & l)
     try {
         if(m_dbdrv->execute_statement(sql)) {
             while(m_dbdrv->read_next_row()) {
-                int32_t id;
+                library_id_t id;
                 std::string name;
                 m_dbdrv->get_column_content(0, id);
                 m_dbdrv->get_column_content(1, name);
@@ -567,9 +568,9 @@ void Library::getAllKeywords(const Keyword::ListPtr & l)
     }
 }
 	
-int Library::makeKeyword(const std::string & keyword)
+library_id_t Library::makeKeyword(const std::string & keyword)
 {
-    int keyword_id = -1;
+    library_id_t keyword_id = -1;
     SQLStatement sql("SELECT id FROM keywords WHERE "
                      "keyword=?1;");
     sql.bind(1, keyword);
@@ -605,7 +606,7 @@ int Library::makeKeyword(const std::string & keyword)
 }
 
 
-bool Library::assignKeyword(int kw_id, int file_id)
+bool Library::assignKeyword(library_id_t kw_id, library_id_t file_id)
 {
     bool ret = false;
     SQLStatement sql(boost::format("INSERT INTO keywording (file_id, keyword_id) "
@@ -622,7 +623,7 @@ bool Library::assignKeyword(int kw_id, int file_id)
 }
 
 
-void Library::getKeywordContent(int keyword_id, const LibFile::ListPtr & fl)
+void Library::getKeywordContent(library_id_t keyword_id, const LibFile::ListPtr & fl)
 {
     SQLStatement sql(boost::format("SELECT files.id,parent_id,fsfiles.path,"
                                    "name,orientation,rating,label,file_type,"
@@ -648,7 +649,7 @@ void Library::getKeywordContent(int keyword_id, const LibFile::ListPtr & fl)
 }
 
 
-void Library::getMetaData(int file_id, const LibMetadata::Ptr & meta)
+void Library::getMetaData(library_id_t file_id, const LibMetadata::Ptr & meta)
 {
     SQLStatement sql(boost::format("SELECT xmp FROM files "
                                    " WHERE id='%1%';")
@@ -671,7 +672,7 @@ void Library::getMetaData(int file_id, const LibMetadata::Ptr & meta)
 
 
 
-bool Library::setInternalMetaDataInt(int file_id, const char* col,
+bool Library::setInternalMetaDataInt(library_id_t file_id, const char* col,
                                      int32_t value)
 {
     bool ret = false;
@@ -695,7 +696,7 @@ bool Library::setInternalMetaDataInt(int file_id, const char* col,
  * @param meta the metadata block
  * @return false on error
  */
-bool Library::setMetaData(int file_id, const LibMetadata::Ptr & meta)
+bool Library::setMetaData(library_id_t file_id, const LibMetadata::Ptr & meta)
 {
     bool ret = false;
     SQLStatement sql(boost::format("UPDATE files SET xmp=?1 "
@@ -720,7 +721,7 @@ bool Library::setMetaData(int file_id, const LibMetadata::Ptr & meta)
  * @param value the value to set
  * @return false on error
  */
-bool Library::setMetaData(int file_id, int meta, 
+bool Library::setMetaData(library_id_t file_id, int meta, 
                           const boost::any & value)
 {
     bool retval = false;
@@ -790,15 +791,15 @@ void Library::getAllLabels(const Label::ListPtr & l)
 }
 
 
-int Library::addLabel(const std::string & name, const std::string & color)
+library_id_t Library::addLabel(const std::string & name, const std::string & color)
 {
-    int ret = -1;
+    library_id_t ret = -1;
 
     SQLStatement sql(boost::format("INSERT INTO labels (name,color)"
                                    " VALUES ('%1%', '%2%')") 
                      % name % color);
     if(m_dbdrv->execute_statement(sql)) {
-        int64_t id = m_dbdrv->last_row_id();
+        library_id_t id = m_dbdrv->last_row_id();
         DBG_OUT("last row inserted %d", (int)id);
         ret = id;
     }
@@ -806,13 +807,13 @@ int Library::addLabel(const std::string & name, const std::string & color)
 }
 
 
-int Library::addLabel(const std::string & name, const fwk::RgbColor & c)
+library_id_t Library::addLabel(const std::string & name, const fwk::RgbColor & c)
 {
     return addLabel(name, c.to_string());
 }
 
 
-bool Library::updateLabel(int label_id, const std::string & name, const std::string & color)
+bool Library::updateLabel(library_id_t label_id, const std::string & name, const std::string & color)
 {
     SQLStatement sql(boost::format("UPDATE labels SET name='%2%', color='%3%'"
                                    " WHERE id='%1%';") 
@@ -828,7 +829,7 @@ bool Library::updateLabel(int label_id, const std::string & name, const std::str
 }
 
 
-bool Library::deleteLabel(int label_id)
+bool Library::deleteLabel(library_id_t label_id)
 {
     
     SQLStatement sql(boost::format("DELETE FROM labels "
@@ -844,13 +845,13 @@ bool Library::deleteLabel(int label_id)
 }
 
 
-bool Library::getXmpIdsInQueue(std::vector<int> & ids)
+bool Library::getXmpIdsInQueue(std::vector<library_id_t> & ids)
 {
     SQLStatement sql("SELECT id  FROM xmp_update_queue;");
     try {
         if(m_dbdrv->execute_statement(sql)) {
             while(m_dbdrv->read_next_row()) {
-                int32_t id;
+                library_id_t id;
                 m_dbdrv->get_column_content(0, id);
                 ids.push_back(id);
             }
@@ -865,7 +866,7 @@ bool Library::getXmpIdsInQueue(std::vector<int> & ids)
 }
 
 
-bool Library::rewriteXmpForId(int id)
+bool Library::rewriteXmpForId(library_id_t id)
 {
     SQLStatement del(boost::format("DELETE FROM xmp_update_queue "
                                    " WHERE id='%1%';") % id);
@@ -877,8 +878,8 @@ bool Library::rewriteXmpForId(int id)
            && m_dbdrv->execute_statement(getxmp)) {
             while(m_dbdrv->read_next_row()) {
                 std::string xmp_buffer;
-                int main_file_id;
-                int xmp_file_id;
+                library_id_t main_file_id;
+                library_id_t xmp_file_id;
                 m_dbdrv->get_column_content(0, xmp_buffer);
                 m_dbdrv->get_column_content(1, main_file_id);
                 m_dbdrv->get_column_content(2, xmp_file_id);
@@ -931,7 +932,7 @@ bool Library::rewriteXmpForId(int id)
 bool Library::processXmpUpdateQueue()
 {
     bool retval = false;
-    std::vector<int> ids;
+    std::vector<library_id_t> ids;
     retval = getXmpIdsInQueue(ids);
     if(retval) {
         std::for_each(ids.begin(), ids.end(),
diff --git a/src/engine/db/library.hpp b/src/engine/db/library.hpp
index 9cae447..9d1602d 100644
--- a/src/engine/db/library.hpp
+++ b/src/engine/db/library.hpp
@@ -30,6 +30,7 @@
 #include "fwk/toolkit/notificationcenter.hpp"
 #include "fwk/utils/db/iconnectiondriver.hpp"
 #include "fwk/utils/db/iconnectionmanagerdriver.hpp"
+#include "engine/db/librarytypes.hpp"
 #include "engine/db/libfolder.hpp"
 #include "engine/db/libfile.hpp"
 #include "engine/db/libmetadata.hpp"
@@ -92,47 +93,47 @@ public:
 		 * @param file the file path
 		 * @param manage pass true it the library *manage* the file. Currently unsupported.
 		 */
-		int addFileAndFolder(const std::string & folder, 
+		library_id_t addFileAndFolder(const std::string & folder, 
                          const std::string & file, bool manage);
 
     /** add a fs file to the library  
      * @param file the file path
      * @return the id of the fs_file, -1 in case of error
      */
-    int addFsFile(const std::string & file);
+    library_id_t addFsFile(const std::string & file);
 
     /** Get a FsFile from an id
      * @param id the id of the FsFile
      * @return the path. Empty if not found.
      */
-    std::string getFsFile(int id);
+    std::string getFsFile(library_id_t id);
 
 		/** add a file to the library
 		 * @param folder_id the id of the containing folder
 		 * @param file the file path
 		 * @param manage pass true it the library *manage* the file. Currently unsupported.
 		 */
-		int addFile(int folder_id, const std::string & file, bool manage);
+		library_id_t addFile(library_id_t folder_id, const std::string & file, bool manage);
 
 		/** add a bundle of files to the library
 		 * @param folder_id the id of the containing folder
 		 * @param bundle the bundle
 		 * @param manage pass true it the library *manage* the file. Currently unsupported.
 		 */
-    int addBundle(int folder_id, const eng::FileBundle::Ptr & bundle, 
+    library_id_t addBundle(library_id_t folder_id, const eng::FileBundle::Ptr & bundle, 
                   bool manage);
     /** add a sidecar fsfile to a bundle (file)
      * @param file_id the id of the file bundle
      * @param fsfile_id the id of the fsfile
      * @return true if success
      */
-    bool addSidecarFileToBundle(int file_id, int fsfile_id);
+    bool addSidecarFileToBundle(library_id_t file_id, library_id_t fsfile_id);
     /** add a jpeg fsfile to a bundle (file)
      * @param file_id the id of the file bundle
      * @param fsfile_id the id of the fsfile
      * @return true if success
      */
-    bool addJpegFileToBundle(int file_id, int fsfile_id);
+    bool addJpegFileToBundle(library_id_t file_id, library_id_t fsfile_id);
 		
 		/** Get a specific folder id from the library
 		 * @param folder the folder path to check
@@ -153,21 +154,21 @@ public:
 		 * @param folder_id id of the folder
 		 * @param fl the resulting file list
 		 */
-		void getFolderContent(int folder_id, const LibFile::ListPtr & fl);
-		int countFolder(int folder_id);
+		void getFolderContent(library_id_t folder_id, const LibFile::ListPtr & fl);
+		int countFolder(library_id_t folder_id);
 		void getAllKeywords(const Keyword::ListPtr & l);
-		void getKeywordContent(int keyword_id, const LibFile::ListPtr & fl);
+		void getKeywordContent(library_id_t keyword_id, const LibFile::ListPtr & fl);
     /** get the metadata block (XMP) */
-		void getMetaData(int file_id, const LibMetadata::Ptr & );
+		void getMetaData(library_id_t file_id, const LibMetadata::Ptr & );
     /** set the metadata block (XMP) */
-    bool setMetaData(int file_id, const LibMetadata::Ptr & );
-    bool setMetaData(int file_id, int meta, const boost::any & value);
+    bool setMetaData(library_id_t file_id, const LibMetadata::Ptr & );
+    bool setMetaData(library_id_t file_id, int meta, const boost::any & value);
 
 		void getAllLabels(const eng::Label::ListPtr & l);
-    int addLabel(const std::string & name, const std::string & color);
-    int addLabel(const std::string & name, const fwk::RgbColor & c);
-    bool updateLabel(int label_id, const std::string & name, const std::string & color);
-    bool deleteLabel(int label_id);
+    library_id_t addLabel(const std::string & name, const std::string & color);
+    library_id_t addLabel(const std::string & name, const fwk::RgbColor & c);
+    bool updateLabel(library_id_t label_id, const std::string & name, const std::string & color);
+    bool deleteLabel(library_id_t label_id);
 
     /** Trigger the processing of the XMP update queue */
     bool processXmpUpdateQueue();
@@ -177,13 +178,13 @@ public:
 		 * @return -1 if not found (shouldn't happen) or the id of the
 		 * keyword, either found or just created.
 		 */
-		int makeKeyword(const std::string & keyword);
+		library_id_t makeKeyword(const std::string & keyword);
 		/** Assign a keyword to a file.
 		 * @param kw_id the keyword id
 		 * @param file_id the file id
 		 * @return true if success, false if error
 		 */
-		bool assignKeyword(int kw_id, int file_id);
+		bool assignKeyword(library_id_t kw_id, library_id_t file_id);
 
 		int checkDatabaseVersion();
 		
@@ -195,14 +196,14 @@ private:
 
     /** external sqlite fucntion to trigger the rewrite of the XMP */
     void triggerRewriteXmp(void);
-    bool getXmpIdsInQueue(std::vector<int> & ids);
+    bool getXmpIdsInQueue(std::vector<library_id_t> & ids);
     /** rewrite the XMP sidecar for the file whose id is %id
      * and remove it from the queue.
      */
-    bool rewriteXmpForId(int id);
+    bool rewriteXmpForId(library_id_t id);
 
     /** set an "internal" metadata of type int */
-    bool setInternalMetaDataInt(int file_id, const char* col,
+    bool setInternalMetaDataInt(library_id_t file_id, const char* col,
                                 int32_t value);
 
     std::string                       m_maindir;
diff --git a/src/engine/db/librarytypes.hpp b/src/engine/db/librarytypes.hpp
new file mode 100644
index 0000000..0c3a8e8
--- /dev/null
+++ b/src/engine/db/librarytypes.hpp
@@ -0,0 +1,33 @@
+/*
+ * niepce - db/librarytypes.hpp
+ *
+ * Copyright (C) Hubert Figuiere
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ENG_DB_LIBRARY_TYPES_HPP__
+#define __ENG_DB_LIBRARY_TYPES_HPP__
+
+
+#include <stdint.h>
+
+namespace eng {
+
+/** library id in the database */
+typedef int64_t library_id_t;
+	
+}
+
+#endif
diff --git a/src/engine/library/clienttypes.hpp b/src/engine/library/clienttypes.hpp
index 4b8b226..d7598ff 100644
--- a/src/engine/library/clienttypes.hpp
+++ b/src/engine/library/clienttypes.hpp
@@ -20,10 +20,17 @@
 #ifndef _LIBRARY_CLIENTTYPES_H_
 #define _LIBRARY_CLIENTTYPES_H_
 
+#include "engine/db/librarytypes.hpp"
+
 namespace eng {
 
 	typedef int tid_t; /**< transaction ID */
 
+	struct metadata_desc_t {
+		library_id_t id;
+		int          meta;
+		int          value;
+	};
 }
 
 
diff --git a/src/engine/library/commands.cpp b/src/engine/library/commands.cpp
index 9834d86..c603387 100644
--- a/src/engine/library/commands.cpp
+++ b/src/engine/library/commands.cpp
@@ -84,7 +84,7 @@ void Commands::cmdImportFiles(const Library::Ptr & lib,
 
 
 void Commands::cmdQueryFolderContent(const Library::Ptr & lib, 
-                                     int folder_id)
+                                     library_id_t folder_id)
 {
     LibFile::ListPtr fl(new LibFile::List());
     lib->getFolderContent(folder_id, fl);
@@ -92,14 +92,14 @@ void Commands::cmdQueryFolderContent(const Library::Ptr & lib,
 }
 
 void Commands::cmdCountFolder(const Library::Ptr & lib, 
-                              int folder_id)
+                              eng::library_id_t folder_id)
 {
     int count = lib->countFolder(folder_id);
     lib->notify(Library::NOTIFY_FOLDER_COUNTED, boost::any(std::make_pair(folder_id, count)));
 }
 
 void Commands::cmdQueryKeywordContent(const Library::Ptr & lib, 
-                                      int keyword_id)
+                                      library_id_t keyword_id)
 {
     LibFile::ListPtr fl(new LibFile::List());
     lib->getKeywordContent(keyword_id, fl);
@@ -107,7 +107,7 @@ void Commands::cmdQueryKeywordContent(const Library::Ptr & lib,
 }
 
 void Commands::cmdRequestMetadata(const Library::Ptr & lib,
-                                  int file_id)
+                                  library_id_t file_id)
 {
     LibMetadata::Ptr lm(new LibMetadata(file_id));
     lib->getMetaData(file_id, lm);
@@ -115,12 +115,12 @@ void Commands::cmdRequestMetadata(const Library::Ptr & lib,
 }
 
 void Commands::cmdSetMetadata(const Library::Ptr & lib,
-                              int file_id, int meta, int value)
+                              library_id_t file_id, int meta, int value)
 {
-    std::tr1::array<int, 3> m;
-    m[0] = file_id;
-    m[1] = meta;
-    m[2] = value;
+	metadata_desc_t m;
+	m.id = file_id;
+	m.meta = meta;
+	m.value = value;
     lib->setMetaData(file_id, meta, value);
     lib->notify(Library::NOTIFY_METADATA_CHANGED, boost::any(m));
 }
@@ -135,7 +135,7 @@ void Commands::cmdListAllLabels(const Library::Ptr & lib)
 void Commands::cmdCreateLabel(const Library::Ptr & lib,
                               const std::string & s, const std::string & color)
 {
-    int id = lib->addLabel(s, color);
+    int64_t id = lib->addLabel(s, color);
     if(id != -1) {
         eng::Label::ListPtr l(new eng::Label::List);
         l->push_back(eng::Label::Ptr(new eng::Label(id, s, color)));
@@ -153,7 +153,7 @@ void Commands::cmdDeleteLabel(const Library::Ptr & lib,
 
 
 void Commands::cmdUpdateLabel(const Library::Ptr & lib,
-                              int label_id, const std::string & name,
+                              eng::library_id_t label_id, const std::string & name,
                               const std::string & color)
 {
     lib->updateLabel(label_id, name, color);
diff --git a/src/engine/library/commands.hpp b/src/engine/library/commands.hpp
index 4d242a9..83648ff 100644
--- a/src/engine/library/commands.hpp
+++ b/src/engine/library/commands.hpp
@@ -44,22 +44,22 @@ public:
                                const fwk::FileList::Ptr & files, 
                                bool manage);
 		static void cmdQueryFolderContent(const Library::Ptr & lib, 
-                                      int folder_id);
+                                      library_id_t folder_id);
 		static void cmdCountFolder(const Library::Ptr & lib, 
-                               int folder_id);
+								   library_id_t folder_id);
 		static void cmdQueryKeywordContent(const Library::Ptr & lib, 
-                                       int keyword_id);
+                                       library_id_t keyword_id);
 		static void cmdRequestMetadata(const Library::Ptr & lib,
-                                   int file_id);
+                                   library_id_t file_id);
     static void cmdSetMetadata(const Library::Ptr & lib,
-                               int file_id, int meta, int value);
+                               library_id_t file_id, int meta, int value);
     static void cmdListAllLabels(const Library::Ptr & lib);
     static void cmdCreateLabel(const Library::Ptr & lib, const std::string & s, 
                                const std::string & color);
     static void cmdDeleteLabel(const Library::Ptr & lib,
                                int label_id);
     static void cmdUpdateLabel(const Library::Ptr & lib,
-                               int label_id, const std::string & name,
+                               eng::library_id_t label_id, const std::string & name,
                                const std::string & color);
 		static void cmdProcessXmpUpdateQueue(const Library::Ptr & lib);
 };
diff --git a/src/engine/library/thumbnailcache.cpp b/src/engine/library/thumbnailcache.cpp
index cb0be65..273d77e 100644
--- a/src/engine/library/thumbnailcache.cpp
+++ b/src/engine/library/thumbnailcache.cpp
@@ -153,7 +153,7 @@ void ThumbnailCache::execute(const  ThumbnailTask::Ptr & task)
             tn.height = pix->get_height();
             tn.pixmap = pix;
             n->setData(boost::any(tn));
-            DBG_OUT("notify thumbnail for id=%d", tn.id);
+            DBG_OUT("notify thumbnail for id=%Ld", tn.id);
             nc->post(n);
         }
     }
diff --git a/src/engine/library/thumbnailnotification.hpp b/src/engine/library/thumbnailnotification.hpp
index 9399a62..7a4807e 100644
--- a/src/engine/library/thumbnailnotification.hpp
+++ b/src/engine/library/thumbnailnotification.hpp
@@ -23,11 +23,13 @@
 
 #include <gdkmm/pixbuf.h>
 
+#include "engine/db/librarytypes.hpp"
+
 namespace eng {
 
 	struct ThumbnailNotification
 	{
-		int  id;
+		eng::library_id_t  id;
 		int  width;
 		int  height;
 		Glib::RefPtr<Gdk::Pixbuf> pixmap; 
diff --git a/src/fwk/toolkit/command.hpp b/src/fwk/toolkit/command.hpp
index 6492ab9..045ad8e 100644
--- a/src/fwk/toolkit/command.hpp
+++ b/src/fwk/toolkit/command.hpp
@@ -28,6 +28,7 @@ namespace fwk {
 class Command
 {
 public:
+	virtual ~Command() {}
     typedef boost::function<void (void)> Function;
     virtual void undo() = 0;
     virtual void redo() = 0;
diff --git a/src/fwk/toolkit/metadatawidget.cpp b/src/fwk/toolkit/metadatawidget.cpp
index 27b61c8..4f92484 100644
--- a/src/fwk/toolkit/metadatawidget.cpp
+++ b/src/fwk/toolkit/metadatawidget.cpp
@@ -138,7 +138,7 @@ void MetaDataWidget::add_data(const std::string & id,
         Gtk::Label *labelw = Gtk::manage(new Gtk::Label(
                                              Glib::ustring("<b>") 
                                              + label + "</b>"));
-        labelw->set_alignment(0, 0.5);
+        labelw->set_alignment(0.0f, 0.5f);
         labelw->set_use_markup(true);
 
         if(type == xmp::META_DT_STAR_RATING) {
@@ -146,7 +146,7 @@ void MetaDataWidget::add_data(const std::string & id,
         }
         else {
             w = Gtk::manage(new Gtk::Label());
-            static_cast<Gtk::Label*>(w)->set_alignment(0, 0.5);
+            static_cast<Gtk::Label*>(w)->set_alignment(0.0f, 0.5f);
         }
 
         m_table.resize(n_row + 1, 2);
diff --git a/src/libraryclient/clientimpl.cpp b/src/libraryclient/clientimpl.cpp
index dfb5c2d..a009c26 100644
--- a/src/libraryclient/clientimpl.cpp
+++ b/src/libraryclient/clientimpl.cpp
@@ -71,7 +71,7 @@ tid_t ClientImpl::getAllFolders()
     return id;
 }
 
-tid_t ClientImpl::queryFolderContent(int folder_id)
+tid_t ClientImpl::queryFolderContent(eng::library_id_t folder_id)
 {
     tid_t id = LibraryClient::newTid();
     Op::Ptr op(new Op(id, boost::bind(&Commands::cmdQueryFolderContent,
@@ -81,7 +81,7 @@ tid_t ClientImpl::queryFolderContent(int folder_id)
 }
 
 
-tid_t ClientImpl::countFolder(int folder_id)
+tid_t ClientImpl::countFolder(eng::library_id_t folder_id)
 {
     tid_t id = LibraryClient::newTid();
     Op::Ptr op(new Op(id, boost::bind(&Commands::cmdCountFolder, 
@@ -91,7 +91,7 @@ tid_t ClientImpl::countFolder(int folder_id)
 }
 
 
-tid_t ClientImpl::queryKeywordContent(int keyword_id)
+tid_t ClientImpl::queryKeywordContent(eng::library_id_t keyword_id)
 {
     tid_t id = LibraryClient::newTid();
     Op::Ptr op(new Op(id, boost::bind(&Commands::cmdQueryKeywordContent,
@@ -101,7 +101,7 @@ tid_t ClientImpl::queryKeywordContent(int keyword_id)
 }
 
 
-tid_t ClientImpl::requestMetadata(int file_id)
+tid_t ClientImpl::requestMetadata(eng::library_id_t file_id)
 {
     tid_t id = LibraryClient::newTid();
     Op::Ptr op(new Op(id, boost::bind(&Commands::cmdRequestMetadata,
@@ -111,7 +111,7 @@ tid_t ClientImpl::requestMetadata(int file_id)
 }
 
 
-tid_t ClientImpl::setMetadata(int file_id, int meta, int value)
+tid_t ClientImpl::setMetadata(eng::library_id_t file_id, int meta, int value)
 {
     tid_t id = LibraryClient::newTid();
     Op::Ptr op(new Op(id, boost::bind(&Commands::cmdSetMetadata, _1,
@@ -149,7 +149,7 @@ tid_t ClientImpl::deleteLabel(int label_id)
     return id;    
 }
 
-tid_t ClientImpl::updateLabel(int label_id, const std::string & new_name,
+tid_t ClientImpl::updateLabel(eng::library_id_t label_id, const std::string & new_name,
                               const std::string & new_color)
 {
     tid_t id = LibraryClient::newTid();
diff --git a/src/libraryclient/clientimpl.hpp b/src/libraryclient/clientimpl.hpp
index 00bcacb..0230fa9 100644
--- a/src/libraryclient/clientimpl.hpp
+++ b/src/libraryclient/clientimpl.hpp
@@ -41,17 +41,17 @@ public:
 		virtual ~ClientImpl();
 
 		eng::tid_t getAllKeywords();
-		eng::tid_t queryKeywordContent(int id);
+		eng::tid_t queryKeywordContent(eng::library_id_t id);
 		eng::tid_t getAllFolders();
-		eng::tid_t queryFolderContent(int id);
-		eng::tid_t countFolder(int id);
-		eng::tid_t requestMetadata(int id);
-    eng::tid_t setMetadata(int id, int meta, int value);
+		eng::tid_t queryFolderContent(eng::library_id_t id);
+	eng::tid_t countFolder(eng::library_id_t id);
+	eng::tid_t requestMetadata(eng::library_id_t id);
+    eng::tid_t setMetadata(eng::library_id_t id, int meta, int value);
 
     eng::tid_t getAllLabels();
     eng::tid_t createLabel(const std::string & s, const std::string & color);
     eng::tid_t deleteLabel(int id);
-    eng::tid_t updateLabel(int id, const std::string & new_name,
+    eng::tid_t updateLabel(eng::library_id_t id, const std::string & new_name,
                                const std::string & new_color);
 
     eng::tid_t processXmpUpdateQueue();
diff --git a/src/libraryclient/libraryclient.cpp b/src/libraryclient/libraryclient.cpp
index cd0c82a..d7065b2 100644
--- a/src/libraryclient/libraryclient.cpp
+++ b/src/libraryclient/libraryclient.cpp
@@ -25,7 +25,7 @@
 #include "uidataprovider.hpp"
 
 using eng::tid_t;
-
+using eng::library_id_t;
 
 namespace libraryclient {
 
@@ -64,28 +64,28 @@ tid_t LibraryClient::getAllFolders()
     return m_pImpl->getAllFolders();
 }
 
-tid_t LibraryClient::queryFolderContent(int id)
+tid_t LibraryClient::queryFolderContent(eng::library_id_t id)
 {
     return m_pImpl->queryFolderContent(id);
 }
 
-tid_t LibraryClient::queryKeywordContent(int id)
+tid_t LibraryClient::queryKeywordContent(eng::library_id_t id)
 {
     return m_pImpl->queryKeywordContent(id);
 }
 
-eng::tid_t LibraryClient::countFolder(int id)
+eng::tid_t LibraryClient::countFolder(library_id_t id)
 {
     return m_pImpl->countFolder(id);
 }
 
-eng::tid_t LibraryClient::requestMetadata(int id)
+eng::tid_t LibraryClient::requestMetadata(eng::library_id_t id)
 {
     return m_pImpl->requestMetadata(id);
 }
 
 /** set the metadata */
-eng::tid_t LibraryClient::setMetadata(int id, int meta, int value)
+eng::tid_t LibraryClient::setMetadata(library_id_t id, int meta, int value)
 {
     return m_pImpl->setMetadata(id, meta, value);
 }
@@ -108,7 +108,7 @@ eng::tid_t LibraryClient::deleteLabel(int id)
 }
 
 
-eng::tid_t LibraryClient::updateLabel(int id, const std::string & new_name,
+eng::tid_t LibraryClient::updateLabel(library_id_t id, const std::string & new_name,
                                           const std::string & new_color)
 {
     return m_pImpl->updateLabel(id, new_name, new_color);
diff --git a/src/libraryclient/libraryclient.hpp b/src/libraryclient/libraryclient.hpp
index 9cb79d7..1095592 100644
--- a/src/libraryclient/libraryclient.hpp
+++ b/src/libraryclient/libraryclient.hpp
@@ -25,6 +25,7 @@
 
 #include "engine/library/clienttypes.hpp"
 #include "engine/library/thumbnailcache.hpp"
+#include "engine/db/librarytypes.hpp"
 #include "engine/db/storage.hpp"
 
 namespace fwk {
@@ -57,20 +58,20 @@ namespace libraryclient {
 		 */
 		eng::tid_t getAllFolders();
 
-		eng::tid_t queryFolderContent(int id);
-		eng::tid_t queryKeywordContent(int id);
-		eng::tid_t countFolder(int id);
-		eng::tid_t requestMetadata(int id);
+		eng::tid_t queryFolderContent(eng::library_id_t id);
+		eng::tid_t queryKeywordContent(eng::library_id_t id);
+		eng::tid_t countFolder(eng::library_id_t id);
+		eng::tid_t requestMetadata(eng::library_id_t id);
 
     /** set the metadata */
-    eng::tid_t setMetadata(int id, int meta, int value);
+    eng::tid_t setMetadata(eng::library_id_t id, int meta, int value);
 
     /** get all the labels */
     eng::tid_t getAllLabels();
     eng::tid_t createLabel(const std::string & s, const std::string & color);
     eng::tid_t deleteLabel(int id);
     /** update a label */
-    eng::tid_t updateLabel(int id, const std::string & new_name, 
+    eng::tid_t updateLabel(eng::library_id_t id, const std::string & new_name, 
                                const std::string & new_color);
 
     /** tell to process the Xmp update Queue */
diff --git a/src/niepce/modules/darkroom/dritemwidget.cpp b/src/niepce/modules/darkroom/dritemwidget.cpp
index f5e2317..ffe231b 100644
--- a/src/niepce/modules/darkroom/dritemwidget.cpp
+++ b/src/niepce/modules/darkroom/dritemwidget.cpp
@@ -32,7 +32,7 @@ DrItemWidget::DrItemWidget(const Glib::ustring & title)
 
 void DrItemWidget::add_widget(const Glib::ustring & label, Gtk::Widget & w)
 {
-    Gtk::Label *l = manage(new Gtk::Label(label, 0.0, 0.5));
+    Gtk::Label *l = manage(new Gtk::Label(label, 0.0f, 0.5f));
     m_box.pack_start(*l, Gtk::PACK_SHRINK);
     m_box.pack_start(w, Gtk::PACK_SHRINK);
 }
diff --git a/src/niepce/ui/filmstripcontroller.cpp b/src/niepce/ui/filmstripcontroller.cpp
index a637ffd..a44137e 100644
--- a/src/niepce/ui/filmstripcontroller.cpp
+++ b/src/niepce/ui/filmstripcontroller.cpp
@@ -56,9 +56,9 @@ Gtk::IconView * FilmStripController::image_list()
     return m_thumbview;
 }
 
-int FilmStripController::get_selected()
+eng::library_id_t FilmStripController::get_selected()
 {
-    int id = 0;
+	eng::library_id_t id = 0;
     DBG_OUT("get selected in filmstrip");
     Gtk::IconView::ArrayHandle_TreePaths paths = m_thumbview->get_selected_items();
     if(!paths.empty()) {
@@ -76,9 +76,9 @@ int FilmStripController::get_selected()
     return id;
 }
 
-void FilmStripController::select_image(int id)
+void FilmStripController::select_image(eng::library_id_t id)
 {
-    DBG_OUT("filmstrip select %d", id);
+    DBG_OUT("filmstrip select %Ld", id);
     Gtk::TreePath path = m_store->get_path_from_id(id);
     if(path) {
         m_thumbview->select_path(path);
diff --git a/src/niepce/ui/filmstripcontroller.hpp b/src/niepce/ui/filmstripcontroller.hpp
index 374aee3..a189453 100644
--- a/src/niepce/ui/filmstripcontroller.hpp
+++ b/src/niepce/ui/filmstripcontroller.hpp
@@ -44,8 +44,8 @@ public:
 	FilmStripController(const Glib::RefPtr<ImageListStore> & store);
 
 	virtual Gtk::IconView * image_list();
-	virtual int get_selected();
-	virtual void select_image(int id);
+	virtual eng::library_id_t get_selected();
+	virtual void select_image(eng::library_id_t id);
 
 	virtual Gtk::Widget * buildWidget(const Glib::RefPtr<Gtk::UIManager> &);
 
diff --git a/src/niepce/ui/gridviewmodule.cpp b/src/niepce/ui/gridviewmodule.cpp
index 885a1b7..1b88952 100644
--- a/src/niepce/ui/gridviewmodule.cpp
+++ b/src/niepce/ui/gridviewmodule.cpp
@@ -59,10 +59,10 @@ GridViewModule::on_lib_notification(const eng::LibNotification &ln)
     case eng::Library::NOTIFY_METADATA_CHANGED:
     {
         DBG_OUT("metadata changed");
-        std::tr1::array<int, 3> m = boost::any_cast<std::tr1::array<int, 3> >(ln.param);
-        if(m[0] == m_metapanecontroller->displayed_file()) {
+		eng::metadata_desc_t m = boost::any_cast<eng::metadata_desc_t>(ln.param);
+        if(m.id == m_metapanecontroller->displayed_file()) {
             // FIXME: actually just update the metadata
-          m_shell->getLibraryClient()->requestMetadata(m[0]);
+          m_shell->getLibraryClient()->requestMetadata(m.id);
         }
         break;
     }
@@ -133,9 +133,9 @@ Gtk::IconView * GridViewModule::image_list()
     return & m_librarylistview; 
 }
 
-int GridViewModule::get_selected()
+eng::library_id_t GridViewModule::get_selected()
 {
-    int id = 0;
+	eng::library_id_t id = 0;
     Glib::RefPtr<Gtk::TreeSelection> selection;
 
     Gtk::IconView::ArrayHandle_TreePaths paths = m_librarylistview.get_selected_items();
@@ -151,13 +151,13 @@ int GridViewModule::get_selected()
             }
         }
     }
-    DBG_OUT("get_selected %d", id);
+    DBG_OUT("get_selected %Ld", id);
     return id;
 }
 
-void GridViewModule::select_image(int id)
+void GridViewModule::select_image(eng::library_id_t id)
 {
-    DBG_OUT("library select %d", id);
+    DBG_OUT("library select %Ld", id);
     Gtk::TreePath path = m_model->get_path_from_id(id);
     if(path) {
       m_librarylistview.select_path(path);
diff --git a/src/niepce/ui/gridviewmodule.hpp b/src/niepce/ui/gridviewmodule.hpp
index 5379d93..8cc3fc5 100644
--- a/src/niepce/ui/gridviewmodule.hpp
+++ b/src/niepce/ui/gridviewmodule.hpp
@@ -64,8 +64,8 @@ public:
 
   /* IImageSelectable */
   virtual Gtk::IconView * image_list();
-  virtual int get_selected();
-  virtual void select_image(int id);
+  virtual eng::library_id_t get_selected();
+  virtual void select_image(eng::library_id_t id);
 
 protected:
   virtual Gtk::Widget * buildWidget(const Glib::RefPtr<Gtk::UIManager> & manager);
diff --git a/src/niepce/ui/imageliststore.cpp b/src/niepce/ui/imageliststore.cpp
index 0890f2c..0a089a9 100644
--- a/src/niepce/ui/imageliststore.cpp
+++ b/src/niepce/ui/imageliststore.cpp
@@ -42,9 +42,9 @@ ImageListStore::ImageListStore(const Columns& _columns)
 }
 
 
-Gtk::TreeIter ImageListStore::get_iter_from_id(int id)
+Gtk::TreeIter ImageListStore::get_iter_from_id(eng::library_id_t id)
 {
-    std::map<int, Gtk::TreeIter>::iterator iter
+    std::map<eng::library_id_t, Gtk::TreeIter>::iterator iter
         = m_idmap.find( id );
     if(iter != m_idmap.end()) {
         return iter->second;
@@ -52,7 +52,7 @@ Gtk::TreeIter ImageListStore::get_iter_from_id(int id)
     return Gtk::TreeIter();
 }
 
-Gtk::TreePath ImageListStore::get_path_from_id(int id)
+Gtk::TreePath ImageListStore::get_path_from_id(eng::library_id_t id)
 {
     Gtk::TreeIter iter = get_iter_from_id(id);
     if(iter) {
@@ -102,15 +102,15 @@ void ImageListStore::on_lib_notification(const eng::LibNotification &ln)
     }
     case eng::Library::NOTIFY_METADATA_CHANGED:
     {
-        std::tr1::array<int, 3> m = boost::any_cast<std::tr1::array<int, 3> >(ln.param);
+		eng::metadata_desc_t m = boost::any_cast<eng::metadata_desc_t>(ln.param);
         DBG_OUT("metadata changed");
         Gtk::TreeRow row;
-        std::map<int, Gtk::TreeIter>::const_iterator iter = m_idmap.find(m[0]);
+        std::map<eng::library_id_t, Gtk::TreeIter>::const_iterator iter = m_idmap.find(m.id);
         if(iter != m_idmap.end()) {
             row = *(iter->second);
             //
             eng::LibFile::Ptr file = row[m_columns.m_libfile];
-            file->setMetaData(m[1], m[2]);
+            file->setMetaData(m.meta, m.value);
             row[m_columns.m_libfile] = file;
         }
         break;
@@ -127,7 +127,7 @@ void ImageListStore::on_lib_notification(const eng::LibNotification &ln)
 
 void ImageListStore::on_tnail_notification(const eng::ThumbnailNotification &tn)
 {
-    std::map<int, Gtk::TreeIter>::iterator iter
+    std::map<eng::library_id_t, Gtk::TreeIter>::iterator iter
         = m_idmap.find( tn.id );
     if(iter != m_idmap.end()) {
         // found the icon view item
@@ -136,7 +136,7 @@ void ImageListStore::on_tnail_notification(const eng::ThumbnailNotification &tn)
         row[m_columns.m_strip_thumb] = fwk::gdkpixbuf_scale_to_fit(tn.pixmap, 100);
     }
     else {
-        DBG_OUT("row %d not found", tn.id);
+        DBG_OUT("row %Ld not found", tn.id);
     }
 }
 
diff --git a/src/niepce/ui/imageliststore.hpp b/src/niepce/ui/imageliststore.hpp
index a9a2393..8220a31 100644
--- a/src/niepce/ui/imageliststore.hpp
+++ b/src/niepce/ui/imageliststore.hpp
@@ -61,8 +61,8 @@ public:
 
     const Columns & columns() const
         { return m_columns; }
-    Gtk::TreePath get_path_from_id(int id);
-    Gtk::TreeIter get_iter_from_id(int id);
+    Gtk::TreePath get_path_from_id(eng::library_id_t id);
+    Gtk::TreeIter get_iter_from_id(eng::library_id_t id);
 
     static Glib::RefPtr<ImageListStore> create();
 
@@ -77,7 +77,7 @@ private:
     libraryclient::LibraryClient::Ptr getLibraryClient();
 
     const Columns           & m_columns;
-    std::map<int, Gtk::TreeIter> m_idmap;
+    std::map<eng::library_id_t, Gtk::TreeIter> m_idmap;
     fwk::Controller::WeakPtr m_controller;
 };
 
diff --git a/src/niepce/ui/metadatapanecontroller.cpp b/src/niepce/ui/metadatapanecontroller.cpp
index 5219ac6..f4bef64 100644
--- a/src/niepce/ui/metadatapanecontroller.cpp
+++ b/src/niepce/ui/metadatapanecontroller.cpp
@@ -120,7 +120,7 @@ namespace ui {
   }
   
   
-  void MetaDataPaneController::display(int file_id, const fwk::XmpMeta * meta)
+	void MetaDataPaneController::display(eng::library_id_t file_id, const fwk::XmpMeta * meta)
   {
     m_fileid = file_id;
     DBG_OUT("displaying metadata");
diff --git a/src/niepce/ui/metadatapanecontroller.hpp b/src/niepce/ui/metadatapanecontroller.hpp
index d9394f0..bdc539b 100644
--- a/src/niepce/ui/metadatapanecontroller.hpp
+++ b/src/niepce/ui/metadatapanecontroller.hpp
@@ -22,6 +22,7 @@
 
 #include <gtkmm/box.h>
 
+#include "engine/db/librarytypes.hpp"
 #include "fwk/utils/exempi.hpp"
 #include "fwk/toolkit/dockable.hpp"
 
@@ -43,15 +44,15 @@ public:
     MetaDataPaneController();
     ~MetaDataPaneController();
     virtual Gtk::Widget * buildWidget(const Glib::RefPtr<Gtk::UIManager> &);
-    void display(int file_id, const fwk::XmpMeta * meta);
-    int displayed_file() const 
+    void display(eng::library_id_t file_id, const fwk::XmpMeta * meta);
+    eng::library_id_t displayed_file() const 
         { return m_fileid; }
 private:
     std::vector<fwk::MetaDataWidget *> m_widgets;
     
     static const xmp::MetaDataSectionFormat * get_format();
     
-    int m_fileid;
+	eng::library_id_t m_fileid;
 };
 
 }
diff --git a/src/niepce/ui/selectioncontroller.cpp b/src/niepce/ui/selectioncontroller.cpp
index 1cdaf86..197707a 100644
--- a/src/niepce/ui/selectioncontroller.cpp
+++ b/src/niepce/ui/selectioncontroller.cpp
@@ -69,8 +69,8 @@ void SelectionController::activated(const Gtk::TreeModel::Path & path,
     if(iter) {
         eng::LibFile::Ptr file = (*iter)[m_imageliststore->columns().m_libfile];
         if(file) {
-            int selection = file->id();
-            DBG_OUT("item activated %d", selection);
+            eng::library_id_t selection = file->id();
+            DBG_OUT("item activated %Ld", selection);
             signal_activated(selection);
         }
     }
@@ -85,7 +85,7 @@ void SelectionController::selected(IImageSelectable * selectable)
 
 	fwk::AutoFlag f(m_in_handler);
 
-	int selection = selectable->get_selected();
+	eng::library_id_t selection = selectable->get_selected();
 	std::vector<IImageSelectable *>::iterator iter;
 	for(iter = m_selectables.begin(); iter != m_selectables.end(); iter++) {
 		if(*iter != selectable) {
@@ -103,7 +103,7 @@ libraryclient::LibraryClient::Ptr SelectionController::getLibraryClient()
     return	shell->getLibraryClient();
 }
 
-inline int SelectionController::get_selection()
+inline eng::library_id_t SelectionController::get_selection()
 {
     DBG_ASSERT(!m_selectables.empty(), "selectables list can't be empty");
     return m_selectables[0]->get_selected();
@@ -112,7 +112,7 @@ inline int SelectionController::get_selection()
 
 void SelectionController::_selection_move(bool backwards)
 {
-    int selection = get_selection();
+	eng::library_id_t selection = get_selection();
     Gtk::TreeIter iter = m_imageliststore->get_iter_from_id(selection);
     if(iter) {
         if(backwards) {
@@ -156,7 +156,7 @@ void SelectionController::select_next()
 void SelectionController::rotate(int angle)
 {
     DBG_OUT("angle = %d", angle);
-    int selection = get_selection();
+	eng::library_id_t selection = get_selection();
     if(selection >= 0) {
         Gtk::TreeIter iter = m_imageliststore->get_iter_from_id(selection);
         if(iter) {
@@ -184,7 +184,7 @@ bool SelectionController::_set_metadata(const std::string & undo_label, const en
 void SelectionController::set_label(int label)
 {
     DBG_OUT("label = %d", label);
-    int selection = get_selection();
+    eng::library_id_t selection = get_selection();
     if(selection >= 0) {
         Gtk::TreeIter iter = m_imageliststore->get_iter_from_id(selection);
         if(iter) {
@@ -205,7 +205,7 @@ void SelectionController::set_label(int label)
 void SelectionController::set_rating(int rating)
 {
     DBG_OUT("rating = %d", rating);
-    int selection = get_selection();
+    eng::library_id_t selection = get_selection();
     if(selection >= 0) {
         Gtk::TreeIter iter = m_imageliststore->get_iter_from_id(selection);
         if(iter) {
@@ -225,7 +225,7 @@ void SelectionController::set_rating(int rating)
 void SelectionController::set_flag(int flag)
 {
     DBG_OUT("flag = %d", flag);
-    int selection = get_selection();
+    eng::library_id_t selection = get_selection();
     if(selection >= 0) {
         Gtk::TreeIter iter = m_imageliststore->get_iter_from_id(selection);
         if(iter) {
diff --git a/src/niepce/ui/selectioncontroller.hpp b/src/niepce/ui/selectioncontroller.hpp
index 2b49102..f453f32 100644
--- a/src/niepce/ui/selectioncontroller.hpp
+++ b/src/niepce/ui/selectioncontroller.hpp
@@ -26,6 +26,7 @@
 #include <sigc++/signal.h>
 
 #include "fwk/toolkit/controller.hpp"
+#include "engine/db/librarytypes.hpp";
 #include "ui/imageliststore.hpp"
 
 namespace Gtk {
@@ -44,11 +45,11 @@ public:
     virtual ~IImageSelectable() {}
     virtual Gtk::IconView * image_list() = 0;
     /** Return the id of the selection. <= 0 is none. */
-    virtual int get_selected() = 0;
+    virtual eng::library_id_t get_selected() = 0;
     /** select the image a specific id 
      *  might emit the signals.
      */
-    virtual void select_image(int id) = 0;
+    virtual void select_image(eng::library_id_t id) = 0;
 };
 
 
@@ -70,10 +71,10 @@ public:
 		{ return m_imageliststore; }
 
 	// the signal to call when selection is changed.
-    sigc::signal<void, int> signal_selected;
+    sigc::signal<void, eng::library_id_t> signal_selected;
 
 	// signal for when the item is activated (ie double-click)
-    sigc::signal<void, int> signal_activated;
+    sigc::signal<void, eng::library_id_t> signal_activated;
 
     /////////
     /** select the previous image. Emit the signal */
@@ -91,7 +92,7 @@ public:
 protected:
     virtual void _added();
 private:
-    int get_selection();
+	eng::library_id_t get_selection();
     libraryclient::LibraryClient::Ptr getLibraryClient();
 
     bool _set_metadata(const std::string & undo_label, 
diff --git a/src/niepce/ui/workspacecontroller.cpp b/src/niepce/ui/workspacecontroller.cpp
index c202873..b670b13 100644
--- a/src/niepce/ui/workspacecontroller.cpp
+++ b/src/niepce/ui/workspacecontroller.cpp
@@ -27,6 +27,7 @@
 
 #include "fwk/base/debug.hpp"
 #include "niepce/notifications.hpp"
+#include "engine/db/librarytypes.hpp"
 #include "libraryclient/libraryclient.hpp"
 #include "fwk/toolkit/application.hpp"
 #include "niepcewindow.hpp"
@@ -108,8 +109,8 @@ void WorkspaceController::on_lib_notification(const eng::LibNotification &ln)
     }
     case eng::Library::NOTIFY_FOLDER_COUNTED:
     {
-        std::pair<int,int> count(boost::any_cast<std::pair<int,int> >(ln.param));
-        DBG_OUT("count for folder %d is %d", count.first, count.second);
+        std::pair<eng::library_id_t,int> count(boost::any_cast<std::pair<eng::library_id_t,int> >(ln.param));
+        DBG_OUT("count for folder %Ld is %d", count.first, count.second);
         std::map<int, Gtk::TreeIter>::iterator iter
             = m_folderidmap.find( count.first );
         if(iter != m_folderidmap.end()) {
@@ -178,7 +179,7 @@ WorkspaceController::add_item(const Glib::RefPtr<Gtk::TreeStore> &treestore,
                               const Gtk::TreeNodeChildren & childrens,
                               const Glib::RefPtr<Gdk::Pixbuf> & icon,
                               const Glib::ustring & label, 
-                              int id, int type) const
+                              eng::library_id_t id, int type) const
 {
     Gtk::TreeModel::iterator iter;
     Gtk::TreeModel::Row row;
@@ -222,7 +223,7 @@ Gtk::Widget * WorkspaceController::buildWidget(const Glib::RefPtr<Gtk::UIManager
     col->set_expand(true);
     num = m_librarytree.append_column("", m_librarycolumns.m_count);
     col = m_librarytree.get_column(num - 1);
-    col->set_alignment(1.0);
+    col->set_alignment(1.0f);
 
     // TODO make it a mnemonic
     m_label.set_text_with_mnemonic(Glib::ustring(_("_Workspace")));
diff --git a/src/niepce/ui/workspacecontroller.hpp b/src/niepce/ui/workspacecontroller.hpp
index 8e69179..b00fdb1 100644
--- a/src/niepce/ui/workspacecontroller.hpp
+++ b/src/niepce/ui/workspacecontroller.hpp
@@ -103,7 +103,7 @@ namespace ui {
 										  const Gtk::TreeNodeChildren & childrens,
 										  const Glib::RefPtr<Gdk::Pixbuf> & icon,
 										  const Glib::ustring & label, 
-										  int id, int type) const;
+										  eng::library_id_t id, int type) const;
 		enum {
 			ICON_FOLDER = 0,
 			ICON_PROJECT,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]