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

List:       kde-commits
Subject:    branches/work/kdepim-3.5.5+
From:       Allen Winter <winter () kde ! org>
Date:       2007-04-06 19:10:57
Message-ID: 1175886657.377433.25859.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 651164 by winterz:

merge SVN commit 651087 by dfaure:

Revert Till's commit r603692 in mimelib/entity.cpp, and add unit tests to show what \
it broke (Parse+Assemble on a mail with a part without headers loses a newline, so \
the signature is broken when copying a mail - aegypten issue734). I know now that \
this does NOT reintroduce issue661, "forwarding emails can produce bad signature", \
which is unrelated.

Also remove getMsgString from all folder classes, since it's now unused; getDwString \
is used instead.


 M  +11 -14    branches/work/kdepim-3.5.5+/kmail/folderstorage.h  
 M  +2 -7      branches/work/kdepim-3.5.5+/kmail/kmfolder.cpp  
 M  +0 -3      branches/work/kdepim-3.5.5+/kmail/kmfolder.h  
 M  +0 -23     branches/work/kdepim-3.5.5+/kmail/kmfoldermaildir.cpp  
 M  +1 -2      branches/work/kdepim-3.5.5+/kmail/kmfoldermaildir.h  
 M  +0 -23     branches/work/kdepim-3.5.5+/kmail/kmfoldermbox.cpp  
 M  +1 -2      branches/work/kdepim-3.5.5+/kmail/kmfoldermbox.h  
 M  +0 -7      branches/work/kdepim-3.5.5+/kmail/kmfoldersearch.cpp  
 M  +0 -1      branches/work/kdepim-3.5.5+/kmail/kmfoldersearch.h  
 M  +6 -8      branches/work/kdepim-3.5.5+/kmail/kmheaders.cpp  
 M  +12 -5     branches/work/kdepim-3.5.5+/kmail/tests/Makefile.am  
 A             branches/work/kdepim-3.5.5+/kmail/tests/mimelibtests.cpp   \
branches/KDE/3.5/kdepim/kmail/tests/mimelibtests.cpp#651087  A             \
branches/work/kdepim-3.5.5+/kmail/tests/mimelibtests.h   \
branches/KDE/3.5/kdepim/kmail/tests/mimelibtests.h#651087  A             \
branches/work/kdepim-3.5.5+/kmail/tests/multipartmixed.mbox   \
branches/KDE/3.5/kdepim/kmail/tests/multipartmixed.mbox#651087  A             \
branches/work/kdepim-3.5.5+/kmail/tests/signedmail.mbox   \
branches/KDE/3.5/kdepim/kmail/tests/signedmail.mbox#651087  M  +1 -2      \
branches/work/kdepim-3.5.5+/mimelib/entity.cpp  


--- branches/work/kdepim-3.5.5+/kmail/folderstorage.h #651163:651164
@@ -145,9 +145,6 @@
   */
   virtual KMMessage* readTemporaryMsg(int idx);
 
-  /** Read a message and return a referece to a string */
-  virtual QCString& getMsgString(int idx, QCString& mDest) = 0;
-
   /** Read a message and returns a DwString */
   virtual DwString getDwString(int idx) = 0;
 
@@ -200,9 +197,9 @@
     return addMsg(msg, index_return);
   }
 
-  /** 
-   * Adds the given messages to the folder. Behaviour is identical 
-   * to addMsg(msg) 
+  /**
+   * Adds the given messages to the folder. Behaviour is identical
+   * to addMsg(msg)
    */
   virtual int addMsg( QPtrList<KMMessage>&, QValueList<int>& index_return );
 
@@ -360,7 +357,7 @@
   virtual void setStatus(QValueList<int>& ids, KMMsgStatus status, bool \
toggle=false);  
   void removeJobs();
-  
+
   /** Escape a leading dot */
   static QString dotEscape(const QString&);
 
@@ -406,7 +403,7 @@
   virtual void search( const KMSearchPattern*, Q_UINT32 serNum );
 
   /** Returns true if this folder can be moved */
-  virtual bool isMoveable() const;  
+  virtual bool isMoveable() const;
 
 signals:
   /** Emitted when the status, name, or associated accounts of this
@@ -426,7 +423,7 @@
   
   /** Emitted when the serial numbers of this folder were invalidated. */
   void invalidated( KMFolder * );
-  
+
   /** Emitted when the name of the folder changes. */
   void nameChanged();
 
@@ -473,7 +470,7 @@
    * The matching serial numbers are included
    * If @p complete is true the search is done
    */
