[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    proko2: kdepim/kresources/kolab/shared
From:       Bo Thorsen <bo () sonofthor ! dk>
Date:       2004-06-29 12:27:39
Message-ID: 20040629122739.12E2B99A9 () office ! kde ! org
[Download RAW message or body]

CVS commit by thorsen: 

Add a uidmap


  M +7 -0      resourcekolabbase.h   1.1.2.11
  M +29 -0     subresource.cpp   1.1.2.2
  M +30 -0     subresource.h   1.1.2.3


--- kdepim/kresources/kolab/shared/resourcekolabbase.h  #1.1.2.10:1.1.2.11
@@ -137,4 +137,11 @@ protected:
   bool mSilent;
 
+  /**
+   * This is used to store a mapping from the XML UID to the KMail
+   * serial number of the mail it's stored in. That provides a quick way
+   * to access the storage in KMail.
+   */
+  UidMap mUidMap;
+
 private:
   mutable KMailConnection* mConnection;

--- kdepim/kresources/kolab/shared/subresource.cpp  #1.1.2.1:1.1.2.2
@@ -85,2 +85,31 @@ int SubResource::completionWeight() cons
   return mCompletionWeight;
 }
+
+StorageReference::StorageReference( const QString& resource, Q_UINT32 sernum )
+  : mResource( resource ), mSerialNumber( sernum )
+{
+}
+
+StorageReference::~StorageReference()
+{
+}
+
+void StorageReference::setResource( const QString& resource )
+{
+  mResource = resource;
+}
+
+QString StorageReference::resource() const
+{
+  return mResource;
+}
+
+void StorageReference::setSerialNumber( Q_UINT32 serialNumber )
+{
+  mSerialNumber = serialNumber;
+}
+
+Q_UINT32 StorageReference::serialNumber() const
+{
+  return mSerialNumber;
+}

--- kdepim/kresources/kolab/shared/subresource.h  #1.1.2.2:1.1.2.3
@@ -40,4 +40,8 @@
 namespace Kolab {
 
+/**
+ * This class is used to store in a map from resource id to this, providing
+ * a lookup of the subresource settings.
+ */
 class SubResource {
 public:
@@ -75,4 +79,30 @@ private:
 typedef QMap<QString, SubResource> ResourceMap;
 
+/**
+ * This class is used to store a mapping from the XML UID to the KMail
+ * serial number of the mail it's stored in and the resource. That provides
+ * a quick way to access the storage in KMail.
+ */
+class StorageReference {
+public:
+  // Just for QMap
+  StorageReference() {}
+
+  StorageReference( const QString& resource, Q_UINT32 sernum );
+  virtual ~StorageReference();
+
+  virtual void setResource( const QString& resource );
+  virtual QString resource() const;
+
+  virtual void setSerialNumber( Q_UINT32 serialNumber );
+  virtual Q_UINT32 serialNumber() const;
+
+private:
+  QString mResource;
+  Q_UINT32 mSerialNumber;
+};
+
+typedef QMap<QString, StorageReference> UidMap;
+
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic