Bug 41066 - Folder properties are not saved
Summary: Folder properties are not saved
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.4
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 46625 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-15 20:48 UTC by Andreas Zehender
Modified: 2007-09-14 12:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Zehender 2002-04-15 20:46:12 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kmail
Version:           1.4 (using KDE 3.0.0 )
Severity:          normal
Installed from:    SuSE
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:                Linux (i686) release 2.2.19
OS/Compiler notes: 

When I add folders with special characters ('[' and ']') the folder properties are not saved or restored correctly.

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Ingo Kl 2002-04-15 21:26:47 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 15 April 2002 22:46 zehender@kde.org wrote:
> When I add folders with special characters ('[' and ']') the folder
> properties are not saved or restored correctly.

This is most likely a bug in KConfig. It seems that KConfig has problems=20
with ']' in group names.

Regards
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD4DBQE8u0WXGnR+RTDgudgRAkRZAJjFlK0pfOaWH3iTqpd4086gUhFvAJ9kPmvv
O5vPe3cTb+VGqlcojYJTWw=3D=3D
=3DlNeZ
-----END PGP SIGNATURE-----
Comment 2 Ingo Kl 2002-04-15 22:29:12 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 15 April 2002 23:26 Ingo Kl=F6cker wrote:
> On Monday 15 April 2002 22:46 zehender@kde.org wrote:
> > When I add folders with special characters ('[' and ']') the
> > folder properties are not saved or restored correctly.
>
> This is most likely a bug in KConfig. It seems that KConfig has
> problems with ']' in group names.

According to Waldo brackets are not allowed in config group names. This=20
means we will either have to change the way we store information about=20
the folders (i.e. use [Folder-#1] instead of [Folder-inbox]) or we will=20
have to escape brackets in folder names e.g.
[  <->  %(
]  <->  %)
%  <->  %%

Regards
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8u1Q4GnR+RTDgudgRAld8AKCmI6+/6u2P4y+jGVa++ZmhbP/Y3ACeIEGB
N8AzBYvMko0eJVqQ1XaF4u0=3D
=3Dqz6i
-----END PGP SIGNATURE-----
Comment 3 Ingo Klöcker 2003-01-24 17:21:59 UTC
*** Bug 46625 has been marked as a duplicate of this bug. ***
Comment 4 Stephan Kulow 2003-09-24 16:57:17 UTC
loss of config data 
Comment 5 Till Adam 2003-10-03 16:52:52 UTC
CVS commit by tilladam:  
 
Escape [ and ] in folder names to %( and %) when queried via idString() 
because they are not allowed in kconfig section names. 
 
CCMAIL: 41066-done@bugs.kde.org 
 
 
  M +6 -1      kmfolder.cpp   1.284 
 
 
--- kdepim/kmail/kmfolder.cpp  #1.283:1.284 
@@ -899,5 +899,10 @@ QString KMFolder::idString() const 
   if (!relativePath.isEmpty()) 
     relativePath = relativePath.right( relativePath.length() - 1 ) + "/"; 
-  return relativePath + QString(name()); 
+  QString escapedName = QString( name() ); 
+  /* Escape [ and ] as they are disallowed for kconfig sections and that is 
+     what the idString is primarily used for. */ 
+  escapedName.replace( "[", "%(" ); 
+  escapedName.replace( "]", "%)" ); 
+  return relativePath + escapedName; 
 }