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/8384

Thank You,
vdvsx

[This message was auto-generated]

---

Request # 8384:

Messages from BOSS:

State: review at 2013-03-07T13:26:54 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,4 @@
+* Thu Mar 07 2013 Valerio Valerio <[email protected]> - 0.3.3
+- email: Add addressFromAccountId binding (from Valerio Valerio)
+- folderlistmodel: Modifications for building also on Qt5 (from ajalkane)
+

old:
----
  nemo-qml-plugins-0.3.2.tar.bz2

new:
----
  nemo-qml-plugins-0.3.3.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.3.2
+Version:    0.3.3
 Release:    1
 Group:      System/Libraries
 License:    BSD

other changes:
--------------

++++++ nemo-qml-plugins-0.3.2.tar.bz2 -> nemo-qml-plugins-0.3.3.tar.bz2
--- email/src/emailaccountlistmodel.cpp
+++ email/src/emailaccountlistmodel.cpp
@@ -118,21 +118,16 @@
 }
 
 int EmailAccountListModel::indexFromAccountId(QVariant id)
-{
-    int idx = 0;
-
-    if (id == 0)
-        return idx;
-    
+{ 
     QMailAccountId accountId = id.value<QMailAccountId>();
     if (!accountId.isValid())
-        return idx;
+        return -1;
 
     for (int row = 0; row < rowCount(); row++) {
         if (accountId == QMailAccountListModel::idFromIndex(index(row)))
             return row;
     }
-    return idx;
+    return -1;
 }
 
 QVariant EmailAccountListModel::getDisplayNameByIndex(int idx)
@@ -175,6 +170,16 @@
     return data(index(idx), EmailAccountListModel::MailAccountId);
 }
 
+QString EmailAccountListModel::addressFromAccountId(QVariant accountId)
+{
+    int accountIndex = indexFromAccountId(accountId);
+
+    if (accountIndex < 0)
+        return "";
+
+    return data(index(accountIndex), 
EmailAccountListModel::EmailAddress).toString();
+}
+
 QDateTime EmailAccountListModel::lastUpdatedAccountTime()
 {
     QDateTime lastUpdatedAccTime;
--- email/src/emailaccountlistmodel.h
+++ email/src/emailaccountlistmodel.h
@@ -44,6 +44,7 @@
     Q_INVOKABLE QStringList getAllEmailAddresses();
     Q_INVOKABLE QStringList getAllDisplayNames();
     Q_INVOKABLE QVariant getAccountIdByIndex(int idx);
+    Q_INVOKABLE QString addressFromAccountId(QVariant accountId);
     Q_INVOKABLE QDateTime lastUpdatedAccountTime();
 
 signals:
--- email/src/emailmessage.cpp
+++ email/src/emailmessage.cpp
@@ -115,7 +115,7 @@
         emailAgent->sendMessages(m_msg.parentAccountId());
     }
     else
-       qDebug() << "Error queuing message, stored: " << stored;
+       qWarning() << "Error: queuing message, stored: " << stored;
 }
 
 void EmailMessage::saveDraft()
--- folderlistmodel/folderlistmodel.pro
+++ folderlistmodel/folderlistmodel.pro
@@ -7,7 +7,8 @@
            iorequestworker.cpp \
            ioworkerthread.cpp
 
-HEADERS += dirmodel.h \
+HEADERS += plugin.h \
+           dirmodel.h \
            iorequest.h \
            iorequestworker.h \
            ioworkerthread.h
--- folderlistmodel/plugin.cpp
+++ folderlistmodel/plugin.cpp
@@ -29,32 +29,25 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  */
 
-#include <QtGlobal>
-#include <QtDeclarative>
-#include <QDeclarativeEngine>
-#include <QDeclarativeExtensionPlugin>
+#include <QVector>
+#include <QFileInfo>
 
-#include "dirmodel.h"
+#include "plugin.h"
 
-Q_DECLARE_METATYPE(QVector<QFileInfo>)
+NemoFolderListModelPlugin::NemoFolderListModelPlugin() { }
 
