emailuis/nmailui/src/nmattachmentlist.cpp
changeset 47 f83bd4ae1fe3
parent 44 c2d07d913565
equal deleted inserted replaced
45:780f926bc26c 47:f83bd4ae1fe3
    35     Destructor
    35     Destructor
    36 */
    36 */
    37 NmAttachmentList::~NmAttachmentList()
    37 NmAttachmentList::~NmAttachmentList()
    38 { 
    38 { 
    39     NM_FUNCTION;
    39     NM_FUNCTION;
    40     
    40 }
    41     clearList();
    41 
    42 }
    42 /*!
    43 
    43     Insert new list item. Returns the index of the attachment in list
    44 /*!
       
    45     Insert new list item. Returns the count of the attachment in list
       
    46 */
    44 */
    47 int NmAttachmentList::insertAttachment(
    45 int NmAttachmentList::insertAttachment(
    48     const QString &fullFileName,
    46     const QString &fullFileName,
    49     const QString &fileSize,
    47     const QString &fileSize,
    50     const NmId &attachmentPartId)
    48     const NmId &attachmentPartId)
    93         }
    91         }
    94     }
    92     }
    95 }
    93 }
    96 
    94 
    97 /*!
    95 /*!
    98     Remove attachment from list position
    96     Removes attachment from list position
    99 */
    97 */
   100 void NmAttachmentList::removeAttachment(int arrayIndex)
    98 void NmAttachmentList::removeAttachment(int arrayIndex)
   101 {
    99 {
   102     NM_FUNCTION;
   100     NM_FUNCTION;
   103     
   101     
   104     if (arrayIndex < count()) {
   102     if (arrayIndex < count() && 
       
   103         arrayIndex >= 0 ) {
   105         // Remove UI
   104         // Remove UI
   106         mListWidget.removeAttachment(arrayIndex);
   105         mListWidget.removeAttachment(arrayIndex);
   107         // Remove from data structure
   106         // Remove from data structure
   108         mFullFileName.removeAt(arrayIndex);
   107         mFullFileName.removeAt(arrayIndex);
   109         mDisplayFileName.removeAt(arrayIndex);
   108         mDisplayFileName.removeAt(arrayIndex);