A list of the attachments in messages

I try to get the list of attachments of a message to filter on the type of file. I get a searchlocal messages:

const QList messages = m_messageService->searchLocal(m_currentAccount.id(), filter);

foreach (const Message &message, messages) {
    // Copy the data into a model entry
        bool keep = false;
    //check attachment
    QList< bb::pim::message::Attachment > attachments = message.attachments();
    foreach(const Attachment &attachment, attachments ) {        if (attachment.name().endsWith(theSuffix)) {            keep=true;            break;        } 
        qDebug() << "attachment : " << attachment.name();
    }
    qDebug() << "== End Attachments ==";
    // Add the entry to the model
    if (keep)        m_model->insert(entry);
}

It's that the attachments are not visible, as if each message has no attachments.

I use the same method of closure on attachments retrieved with attachments() in another part of my code and there is no problem here. What I'm doing wrong here?

I found out what was the problem - I need to extract every message individually to:

    foreach (const Message &message, messages) {

        const Message messageDetail = m_messageService->message(m_currentAccount.id(),message.id());
        QList< bb::pim::message::Attachment > attachments = messageDetail.attachments();

        bool keep = false;
        foreach(const Attachment &attachment, attachments ) {
            qDebug() << "attachment : " << attachment.name();
            if (attachment.name().endsWith(theSuffix)) {
                keep = true;
                break;
            }
        }

        if (keep) {
            // Copy the data into a model entry
            QVariantMap entry;
            entry["messageId"] = message.id();
            entry["subject"] = message.subject();
            entry["time"] = message.serverTimestamp().toString();

            // Add the entry to the model
            if (keep)
                m_model->insert(entry);
        }
    }

The strange thing is that in both cases, the Message class has been used, makes me think that there is a problem with how the MessageService them fills in the QList it returns.

Tags: BlackBerry Developers

