[Digikam-devel] [Bug 152424] Workflow organizing : use Color Label Tags over icon view items

Gilles Caulier caulier.gilles at gmail.com
Wed Feb 2 19:18:18 GMT 2011


https://bugs.kde.org/show_bug.cgi?id=152424





--- Comment #68 from Gilles Caulier <caulier gilles gmail com>  2011-02-02 20:18:17 ---
SVN commit 1218526 by mwiesweg:

1) Do not add the color label tag to ImageListerRecord when  it is not filled
  by the IOSlave - data is invalid, but the field was marked as cached.
  (we dont want to change the ioslave binary protocol, it's fast enough to read
when needed)
2) Reset colorLabelCached flag at a tag change

colorLabel() work now!



 M  +2 -15     imageinfo.cpp
 M  +2 -0      imageinfocache.cpp
 M  +0 -2      imagelisterrecord.h


--- branches/extragear/graphics/digikam/core/libs/database/imageinfo.cpp
#1218525:1218526
@@ -68,7 +68,7 @@
    albumId                = -1;
    albumRootId            = -1;

-    colorLabel             = -1;
+    colorLabel             = NoneLabel;
    rating                 = -1;
    category               = DatabaseItem::UndefinedCategory;
    fileSize               = 0;
@@ -109,7 +109,6 @@
    m_data->albumRootId            = record.albumRootID;
    m_data->name                   = record.name;

-    m_data->colorLabel             = record.colorLabel;
    m_data->rating                 = record.rating;
    m_data->category               = record.category;
    m_data->format                 = record.format;
@@ -118,7 +117,6 @@
    m_data->fileSize               = record.fileSize;
    m_data->imageSize              = record.imageSize;

-    m_data->colorLabelCached       = true;
    m_data->ratingCached           = true;
    m_data->categoryCached         = true;
    m_data->formatCached           = true;
@@ -377,11 +375,8 @@

    if (!m_data->colorLabelCached)
    {
-        m_data.constCastData()->colorLabel = NoneLabel;
        QList<int> tags = tagIds();

-        kDebug() << tags;
-
        foreach(int tagId, tags)
        {
            for (int i = NoneLabel ; i <= WhiteLabel; ++i)
@@ -389,7 +384,6 @@
                if (tagId ==
TagsCache::instance()->getTagForColorLabel((ColorLabel)i))
                {
                    m_data.constCastData()->colorLabel = i;
-                    kDebug() << i << " :: " << m_data->colorLabel;
                    break;
                }
            }
@@ -398,8 +392,6 @@
        m_data.constCastData()->colorLabelCached = true;
    }

-    kDebug() << m_data->colorLabel;
-
    return m_data->colorLabel;
 }

@@ -1036,19 +1028,13 @@
    int tagId     = tc->getTagForColorLabel((ColorLabel)colorId);
    if (!tagId) return;

-    kDebug() << "Before to assign Color Label: " << tagIds();
-
    // Color Label is an exclusive tags.

    for (int i = NoneLabel ; i <= WhiteLabel ; ++i)
        removeTag(tc->getTagForColorLabel((ColorLabel)i));

-    kDebug() << "All Color Label removed: " << tagIds();
-
    setTag(tagId);

-    kDebug() << "Color Label assigned: " << colorId << " :: " << tagId << " ("
<< tagIds() << ")";
-
    m_data->colorLabel                       = colorId;
    m_data.constCastData()->colorLabelCached = true;
 }
@@ -1091,6 +1077,7 @@
        return;
    }

+    kDebug() << m_data->id << tagID;
    DatabaseAccess access;
    access.db()->addItemTag(m_data->id, tagID);
 }
--- branches/extragear/graphics/digikam/core/libs/database/imageinfocache.cpp
#1218525:1218526
@@ -30,6 +30,7 @@
 #include "imageinfo.h"
 #include "imageinfolist.h"
 #include "imageinfodata.h"
+#include <kdebug.h>

 namespace Digikam
 {
@@ -212,6 +213,7 @@
        if (it != m_infos.end())
        {
            (*it)->tagIdsCached = false;
+            (*it)->colorLabelCached = false;
        }
    }
 }
--- branches/extragear/graphics/digikam/core/libs/database/imagelisterrecord.h
#1218525:1218526
@@ -65,14 +65,12 @@
        imageID     = -1;
        albumID     = -1;
        albumRootID = -1;
-        colorLabel  = -1;
        rating      = -1;
        fileSize    = -1;
    }

    int                    albumID;
    int                    albumRootID;
-    int                    colorLabel;
    int                    rating;
    int                    fileSize;

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list