-  void searchResult( KMFolder*, QValueList<Q_UINT32>, 
+  void searchResult( KMFolder*, QValueList<Q_UINT32>,
                      const KMSearchPattern*, bool complete );
 
   /**
@@ -494,7 +491,7 @@
   /** Add a copy of the message to the folder after it has been retrieved
       from an IMAP server */
   virtual void reallyAddCopyOfMsg(KMMessage* aMsg);
-  
+
   /** Emit changed signal if mQuite <=0 */
   void slotEmitChangedTimer();
 
@@ -558,7 +555,7 @@
   /** Replaces the serial number for the message @p msg at index @p idx with
    * @p sernum */
   void replaceMsgSerNum( unsigned long sernum, KMMsgBase* msg, int idx );
-  
+
    /** Called when serial numbers for a folder are invalidated,
   invalidates/recreates data structures dependent on the
   serial numbers for this folder */
@@ -573,7 +570,7 @@
     At the time of the call the folder has already been closed, and
     the various index files deleted.  Returns 0 on success. */
   virtual int expungeContents() = 0;
-  
+
   /** Read index file and fill the message-info list mMsgList. */
   virtual bool readIndex() = 0;
   virtual KMMsgBase* takeIndexEntry( int idx ) = 0;
@@ -593,7 +590,7 @@
   bool mDirty :1;
   /** TRUE if the files of the folder are locked (writable) */
   bool mFilesLocked :1;
-  
+
   /** number of unread messages, -1 if not yet set */
   int mUnreadMsgs, mGuessedUnreadMsgs;
   int mTotalMsgs;
--- branches/work/kdepim-3.5.5+/kmail/kmfolder.cpp #651163:651164
@@ -321,11 +321,6 @@
   return mStorage->isMessage( idx );
 }
 
-QCString& KMFolder::getMsgString( int idx, QCString& mDest )
-{
-  return mStorage->getMsgString( idx,  mDest );
-}
-
 DwString KMFolder::getDwString( int idx )
 {
   return mStorage->getDwString( idx );
@@ -375,7 +370,7 @@
   return mStorage->take( idx );
 }
 
-void KMFolder::take( QPtrList<KMMessage> msgList )
+void KMFolder::take( QPtrList<KMMessage> msgList ) // TODO const ref
 {
   mStorage->take( msgList );
 }
@@ -405,7 +400,7 @@
   mStorage->removeMsg( i, imapQuiet );
 }
 
-void KMFolder::removeMsg( QPtrList<KMMessage> msgList, bool imapQuiet )
+void KMFolder::removeMsg( QPtrList<KMMessage> msgList, bool imapQuiet ) // TODO \
const ref  {
   mStorage->removeMsg( msgList, imapQuiet );
 }
--- branches/work/kdepim-3.5.5+/kmail/kmfolder.h #651163:651164
@@ -183,9 +183,6 @@
   /** Checks if the message is already "gotten" with getMsg */
   bool isMessage(int idx);
 
-  /** Read a message and return a referece to a string */
-  QCString& getMsgString(int idx, QCString& mDest);
-
   /** Read a message and returns a DwString */
   DwString getDwString(int idx);
 
--- branches/work/kdepim-3.5.5+/kmail/kmfoldermaildir.cpp #651163:651164
@@ -593,29 +593,6 @@
 }
 
 