Similar Questions

  • How can I control the list of the available in the message SSL Client Hello cipher suites? I want to ban the MD5 and RC4.

    How can I control the list of the available in the message SSL Client Hello cipher suites?
    I want to limit my browser to negotiate the cipher suites fort. I would like to prohibit, MD5 and RC4.

    Set the SSL3 preferences related to false on the subject: config page (filter: security.ssl3.).

  • Error message of Microsoft Visual C++ Runtime Library without program listed as the source of the error.

    I have a Microsoft Visual C++ Runtime Library error message, but no program is listed as the source of the error... the only entry is "program: C:\...» ».   I am running XP Service Pack 3 on a HP Mini.  HP support center suggests that a driver is not loaded, or is corrupt and suggests also that I have to reinstall the program.  It is impossible, however, if the program in question cannot be determined.  Any advice?

    What is your system brand and model (mini HP something)?

    Describe your current antivirus and software anti malware situation: McAfee, Symantec, Norton, Spybot, AVG, Avira!, MSE, Panda, Trend Micro, CA, Defender, ZoneAlarm, PC Tools, Comodo, etc..

    The question was preceded by a loss of power, aborted reboot or abnormal termination?  (this includes the plug pulling, buttons power, remove the battery, etc.)

    If the system works, what do you think might have changed since the last time it did not work properly?

    When is it and what you do when you see this message?

    You see it every time the system starts or when you try to start a program?

    There may be some clues in the event where log Viewer, but has first:

    Microsoft offers several different versions of the Microsoft Visual C++ distributables.

    For their need for some of your applications or make install does not mean that you will make any C++ programming, but some applications need some of the runtime components and libraries installed with just distribution C++ files (it is not the whole development package).

    It is also possible to have multiple versions of the distributables C++ installed on your system - I installed 7, but you do not have to many.  Different programs that you install may require different sets of files to work.

    Take a look in Add/Remove programs and see what, if any, versions of Microsoft C++ Redistributables you have installed right now.

    The latest version is the version of Microsoft Visual C++ 2010, so if you don't have that, I would start by download and install from here:

    http://www.Microsoft.com/download/en/details.aspx?ID=8328 (this is the 32-bit version)

    If you see already that you have version 2010 installed in Add/Remove Programs, just uninstall it, reboot and reinstall it from the download, then view the side of things.

    Always restart after installing new software because that will eliminate the stupid question "did you restart your system" could happen later...

  • I often receive an email containing more than 10 images, but when I get this message, I can't as a pop up comes up and tells me that I must remove some of the attachments.

    I often receive an email that contains more than 10 images (attachments) but when I get this message, I can't as a pop up comes up and tells me that I must remove some of the attachments that would destroy a part of the message.  What should I do to correct this?

    The images may be too large to send massively as they must be encoded to send by e-mail, and this coding can add as much as 40% of the size of the message.  You can resize to fit the web by reducing their dots per inch to 96 (screen resolution) and then saving them as a compressed jpeg files.  IrfanView (www.irfanview.com - free) will do this for you.

    You can also try Message | To send as an attachment and see if it goes through.

    Steve

  • How can Windows Vista - windows mail - I separate list of the messages in the preview pane. When I open windows mail I just want to see the list of messages.

    Hello:

    How can Windows Vista - windows mail - I separate list of the messages in the preview pane. When I open windows mail I just want to see the list of messages.

    now I'm seening messages and preview list in the same window w / a separator between list pane and preview of the message.

    Ty

    View | Layout and uncheck the preview pane. You can also set the preview pane button in the toolbar if you wish.

  • The progress bar just kept scanning without generating a list of updates or error messages

    I have a hp G70-463 CL portable 2009. It works well until March 2016 when it could not download updates Windows 7 Ultimate. The progress bar just kept scanning without generating a list of updates or error messages. I reinstalled Windows, but this does not solve the problem. The PC otherwise works fine. I can download the software successfully. What is going on?

    You can reset the Windows Update components by running the Fixit on this page. But if there is malware present, she will continue to reset the connection to the update servers:

    How to reset the Windows Update components

    http://support.Microsoft.com/kb/971058

    Suggest you download and save the Fixit. Then configure the system before the clean boot by running:

    How to troubleshoot a problem by performing a clean boot in Windows Vista/Windows 7

    http://support.Microsoft.com/kb/929135

    Once the Fixit has been downloaded and the system is started in the pure State, check that the native Windows Firewall is now on if a 3rd party firewall has been used previously. Now run the Fixit and choose the default mode. Restart once it's done and see if the system can be connected to the update servers. If he can't, then rerun the Fixit and choose aggressive mode. Turn it back on when he finished the race and updates.

    I suggest before you stop and install the updates, disconnect from the Internet, first.

  • BlackBerry smartphones can not see the list of the entire message when I opened the messages icon.

    I used to be able to see a combined list of my emails, texts SMS, missed calls, voice messages and anything else when I open Message folder icon on my Blackberry Curve 8330 office, but now when I open it, all I get is a blank white screen.  When I hit the menu button, the menu appears without a problem and if I click on the trackball, it will open a message, but I do not see the list itself.

    Also, when I go to view the folder I can access an individual folder and they come very well.  The only problem is the list of the combined messages that you are supposed to get when you open the icon on the desktop (or the application menu).

    Could someone help me please

    First thing... do a reboot simple: with the BlackBerry device powered on, remove the battery a few seconds and then reinsert the battery to restart.

    Now, that is the visible screen?

  • Cannot use PS CC get this message on macbook air you run an operating system that Photoshop can't stand anymore. See the system requirements for a complete list of the supported platforms.

    get this message

    You are running an operating system that Photoshop no longer supports. See the system requirements for a complete list of the supported platforms.

    Hello

    Please see the system requirements for photoshop: -.

    Configuration of Photoshop

  • Message box in function that returns a list deletes the created list... (Dialog box)

    Hello

    I work with a complex dialogue, its purpose is to manage a section in the PDF file.

    I use a "mclv" object in the dialog box to represent data entries in the PDF file in order to manage the result in another section.

    I created a function that creates the list based on a previous section in the PDF object, the function works perfectly well.

    But I have a small question, the function used to create the list of the dialog box object performs a check with the former front list created, as appropriate,

    and if in any case it is different from the old list, I need to warn the user that the list has changed and if there were any changes applied to the result it will be returned to zero and must be recreated.

    But when the poping that message box, all lists are deleted and nothing is displayed in the objects 'mclv.

    If I remove the message box, the lists are all very well...

    Is there anyone who have come across something like this before? If so, any solution to this problem?

    I asked my question a bit too quickly, I already found a work around

    But I still don't understand why he behaves like that tho...

    I just thought how to work around this problem.

    If anyone has encountered this problem can use this solution:

    Instead of having the message inside the function to return box, I declared a global Boolean variable to the Script object

    If the message box must be displayed, the Boolean value is set to True

    Once in the initialize event of the dialog box, if the value Boolean true I call the message box and reset the value Boolean false

  • Ribbon of PDF for printing of the Outlook Messages that retain active hyperlinks to the attachments

    Office in particular Outlook 2013, 2013, lost the PDF Ribbon - used to be able to print e-mails in PDF format, including attachments - and Acrobat X Standard would leave hyperlinks in the e-mail message to registered PDF attachments.  We could open the files of registered attachment directly from the registered email.  This feature is now gone.  Acrobat Standard XI restores this feature?  What version of DC of 2015?

    The problem is that each version of Acrobat must be customized by Adobe in interface with new versions of Outlook. Interfaces and formats (not PDF format) changes.

    Acrobat 10 support Office 2010 which was in force at the time Acrobat 10 was the current version of Acrobat. Acrobat 11 support added for office 2013 / Office 365. DC of Acrobat supports Office 2010 and 2013 office / Office 365 and, likely, the next version of Office when released.

    -Dov

  • Why do I get a message saying 'you are running an operating system that InDesign can't. See the system requirements for a complete list of the supported platforms. » ? What does that mean?

    Why do I get a message saying 'you are running an operating system that InDesign can't. See the system requirements for a complete list of the supported platforms. » ? What does that mean?

    This means that your machine does not meet the requirements of system for InDesign.  Check the system requirements for InDesign against those of your machine to see where your machine is delivered in default.

    InDesign - http://helpx.adobe.com/indesign/system-requirements.html

  • Received the following message when you try to install Photoshop CC "you run an operating system that Photoshop no longer supports. See the system requirements for a complete list of the supported platforms. "So I use Windows Vista not sure do I

    Hello

    I received the following message when you try to install Photoshop CC, "you run an operating system that Photoshop no longer supports. See the system requirements for a complete list of the supported platforms. »

    I use Windows Vista so not sure what to do now! Any help would be greatly appreciated thanks.

    CC of Photoshop only works on Windows 7 or Windows 8/8.1. No Vista.

    System requirements | Photoshop

  • Thunderbird seems to be corrupted, with a wide range of problems (e-mail folder does not open it, names of the attachments not displayed,...) CAUSE: McAfee Antivirus

    Problems include:

    • By clicking on an e-mail folder does not open it - open in new tab works
    • Names of the attachments are not displayed. Clinkg on the trombone does not open them. "Open all the ' works
    • Sometimes, if I click on an email in the message (?), disappeafrs message pane, and then as I move the cursor to the bottom of the list, they all disappear

    I have restored my pc (Win 8), performed drive controls, run Malwarebytes and virus checks and found nothing.
    I've uninstalled and reinstalled TB several times without success.

    Stuck!

    • First of all I would like to get rid of McAffe. ALTOGETHER. Personally I don't like, but mostly because that its been the center of TB problems.
    • Then download and use MozBackup to save your settings.
    • Copy %appdata%\thunderbird\profiles somewhere for additional security.
    • Remove the data (% appdata%\thunderbird) and tuberculosis
    • Mozbackup allows you to import your settings.
  • TB 31.7 W7, how can I change the police in the "all folders" list on the left?

    TB 31.7 on W7
    How can I change the police in the "all folders" list on the left?

    I was also unable to change the position of the icons on the e-mail toolbar in a message window. When I try to drag a box icon from the tool bar customize I get a symbol of the circle with a line through it, rather than the vertical bar I expect.

    Something like that?

    http://forums.mozillazine.org/viewtopic.php?f=30 & t = 2834207

    Note that the name of the folder and the name are case-sensitive. It must be userChrome.css and it must be placed in a folder named chrome.

    Finittary poster regularly wrote something about this recently. It may be possible to find this thread on this forum.

    The inability to drag or move a button usually means that you have opened the pane customization evil.

  • Why Thunderbird 38.1 suddenly treat the addresses of the list in the form of individual addresses, &amp; dismiss them because they are not in the form user@url?

    When you try to send a message to a group set up in my address book, I get an error message [group name < updated the group description >] is not an email address valid because it is not the form user@host. You need to correct before sending the e-mail message. Thunderbird has apparently taken the description section and tried to treat it as an email address. In doing so, it changes the description of and the original format [names, name2, name 3] (with the exception of the hooks) of [< name >, name2, "name 3" >].

    The list of mail has worked with no problems until today.

    Zenos. thanks for the suggestion. Although he did not provide a direct solution, he pointed me a. Being reluctant to try to re-enter an address book with more than 1,000 entries, I saved the book and replaced by a backup copy of a computer when I heard the e-mail function worked as desired. I had the same problem.
    I tried to export the book to save what I could at least and ran into problems, I discovered since came from trying to export "all address books.
    Then, I opened a copy of AB. File MAB in Quattro Pro, where I noted PS split the description section of the list of mail problem in separate cells, from commas in this description. I went back to the address book, removed commas from the description, and my group e-mail went out as gently as might be desired.
    I would note that commas have been this likely description for 15 years or more and only now has caused a problem. I guess that's due to some changes in Thunderbird was last updated. Would be nice if we got warnings about this kind of change.
    Answer to my problem: remove the commas from the description in the properties of the list.

Maybe you are looking for