I have made the following changes intended for : CE:MW:Shared / nemo-qml-plugins
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.pub.meego.com//request/show/7534 Thank You, vdvsx [This message was auto-generated] --- Request # 7534: Messages from BOSS: State: review at 2012-12-13T13:03:34 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:vdvsx:branches:CE:MW:Shared / nemo-qml-plugins -> CE:MW:Shared / nemo-qml-plugins changes files: -------------- --- nemo-qml-plugins.changes +++ nemo-qml-plugins.changes @@ -0,0 +1,7 @@ +* Thu Dec 13 2012 Valerio Valerio <[email protected]> - 0.1.8 +- Add retrieveFolderList binding. (By Valerio Valerio) +- Add message preview role to messageList model. (By Valerio Valerio) +- Add last LastSynchronized role to accountslist model. (By Valerio Valerio) +- Add retrieveMessageList binding. (By Valerio Valerio) +- Check validity of mItem in setValue() before using it. (by Bea Lam) + old: ---- nemo-qml-plugins-0.1.7.tar.bz2 new: ---- nemo-qml-plugins-0.1.8.tar.bz2 spec files: ----------- --- nemo-qml-plugins.spec +++ nemo-qml-plugins.spec @@ -9,7 +9,7 @@ # << macros Summary: Nemo QML plugins source package. -Version: 0.1.7 +Version: 0.1.8 Release: 1 Group: System/Libraries License: BSD other changes: -------------- ++++++ nemo-qml-plugins-0.1.7.tar.bz2 -> nemo-qml-plugins-0.1.8.tar.bz2 --- configuration/configurationvalue.cpp +++ configuration/configurationvalue.cpp @@ -80,7 +80,8 @@ void ConfigurationValue::setValue(const QVariant &value) { - mItem->set(value); // TODO: setValue once we change MGConfItem API + if (mItem) + mItem->set(value); // TODO: setValue once we change MGConfItem API // MGConfItem will emit valueChanged for us } --- email/src/emailaccount.h +++ email/src/emailaccount.h @@ -1,5 +1,6 @@ /* * Copyright 2011 Intel Corporation. + * Copyright (C) 2012 Jolla Ltd. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at --- email/src/emailaccountlistmodel.cpp +++ email/src/emailaccountlistmodel.cpp @@ -1,5 +1,6 @@ /* * Copyright 2011 Intel Corporation. + * Copyright (C) 2012 Jolla Ltd. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at @@ -22,6 +23,7 @@ roles.insert(MailServer, "mailServer"); roles.insert(UnreadCount, "unreadCount"); roles.insert(MailAccountId, "mailAccountId"); + roles.insert(LastSynchronized, "lastSynchronized"); setRoleNames(roles); connect (QMailStore::instance(), SIGNAL(accountsAdded(const QMailAccountIdList &)), this, @@ -83,6 +85,10 @@ return accountId; } + if(role == LastSynchronized) { + return account.lastSynchronized().toLocalTime(); + } + return QVariant(); } --- email/src/emailaccountlistmodel.h +++ email/src/emailaccountlistmodel.h @@ -1,5 +1,6 @@ /* * Copyright 2011 Intel Corporation. + * Copyright (C) 2012 Jolla Ltd. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at @@ -28,7 +29,8 @@ MailServer = Qt::UserRole + 6, UnreadCount = Qt::UserRole + 7, MailAccountId = Qt::UserRole + 8, - Index = Qt::UserRole + 9, + LastSynchronized = Qt::UserRole + 9, + Index = Qt::UserRole + 10 }; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; --- email/src/emailagent.cpp +++ email/src/emailagent.cpp @@ -1,5 +1,6 @@ /* * Copyright 2011 Intel Corporation. + * Copyright (C) 2012 Jolla Ltd. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at @@ -143,7 +144,7 @@ emit messagesDeleted(ids); } -void EmailAgent::createFolder (const QString &name, QVariant mailAccountId, QVariant parentFolderId) +void EmailAgent::createFolder(const QString &name, QVariant mailAccountId, QVariant parentFolderId) { Q_ASSERT(!name.isEmpty()); @@ -175,6 +176,19 @@ m_storageAction->onlineRenameFolder(id, name); } +void EmailAgent::retrieveFolderList(QVariant accountId, QVariant folderId, bool descending) +{ + QMailAccountId acctId = accountId.value<QMailAccountId>(); + QMailFolderId foldId = folderId.value<QMailFolderId>(); + + if (!isSynchronizing() && acctId.isValid()) { + emit syncBegin(); + m_cancelling = false; + m_retrieving = true; + m_retrievalAction->retrieveFolderList(acctId, foldId, descending); + } +} + void EmailAgent::synchronize(QVariant id) { QMailAccountId accountId = id.value<QMailAccountId>(); @@ -183,11 +197,23 @@ emit syncBegin(); m_cancelling = false; m_retrieving = true; - //m_retrievalAction->retrieveAll(accountId); m_retrievalAction->synchronize(accountId, 20); } } +void EmailAgent::retrieveMessageList(QVariant accountId, QVariant folderId, uint minimum) +{ + QMailAccountId acctId = accountId.value<QMailAccountId>(); + QMailFolderId foldId = folderId.value<QMailFolderId>(); + + if (!isSynchronizing() && acctId.isValid()) { + emit syncBegin(); + m_cancelling = false; + m_retrieving = true; + m_retrievalAction->retrieveMessageList(acctId, foldId, minimum); + } +} + void EmailAgent::getMoreMessages(QVariant vFolderId) { QMailFolderId folderId = vFolderId.value<QMailFolderId>(); @@ -261,6 +287,7 @@ } if (!isSynchronizing()) { + qDebug() << "Sync completed."; emit syncCompleted(); } --- email/src/emailagent.h +++ email/src/emailagent.h @@ -40,16 +40,18 @@ Q_INVOKABLE void accountsSync(); Q_INVOKABLE void deleteMessage(QVariant id); Q_INVOKABLE void deleteMessages(const QMailMessageIdList &ids); - Q_INVOKABLE void createFolder (const QString &name, QVariant vMailAccountId, QVariant vParentFolderId); + Q_INVOKABLE void createFolder(const QString &name, QVariant vMailAccountId, QVariant vParentFolderId); Q_INVOKABLE void deleteFolder(QVariant vFolderId); Q_INVOKABLE void renameFolder(QVariant vFolderId, const QString &name); - Q_INVOKABLE void synchronize (QVariant vMailAccountId); - Q_INVOKABLE void cancelSync (); - Q_INVOKABLE void markMessageAsRead (QVariant vMsgId); - Q_INVOKABLE void markMessageAsUnread (QVariant vMsgId); - Q_INVOKABLE void getMoreMessages (QVariant vFolderId); - Q_INVOKABLE QString getSignatureForAccount (QVariant vMailAccountId); - Q_INVOKABLE bool confirmDeleteMail (); + Q_INVOKABLE void retrieveFolderList(QVariant vMailAccountId, QVariant vFolderId = 0, bool descending = true); + Q_INVOKABLE void synchronize(QVariant vMailAccountId); + Q_INVOKABLE void retrieveMessageList(QVariant vMailAccountId, QVariant vFolderId, uint minimum = 0); + Q_INVOKABLE void cancelSync(); + Q_INVOKABLE void markMessageAsRead(QVariant vMsgId); + Q_INVOKABLE void markMessageAsUnread(QVariant vMsgId); + Q_INVOKABLE void getMoreMessages(QVariant vFolderId); + Q_INVOKABLE QString getSignatureForAccount(QVariant vMailAccountId); + Q_INVOKABLE bool confirmDeleteMail(); Q_INVOKABLE void downloadAttachment(QVariant vMailMessage, const QString& attachmentDisplayName); Q_INVOKABLE bool openAttachment(const QString& attachmentDisplayName); Q_INVOKABLE void openBrowser(const QString& url); --- email/src/emailmessagelistmodel.cpp +++ email/src/emailmessagelistmodel.cpp @@ -1,5 +1,6 @@ /* * Copyright 2011 Intel Corporation. + * Copyright (C) 2012 Jolla Ltd. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at @@ -79,6 +80,7 @@ roles[MessageBccRole] = "bcc"; roles[MessageTimeStampRole] = "qDateTime"; roles[MessageSelectModeRole] = "selected"; + roles[MessagePreviewRole] = "preview"; setRoleNames(roles); initMailServer(); @@ -109,15 +111,14 @@ return QVariant(); QMailMessageId msgId = idFromIndex(index); + QMailMessageMetaData messageMetaData(msgId); if (role == QMailMessageModelBase::MessageTimeStampTextRole) { - QMailMessageMetaData message(msgId); - QDateTime timeStamp = message.date().toLocalTime(); + QDateTime timeStamp = messageMetaData.date().toLocalTime(); return (timeStamp.toString("hh:mm MM/dd/yyyy")); } else if (role == MessageAttachmentCountRole) { // return number of attachments - QMailMessageMetaData messageMetaData(msgId); if (!messageMetaData.status() & QMailMessageMetaData::HasAttachments) return 0; @@ -127,7 +128,6 @@ } else if (role == MessageAttachmentsRole) { // return a stringlist of attachments - QMailMessageMetaData messageMetaData(msgId); if (!messageMetaData.status() & QMailMessageMetaData::HasAttachments) return QStringList(); @@ -140,7 +140,6 @@ return attachments; } else if (role == MessageRecipientsRole) { - QMailMessageMetaData messageMetaData(msgId); QStringList recipients; QList<QMailAddress> addresses = messageMetaData.recipients(); foreach (const QMailAddress &address, addresses) { @@ -149,7 +148,6 @@ return recipients; } else if (role == MessageRecipientsDisplayNameRole) { - QMailMessageMetaData messageMetaData(msgId); QStringList recipients; QList<QMailAddress> addresses = messageMetaData.recipients(); foreach (const QMailAddress &address, addresses) { @@ -158,8 +156,6 @@ return recipients; } else if (role == MessageReadStatusRole) { - QMailMessageMetaData messageMetaData(msgId); - if (messageMetaData.status() & QMailMessage::Read) return 1; // 1 for read else @@ -186,11 +182,9 @@ return uuid; } else if (role == MessageSenderDisplayNameRole) { - QMailMessageMetaData messageMetaData(msgId); return messageMetaData.from().name(); } else if (role == MessageSenderEmailAddressRole) { - QMailMessageMetaData messageMetaData(msgId); return messageMetaData.from().address(); } else if (role == MessageCcRole) { @@ -202,7 +196,6 @@ return QMailAddress::toStringList (message.bcc()); } else if (role == MessageTimeStampRole) { - QMailMessageMetaData messageMetaData(msgId); return (messageMetaData.date().toLocalTime()); } else if (role == MessageSelectModeRole) { @@ -211,6 +204,9 @@ selected = 1; return (selected); } + else if (role == MessagePreviewRole) { + return messageMetaData.preview().simplified(); + } return QMailMessageListModel::data(index, role); } --- email/src/emailmessagelistmodel.h +++ email/src/emailmessagelistmodel.h @@ -1,5 +1,6 @@ /* * Copyright 2011 Intel Corporation. + * Copyright (C) 2012 Jolla Ltd. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at @@ -38,7 +39,8 @@ MessageCcRole, // returns a list of Cc (email + displayName) MessageBccRole, // returns a list of Bcc (email + displayName) MessageTimeStampRole, // returns timestamp in QDateTime format - MessageSelectModeRole // returns the select mode + MessageSelectModeRole, // returns the select mode + MessagePreviewRole // returns message preview if available }; ++++++ nemo-qml-plugins.yaml --- nemo-qml-plugins.yaml +++ nemo-qml-plugins.yaml @@ -2,7 +2,7 @@ Summary: Nemo QML plugins source package. Group: System/Libraries Description: Do not install this, install the subpackaged plugins. -Version: 0.1.7 +Version: 0.1.8 Release: 1 Sources: - "%{name}-%{version}.tar.bz2" @@ -22,6 +22,8 @@ - mlite - gstreamer-0.10 - gstreamer-app-0.10 + +SetupOptions: "-q -n %{name}" SubPackages: - Name: thumbnailer