-QCString& KMFolderMaildir::getMsgString(int idx, QCString& mDest)
-{
-  KMMsgInfo* mi = (KMMsgInfo*)mMsgList[idx];
-
-  assert(mi!=0);
-
-  QString abs_file(location() + "/cur/");
-  abs_file += mi->fileName();
-
-  if (QFile::exists(abs_file) == false)
-  {
-    kdDebug(5006) << "The " << abs_file << " file doesn't exist!" << endl;
-    return mDest;
-  }
-
-  QFileInfo fi( abs_file );
-  mDest.resize(fi.size()+2);
-  mDest = KPIM::kFileToString(abs_file, false, false);
-  size_t newMsgSize = KMail::Util::crlf2lf( mDest.data(), fi.size() );
-  mDest[newMsgSize] = '\0';
-  return mDest;
-}
-
 void KMFolderMaildir::readFileHeaderIntern(const QString& dir, const QString& file, \
KMMsgStatus status)  {
   // we keep our current directory to restore it later
--- branches/work/kdepim-3.5.5+/kmail/kmfoldermaildir.h #651163:651164
@@ -28,8 +28,7 @@
   /** Returns the type of this folder */
   virtual KMFolderType folderType() const { return KMFolderTypeMaildir; }
 
-  /** Read a message and return a referece to a string */
-  virtual QCString& getMsgString(int idx, QCString& mDest);
+  /** Read a message and return it as a string */
   virtual DwString getDwString(int idx);
 
   /** Detach message from this folder. Usable to call addMsg() afterwards.
--- branches/work/kdepim-3.5.5+/kmail/kmfoldermbox.cpp #651163:651164
@@ -916,29 +916,6 @@
 #undef STRDIM
 
 //-----------------------------------------------------------------------------
-QCString& KMFolderMbox::getMsgString(int idx, QCString &mDest)
-{
-  unsigned long msgSize;
-  KMMsgInfo* mi = (KMMsgInfo*)mMsgList[idx];
-
-  assert(mi!=0);
-  assert(mStream != 0);
-
-  msgSize = mi->msgSize();
-  mDest.resize(msgSize+2);
-
-  fseek(mStream, mi->folderOffset(), SEEK_SET);
-  fread(mDest.data(), msgSize, 1, mStream);
-  mDest[msgSize] = '\0';
-
-  size_t newMsgSize = unescapeFrom( mDest.data(), msgSize );
-  newMsgSize = KMail::Util::crlf2lf( mDest.data(), newMsgSize );
-
-  return mDest;
-}
-
-
-//-----------------------------------------------------------------------------
 DwString KMFolderMbox::getDwString(int idx)
 {
   KMMsgInfo* mi = (KMMsgInfo*)mMsgList[idx];
--- branches/work/kdepim-3.5.5+/kmail/kmfoldermbox.h #651163:651164
@@ -60,8 +60,7 @@
   /** Returns the type of this folder */
   virtual KMFolderType folderType() const { return KMFolderTypeMbox; }
 
-  /** Read a message and return a referece to a string */
-  virtual QCString& getMsgString(int idx, QCString& mDest);
+  /** Read a message and return it as a string */
   DwString getDwString(int idx);
 
   /** Add the given message to the folder. Usually the message
--- branches/work/kdepim-3.5.5+/kmail/kmfoldersearch.cpp #651163:651164
@@ -486,13 +486,6 @@
     }
 }
 
-QCString& KMFolderSearch::getMsgString(int idx, QCString& mDest)
-{
-    KMFolder *folder = getMsgBase(idx)->parent();
-    assert(folder);
-    return folder->getMsgString(folder->find(getMsgBase(idx)), mDest);
-}
-
 int KMFolderSearch::addMsg(KMMessage*, int* index_return)
 {
     //Not supported search folder can't own messages
--- branches/work/kdepim-3.5.5+/kmail/kmfoldersearch.h #651163:651164
@@ -169,7 +169,6 @@
 
 public:
   //See base class for documentation
-  virtual QCString& getMsgString(int idx, QCString& mDest);
   virtual int addMsg(KMMessage* msg, int* index_return = 0);
   virtual int open(const char *owner);
   virtual int canAccess();
--- branches/work/kdepim-3.5.5+/kmail/kmheaders.cpp #651163:651164
@@ -2075,20 +2075,18 @@
   }
 
   int idx = item->msgId();
-  if (mReaderWindowActive) {
-    KMMessage *msg = mFolder->getMsg(idx);
-    if (!msg ) {
-      emit selected( 0 );
-      mPrevCurrent = 0;
-      return;
-    }
+  KMMessage *msg = mFolder->getMsg(idx);
+  if (mReaderWindowActive && !msg) {
+    emit selected( 0 );
+    mPrevCurrent = 0;
+    return;
   }
 
   BroadcastStatus::instance()->setStatusMsg("");
   if (markitread && idx >= 0) setMsgRead(idx);
   mItems[idx]->irefresh();
   mItems[idx]->repaint();
-  emit selected( mFolder->getMsg(idx) );
+  emit selected( msg );
   setFolderInfoStatus();
 }
 
--- branches/work/kdepim-3.5.5+/kmail/tests/Makefile.am #651163:651164
@@ -1,13 +1,20 @@
 INCLUDES = -I$(top_srcdir)/kmail $(all_includes)
+AM_CPPFLAGS = -DKDESRCDIR=\"$(srcdir)\"
 METASOURCES = AUTO
 
-check_LTLIBRARIES = libkunittest_storagelayermodule.la \
-        libkunittest_utilmodule.la
+check_LTLIBRARIES = kunittest_storagelayermodule.la \
+        kunittest_utilmodule.la \
+        kunittest_mimelibmodule.la
 
-libkunittest_storagelayermodule_la_SOURCES = storagelayermodule.cpp \
                messagedicttests.cpp ../kmdict.cpp
-libkunittest_utilmodule_la_SOURCES = utiltests.cpp ../util.cpp
-libkunittest_utilmodule_la_LIBADD = -lkunittest ../../mimelib/libmimelib.la
+kunittest_storagelayermodule_la_SOURCES = storagelayermodule.cpp \
messagedicttests.cpp ../kmdict.cpp +kunittest_utilmodule_la_SOURCES = utiltests.cpp \
../util.cpp +kunittest_utilmodule_la_LIBADD = -lkunittest ../../mimelib/libmimelib.la
+kunittest_mimelibmodule_la_SOURCES = mimelibtests.cpp ../util.cpp
+kunittest_mimelibmodule_la_LIBADD = -lkunittest ../../mimelib/libmimelib.la
 
+LIBADD = -lkunittest
+LDFLAGS = -module $(KDE_CHECK_PLUGIN) $(all_libraries)
+
 check-local:
 	kunittestmodrunner
 
--- branches/work/kdepim-3.5.5+/mimelib/entity.cpp #651163:651164
@@ -222,8 +222,7 @@
     // DwEntityParser skips the line separating the headers from the
     // body. So it's neither part of DwHeaders, nor of DwBody
     // -> we need to readd it here:
-    if ( mString != "" )
-      mString += DW_EOL;
+    mString += DW_EOL;
 
     mString += aBody.AsString();
     mIsModified = 0;


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

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