Navigation Menu

Skip to content

Commit

Permalink
[transferengine] Add TransferMethodInfo::SupportsMultipleFiles. JB#53…
Browse files Browse the repository at this point in the history
…987 OMP#JOLLA-75
  • Loading branch information
blammit committed May 7, 2021
1 parent 74e54cb commit 084a21f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/ExampleShareUI.qml
@@ -1,6 +1,6 @@
/******************************************************************************
Copyright (c) 2014 - 2021 Jolla Ltd.
Copyright (c) Open Mobile Platform LLC.
Copyright (c) 2021 Open Mobile Platform LLC.
All rights reserved.
Expand Down
18 changes: 18 additions & 0 deletions lib/transfermethodinfo.cpp
Expand Up @@ -25,6 +25,12 @@
#include "transfermethodinfo.h"
#include "metatypedeclarations.h"

namespace {

const QString KeySupportsMultipleFiles = "SupportsMultipleFiles";

}

/*!
\class TransferMethodInfo
\brief The TransferMethodInfo class encapsulate information of a single transfer method.
Expand Down Expand Up @@ -176,11 +182,23 @@ QVariant TransferMethodInfo::value(int index) const
return accountId;
case AccountIcon:
return accountIcon;
case SupportsMultipleFiles:
return supportsMultipleFiles();
default:
return QVariant();
}
}

void TransferMethodInfo::setSupportsMultipleFiles(bool supportsMultipleFiles)
{
hints.insert(KeySupportsMultipleFiles, supportsMultipleFiles);
}

bool TransferMethodInfo::supportsMultipleFiles() const
{
return hints.value(KeySupportsMultipleFiles).toBool();
}

QDBusArgument &operator<<(QDBusArgument &argument, const TransferMethodInfoDeprecated &info)
{
argument.beginStructure();
Expand Down
6 changes: 5 additions & 1 deletion lib/transfermethodinfo.h
Expand Up @@ -56,7 +56,8 @@ class TransferMethodInfo
AccountId, // id the account, needed in a case of multiple accounts
AccountIcon, // account icon source url
ShareUIPath, // path to the share ui QML plugin
Capabilities // list of supported mimetypes
Capabilities, // list of supported mimetypes
SupportsMultipleFiles
};

TransferMethodInfo();
Expand All @@ -71,6 +72,9 @@ class TransferMethodInfo

QVariant value(int index) const;

void setSupportsMultipleFiles(bool supportsMultipleFiles);
bool supportsMultipleFiles() const;

QString displayName;
QString userName;
QString methodId;
Expand Down

0 comments on commit 084a21f

Please sign in to comment.