[Merge] lp:~artmello/messaging-app/messaging-app-video_attachment into lp:messaging-app

Tiago Salem Herrmann tiago.herrmann at canonical.com
Wed Nov 25 18:58:57 UTC 2015


Review: Needs Fixing



Diff comments:

> 
> === added file 'src/fileoperations.cpp'
> --- src/fileoperations.cpp	1970-01-01 00:00:00 +0000
> +++ src/fileoperations.cpp	2015-11-25 13:16:59 +0000
> @@ -0,0 +1,47 @@
> +/*
> + * Copyright (C) 2015 Canonical, Ltd.
> + *
> + * Authors:
> + *  Arthur Mello <arthur.mello at canonical.com>
> + *
> + * This file is part of messaging-app.
> + *
> + * messaging-app is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; version 3.
> + *
> + * messaging-app is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include "fileoperations.h"
> +
> +#include <QDir>
> +#include <QFile>
> +#include <QTemporaryFile>
> +
> +FileOperations::FileOperations(QObject *parent)
> +    : QObject(parent)
> +{
> +}
> +
> +FileOperations::~FileOperations()
> +{
> +}
> +
> +QString FileOperations::getTemporaryFile(const QString &fileExtension) const
> +{
> +    QTemporaryFile tmp(QDir::tempPath() + "/tmpXXXXXX" + fileExtension);

The bug that requires this workaround is targetted for ota9: https://bugs.launchpad.net/ubuntu/+source/media-hub/+bug/1420728
Perhaps add a // TODO remove once lp:1420728 is fixed ?

> +    tmp.open();
> +    return tmp.fileName();
> +}
> +
> +bool FileOperations::link(const QString &from, const QString &to)
> +{
> +    return QFile::link(from, to);
> +}
> 
> === modified file 'src/qml/MMSDelegate.qml'
> --- src/qml/MMSDelegate.qml	2015-11-23 19:51:16 +0000
> +++ src/qml/MMSDelegate.qml	2015-11-25 13:16:59 +0000
> @@ -102,6 +96,13 @@
>                                        "data": attachment,
>                                        "delegateSource": "MMS/MMSContact.qml"
>                                      })
> +            } else if (startsWith(attachment.contentType, "video/") ||
> +                       startsWith(attachment.contentType, "application/octet-stream")) {

This can become a problem, as application/octet-stream will be used for unknown binary files.

> +                // 3GPP file received as MMS video attachment
> +                root.dataAttachments.push({"type": "video",
> +                                      "data": attachment,
> +                                      "delegateSource": "MMS/MMSVideo.qml",
> +                                    })
>              } else {
>                  root.dataAttachments.push({"type": "default",
>                                        "data": attachment,


-- 
https://code.launchpad.net/~artmello/messaging-app/messaging-app-video_attachment/+merge/278476
Your team Ubuntu Phablet Team is subscribed to branch lp:messaging-app.



More information about the Ubuntu-reviews mailing list