-class Q_DECL_EXPORT NemoFolderListModelPlugin : public 
QDeclarativeExtensionPlugin
-{
-public:
-    virtual ~NemoFolderListModelPlugin() { }
+NemoFolderListModelPlugin::~NemoFolderListModelPlugin() { }
 
-    void initializeEngine(QDeclarativeEngine *engine, const char *uri)
-    {
-        Q_ASSERT(uri == QLatin1String("org.nemomobile.folderlistmodel"));
-    }
-
-    void registerTypes(const char *uri)
-    {
-        Q_ASSERT(uri == QLatin1String("org.nemomobile.folderlistmodel"));
-        qRegisterMetaType<QVector<QFileInfo> >();
-        qmlRegisterType<DirModel>(uri, 1, 0, "FolderListModel");
-    }
-};
+void NemoFolderListModelPlugin::initializeEngine(QmlEngine *engine, const char 
*uri)
+{
+    Q_UNUSED(engine)
+    Q_ASSERT(uri == QLatin1String("org.nemomobile.folderlistmodel"));
+}
 
-Q_EXPORT_PLUGIN2(nemofolderlistmodel, NemoFolderListModelPlugin);
+void NemoFolderListModelPlugin::registerTypes(const char *uri)
+{
+    Q_ASSERT(uri == QLatin1String("org.nemomobile.folderlistmodel"));
+    qRegisterMetaType<QVector<QFileInfo> >();
+    qmlRegisterType<DirModel>(uri, 1, 0, "FolderListModel");
+}
 
--- folderlistmodel/plugin.h
+++ folderlistmodel/plugin.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2012 Robin Burchell <[email protected]>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * "Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Nemo Mobile nor the names of its contributors
+ *     may be used to endorse or promote products derived from this
+ *     software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ */
+
+#ifndef NEMO_QML_PLUGINS_FOLDERLISTMODEL
+#define NEMO_QML_PLUGINS_FOLDERLISTMODEL
+
+#include <QtGlobal>
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#include <QtDeclarative>
+#include <QDeclarativeEngine>
+#include <QDeclarativeExtensionPlugin>
+#include <QVector>
+#include <QFileInfo>
+
+#define PLUGIN_CLASS_EXPORT
+#define PLUGIN_CLASS_EXTERNAL_EXPORT Q_EXPORT_PLUGIN2(nemofolderlistmodel, 
NemoFolderListModelPlugin);
+#define PLUGIN_CLASS_EXTEND
+typedef QDeclarativeExtensionPlugin QmlPluginParent;
+typedef QDeclarativeEngine QmlEngine;
+Q_DECLARE_METATYPE(QVector<QFileInfo>)
+
+#else
+#include <QQmlComponent>
+#include <QQmlEngine>
+#include <QQmlContext>
+#include <QQmlExtensionPlugin>
+
+#define PLUGIN_CLASS_EXPORT Q_DECL_EXPORT
+#define PLUGIN_CLASS_EXTERNAL_EXPORT
+#define PLUGIN_CLASS_EXTEND \
+    Q_OBJECT \
+    Q_PLUGIN_METADATA(IID "org.nemomobile.folderlistmodel")
+typedef QQmlExtensionPlugin QmlPluginParent;
+typedef QQmlEngine QmlEngine;
+#endif
+
+#include "dirmodel.h"
+
+class PLUGIN_CLASS_EXPORT NemoFolderListModelPlugin  : public QmlPluginParent
+{
+    PLUGIN_CLASS_EXTEND
+
+public:
+    NemoFolderListModelPlugin();
+    virtual ~NemoFolderListModelPlugin();
+
+    void initializeEngine(QmlEngine *engine, const char *uri);
+    void registerTypes(const char *uri);
+};
+
+PLUGIN_CLASS_EXTERNAL_EXPORT
+
+#endif // NEMO_QML_PLUGINS_FOLDERLISTMODEL

++++++ 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.3.2
+Version: 0.3.3
 Release: 1
 Sources:
     - "%{name}-%{version}.tar.bz2"



Reply via email to