KConfig:copyTo + Sync doesn't write to disk (test case)

Oswald Buddenhagen ossi at kde.org
Tue Apr 8 14:10:04 BST 2008


On Tue, Apr 08, 2008 at 03:56:44AM -0600, Aaron J. Seigo wrote:
> --- kconfig.cpp	(revision 792053)
> +++ kconfig.cpp	(working copy)
> @@ -114,11 +114,12 @@
>  }
>  
>  void KConfigPrivate::copyGroup(const QByteArray& source, const QByteArray& destination,
> -                                KConfigGroup *otherGroup) const
> +                                KConfigGroup *otherGroup, KConfigBase::WriteConfigFlags flags) const
>  {
>      KEntryMap& otherMap = otherGroup->config()->d_ptr->entryMap;
>      const int len = source.length();
>      const bool sameName = (destination == source);
> +    bool dirtied = false;
>  
>      foreach (const KEntryKey& key, entryMap.keys()) {
>          const QByteArray& group = key.mGroup;
> @@ -138,7 +139,12 @@
>          KEntry entry = entryMap[key];
>          entry.bDirty = true;
>          otherMap[newKey] = entry;
> +        dirtied = true;
>      }
> +
> +    if (dirtied && flags & KConfigBase::Persistent) {
> +        otherGroup->config()->d_ptr->bDirty = true;
> +    }
>  }
>  
this logic makes no sense.

> @@ -138,7 +139,12 @@
>          KEntry entry = entryMap[key];
>          entry.bDirty = true;
d
>          otherMap[newKey] = entry;
> +        dirtied = true;
d
a
          entry.bDirty = flags & KConfigBase::Persistent;
          if (entry.bDirty) {
	      dirtied = true;
	  }

>      }
> +
> +    if (dirtied && flags & KConfigBase::Persistent) {
>
d
a
       if (dirtied) {

> +        otherGroup->config()->d_ptr->bDirty = true;
> +    }
>  }

... or something to that effect.

anyway, when you add the WriteConfigFlags param, you kinda promise to
implement the other two flags as well ...

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Confusion, chaos, panic - my work here is done.




More information about the kde-core-devel mailing list