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

List:       kmail-devel
Subject:    [PATCH] fix non latin1 folder name handling
From:       Toshitaka Fujioka <toshitaka () crux ! ocn ! ne ! jp>
Date:       2004-02-28 18:51:29
Message-ID: 200402290351.29227.toshitaka () crux ! ocn ! ne ! jp
[Download RAW message or body]

Hello,

Current CVS HEAD's kmail can not use non latin1 folder name, correctly.
eg. dose not work file in to folder filter action

The attached patch is fix this problem.
Please review.

I'll commit this patch, if anyone has no objection.

Regards,
Toshitaka

 



["kdepim-kmail-fixNonLatin1FolderNameHandling-20040229.diff" (text/x-diff)]

? kdepim-kmail-fixNonLatin1FolderNameHandling-20040229.diff
Index: folderstorage.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/folderstorage.cpp,v
retrieving revision 1.13
diff -u -3 -d -p -r1.13 folderstorage.cpp
--- folderstorage.cpp	26 Feb 2004 11:56:32 -0000	1.13
+++ folderstorage.cpp	28 Feb 2004 18:31:32 -0000
@@ -709,7 +709,7 @@ QString FolderStorage::label() const
   if ( folder() && folder()->isSystemFolder() && !mLabel.isEmpty() ) 
      return mLabel;
   if ( folder() && folder()->isSystemFolder() ) 
-     return i18n( folder()->name().latin1() );
+    return folder()->name();
   return mFolder->name();
 }
 
@@ -789,7 +789,7 @@ QString FolderStorage::idString() const
   QString relativePath = folder()->path().right( pathLen );
   if (!relativePath.isEmpty())
     relativePath = relativePath.right( relativePath.length() - 1 ) + "/";
-  QString escapedName = QString( name() );
+  QString escapedName = QString::fromLocal8Bit( name() );
   /* Escape [ and ] as they are disallowed for kconfig sections and that is
      what the idString is primarily used for. */
   escapedName.replace( "[", "%(" );
Index: kmfolder.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmfolder.cpp,v
retrieving revision 1.310
diff -u -3 -d -p -r1.310 kmfolder.cpp
--- kmfolder.cpp	26 Feb 2004 11:56:32 -0000	1.310
+++ kmfolder.cpp	28 Feb 2004 18:31:32 -0000
@@ -34,15 +34,15 @@ KMFolder::KMFolder( KMFolderDir* aParent
     mUseCustomIcons( false ), mMailingListEnabled( false )
 {
   if( aFolderType == KMFolderTypeCachedImap )
-    mStorage = new KMFolderCachedImap( this, aFolderName.latin1() );
+    mStorage = new KMFolderCachedImap( this, aFolderName.local8Bit().data() );
   else if( aFolderType == KMFolderTypeImap )
-    mStorage = new KMFolderImap( this, aFolderName.latin1() );
+    mStorage = new KMFolderImap( this, aFolderName.local8Bit().data() );
   else if( aFolderType == KMFolderTypeMaildir )
-    mStorage = new KMFolderMaildir( this, aFolderName.latin1() );
+    mStorage = new KMFolderMaildir( this, aFolderName.local8Bit().data() );
   else if( aFolderType == KMFolderTypeSearch )
-    mStorage = new KMFolderSearch( this, aFolderName.latin1() );
+    mStorage = new KMFolderSearch( this, aFolderName.local8Bit().data() );
   else
-    mStorage = new KMFolderMbox( this, aFolderName.latin1() );
+    mStorage = new KMFolderMbox( this, aFolderName.local8Bit().data() );
 
   if ( aParent ) {
     connect( mStorage, SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ),


_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


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

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