Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
transfer-engine
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core
transfer-engine
Commits
d0dcc756
Commit
d0dcc756
authored
Dec 04, 2017
by
jpetrell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sharing] Show account icon on sharing list. Contributes to JB#35260
parent
e8806542
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
17 deletions
+102
-17
dbus/org.nemo.transferengine.xml
dbus/org.nemo.transferengine.xml
+7
-1
lib/metatypedeclarations.h
lib/metatypedeclarations.h
+2
-0
lib/transfermethodinfo.cpp
lib/transfermethodinfo.cpp
+48
-10
lib/transfermethodinfo.h
lib/transfermethodinfo.h
+21
-3
src/transferengine.cpp
src/transferengine.cpp
+22
-2
src/transferengine.h
src/transferengine.h
+2
-1
No files found.
dbus/org.nemo.transferengine.xml
View file @
d0dcc756
...
...
@@ -88,7 +88,13 @@
# Get a list of transfer methods such as FB, Twitter, BT, NFC, etc
<method
name=
"transferMethods"
>
<arg
name=
"methods"
type=
"a(ssssasi)"
direction=
"out"
/>
<annotation
name=
"org.qtproject.QtDBus.QtTypeName.Out0"
value=
"QList < TransferMethodInfo > "
/>
<annotation
name=
"org.qtproject.QtDBus.QtTypeName.Out0"
value=
"QList < TransferMethodInfoDeprecated > "
/>
</method>
# Get a list of transfer methods such as FB, Twitter, BT, NFC, etc
<method
name=
"transferMethods2"
>
<arg
name=
"methods"
type=
"a(ssssasusa{sv})"
direction=
"out"
/>
<annotation
name=
"org.qtproject.QtDBus.QtTypeName.Out0"
value=
"QList < TransferMethodInfo> "
/>
</method>
# clear all unfinished transfers
...
...
lib/metatypedeclarations.h
View file @
d0dcc756
...
...
@@ -33,6 +33,8 @@
Q_DECLARE_METATYPE
(
TransferDBRecord
)
Q_DECLARE_METATYPE
(
QList
<
TransferDBRecord
>
)
Q_DECLARE_METATYPE
(
TransferMethodInfoDeprecated
)
Q_DECLARE_METATYPE
(
QList
<
TransferMethodInfoDeprecated
>
)
Q_DECLARE_METATYPE
(
TransferMethodInfo
)
Q_DECLARE_METATYPE
(
QList
<
TransferMethodInfo
>
)
...
...
lib/transfermethodinfo.cpp
View file @
d0dcc756
...
...
@@ -46,6 +46,7 @@
info.displayName = QLatin1String("Bluetooth");
info.userName = "";
info.accountId = "";
info.accountIcon = QLatin1String("image://theme/icon-m-bluetooth");
info.methodId = QLatin1String("bluetooth");
info.shareUIPath = SHARE_UI_PATH + QLatin1String("/BluetoothShareUI.qml");
info.capabilitities = capabilities;
...
...
@@ -62,6 +63,7 @@
\value UserName User name e.g. mike.myers@gmail.com
\value MethodId The plugin Id of the share plugin e.g. "bluetooth"
\value AccountId The Id the account, needed in a case of multiple accounts
\value AccountIcon The url of the icon representing the account
\value ShareUIPath The path to the share ui QML plugin. This QML file will be loaded by the share UI
\value Capabilities A list of supported mimetypes
*/
...
...
@@ -69,13 +71,7 @@
/*!
Creates an instance of TransferMethodInfo.
*/
TransferMethodInfo
::
TransferMethodInfo
()
:
displayName
(),
userName
(),
methodId
(),
shareUIPath
(),
capabilitities
(),
accountId
()
TransferMethodInfo
::
TransferMethodInfo
()
{
}
...
...
@@ -90,6 +86,8 @@ TransferMethodInfo &TransferMethodInfo::operator=(const TransferMethodInfo &othe
shareUIPath
=
other
.
shareUIPath
;
capabilitities
=
other
.
capabilitities
;
accountId
=
other
.
accountId
;
accountIcon
=
other
.
accountIcon
;
hints
=
other
.
hints
;
return
*
this
;
}
...
...
@@ -102,7 +100,9 @@ TransferMethodInfo::TransferMethodInfo(const TransferMethodInfo &other):
methodId
(
other
.
methodId
),
shareUIPath
(
other
.
shareUIPath
),
capabilitities
(
other
.
capabilitities
),
accountId
(
other
.
accountId
)
accountId
(
other
.
accountId
),
accountIcon
(
other
.
accountIcon
),
hints
(
other
.
hints
)
{
}
...
...
@@ -126,7 +126,9 @@ QDBusArgument &operator<<(QDBusArgument &argument, const TransferMethodInfo &inf
<<
info
.
methodId
<<
info
.
shareUIPath
<<
info
.
capabilitities
<<
info
.
accountId
;
<<
info
.
accountId
<<
info
.
accountIcon
<<
info
.
hints
;
argument
.
endStructure
();
return
argument
;
...
...
@@ -143,7 +145,9 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, TransferMethodInf
>>
info
.
methodId
>>
info
.
shareUIPath
>>
info
.
capabilitities
>>
info
.
accountId
;
>>
info
.
accountId
>>
info
.
accountIcon
>>
info
.
hints
;
argument
.
endStructure
();
return
argument
;
...
...
@@ -176,7 +180,41 @@ QVariant TransferMethodInfo::value(int index) const
return
capabilitities
;
case
AccountId
:
return
accountId
;
case
AccountIcon
:
return
accountIcon
;
default:
return
QVariant
();
}
}
QDBusArgument
&
operator
<<
(
QDBusArgument
&
argument
,
const
TransferMethodInfoDeprecated
&
info
)
{
argument
.
beginStructure
();
argument
<<
info
.
displayName
<<
info
.
userName
<<
info
.
methodId
<<
info
.
shareUIPath
<<
info
.
capabilitities
<<
info
.
accountId
;
argument
.
endStructure
();
return
argument
;
}
const
QDBusArgument
&
operator
>>
(
const
QDBusArgument
&
argument
,
TransferMethodInfoDeprecated
&
info
)
{
argument
.
beginStructure
();
argument
>>
info
.
displayName
>>
info
.
userName
>>
info
.
methodId
>>
info
.
shareUIPath
>>
info
.
capabilitities
>>
info
.
accountId
;
argument
.
endStructure
();
return
argument
;
}
void
TransferMethodInfoDeprecated
::
registerType
()
{
qDBusRegisterMetaType
<
TransferMethodInfoDeprecated
>
();
qDBusRegisterMetaType
<
QList
<
TransferMethodInfoDeprecated
>
>
();
}
lib/transfermethodinfo.h
View file @
d0dcc756
...
...
@@ -30,6 +30,21 @@
#include <QtGlobal>
#include <QtDBus/QtDBus>
class
TransferMethodInfoDeprecated
{
public:
friend
QDBusArgument
&
operator
<<
(
QDBusArgument
&
argument
,
const
TransferMethodInfoDeprecated
&
record
);
friend
const
QDBusArgument
&
operator
>>
(
const
QDBusArgument
&
argument
,
TransferMethodInfoDeprecated
&
record
);
static
void
registerType
();
QString
displayName
;
QString
userName
;
QString
methodId
;
QString
shareUIPath
;
QStringList
capabilitities
;
quint32
accountId
;
};
class
TransferMethodInfo
{
...
...
@@ -39,8 +54,9 @@ public:
enum
TransferMethodInfoField
{
DisplayName
,
// e.g. Facebook
UserName
,
// e.g. mike.myers@gmail.com
MethodId
,
// Id of the plugin
AccountId
,
// Id the account, needed in a case of multiple accounts
MethodId
,
// id of the plugin
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
};
...
...
@@ -57,13 +73,15 @@ public:
QVariant
value
(
int
index
)
const
;
QString
displayName
;
QString
userName
;
QString
methodId
;
QString
shareUIPath
;
QStringList
capabilitities
;
quint32
accountId
;
QString
accountIcon
;
QVariantHash
hints
;
};
#endif // TRANSFERMETHODINFO_H
src/transferengine.cpp
View file @
d0dcc756
...
...
@@ -526,7 +526,6 @@ QList <TransferMethodInfo> TransferEnginePrivate::enabledPlugins() const
return
m_enabledPlugins
;
}
MediaTransferInterface
*
TransferEnginePrivate
::
loadPlugin
(
const
QString
&
pluginId
)
const
{
QPluginLoader
loader
;
...
...
@@ -776,6 +775,7 @@ TransferEngine::TransferEngine(QObject *parent) :
QObject
(
parent
),
d_ptr
(
new
TransferEnginePrivate
(
this
))
{
TransferMethodInfoDeprecated
::
registerType
();
TransferMethodInfo
::
registerType
();
TransferDBRecord
::
registerType
();
...
...
@@ -1222,7 +1222,27 @@ QList<TransferDBRecord> TransferEngine::activeTransfers()
Transfer methods are basically a list of share plugins installed to the system.
*/
QList
<
TransferMethodInfo
>
TransferEngine
::
transferMethods
()
QList
<
TransferMethodInfoDeprecated
>
TransferEngine
::
transferMethods
()
{
Q_D
(
TransferEngine
);
d
->
exitSafely
();
QList
<
TransferMethodInfo
>
newPlugins
=
d
->
enabledPlugins
();
QList
<
TransferMethodInfoDeprecated
>
oldPlugins
;
for
(
auto
info
:
newPlugins
)
{
TransferMethodInfoDeprecated
oldInfo
;
oldInfo
.
displayName
=
info
.
displayName
;
oldInfo
.
userName
=
info
.
userName
;
oldInfo
.
methodId
=
info
.
methodId
;
oldInfo
.
shareUIPath
=
info
.
shareUIPath
;
oldInfo
.
capabilitities
=
info
.
capabilitities
;
oldInfo
.
accountId
=
info
.
accountId
;
oldPlugins
<<
oldInfo
;
}
return
oldPlugins
;
}
QList
<
TransferMethodInfo
>
TransferEngine
::
transferMethods2
()
{
Q_D
(
TransferEngine
);
d
->
exitSafely
();
...
...
src/transferengine.h
View file @
d0dcc756
...
...
@@ -85,7 +85,8 @@ public Q_SLOTS:
QList
<
TransferDBRecord
>
activeTransfers
();
QList
<
TransferMethodInfo
>
transferMethods
();
QList
<
TransferMethodInfoDeprecated
>
transferMethods
();
QList
<
TransferMethodInfo
>
transferMethods2
();
void
clearTransfers
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment