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
372a9936
Commit
372a9936
authored
Nov 21, 2013
by
Marko Mattila
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from zchydem/master
[transfer-engine] Fix to account and share method list handling.
parents
04737e5b
5189dd00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
11 deletions
+35
-11
src/transferengine.cpp
src/transferengine.cpp
+32
-10
src/transferengine_p.h
src/transferengine_p.h
+3
-1
No files found.
src/transferengine.cpp
View file @
372a9936
...
...
@@ -45,6 +45,8 @@
#include <signal.h>
#include <Accounts/Manager>
#define SHARE_PLUGINS_PATH "/usr/lib/nemo-transferengine/plugins"
#define CONFIG_PATH "/usr/share/nemo-transferengine/nemo-transfer-engine.conf"
#define FILE_WATCHER_TIMEOUT 5000
...
...
@@ -153,7 +155,6 @@ TransferEnginePrivate::TransferEnginePrivate(TransferEngine *parent):
connect
(
m_accountManager
,
SIGNAL
(
accountCreated
(
Accounts
::
AccountId
)),
this
,
SLOT
(
enabledPluginsCheck
()));
connect
(
m_accountManager
,
SIGNAL
(
accountRemoved
(
Accounts
::
AccountId
)),
this
,
SLOT
(
enabledPluginsCheck
()));
connect
(
m_accountManager
,
SIGNAL
(
accountUpdated
(
Accounts
::
AccountId
)),
this
,
SLOT
(
enabledPluginsCheck
()));
connect
(
m_accountManager
,
SIGNAL
(
enabledEvent
(
Accounts
::
AccountId
)),
this
,
SLOT
(
enabledPluginsCheck
()));
// Exit safely stuff if we recieve certain signal or there are no active transfers
Q_Q
(
TransferEngine
);
...
...
@@ -188,6 +189,11 @@ void TransferEnginePrivate::enabledPluginsCheck()
m_fileWatcherTimer
->
stop
();
}
if
(
m_infoObjects
.
count
()
>
0
)
{
qWarning
()
<<
Q_FUNC_INFO
<<
"Already quering account info"
<<
m_infoObjects
.
count
();
return
;
}
// First clear old data
m_enabledPlugins
.
clear
();
qDeleteAll
(
m_infoObjects
);
...
...
@@ -217,12 +223,20 @@ void TransferEnginePrivate::enabledPluginsCheck()
continue
;
}
// Put info object to temporary container to wait that query result
// is returned. These object will be cleaned in pluginInfoReady() slot.
m_infoObjects
<<
info
;
connect
(
info
,
SIGNAL
(
infoReady
()),
this
,
SLOT
(
pluginInfoReady
()));
connect
(
info
,
SIGNAL
(
infoError
(
QString
)),
this
,
SLOT
(
pluginInfoError
(
QString
)));
info
->
query
();
if
(
info
->
ready
())
{
if
(
info
->
info
().
count
()
>
0
)
{
m_enabledPlugins
<<
info
->
info
();
}
else
{
// Plugin has nothing to provide, just ignore it
delete
info
;
}
}
else
{
// These object will be cleaned in pluginInfoReady() slot.
m_infoObjects
<<
info
;
connect
(
info
,
SIGNAL
(
infoReady
()),
this
,
SLOT
(
pluginInfoReady
()));
connect
(
info
,
SIGNAL
(
infoError
(
QString
)),
this
,
SLOT
(
pluginInfoError
(
QString
)));
info
->
query
();
}
}
if
(
!
interface
)
{
...
...
@@ -608,10 +622,18 @@ void TransferEnginePrivate::updateProgress(qreal progress)
void
TransferEnginePrivate
::
pluginInfoReady
()
{
TransferPluginInfo
*
infoObj
=
qobject_cast
<
TransferPluginInfo
*>
(
sender
());
m_enabledPlugins
<<
infoObj
->
info
();
m_infoObjects
.
removeOne
(
infoObj
);
delete
infoObj
;
QList
<
TransferMethodInfo
>
infoList
=
infoObj
->
info
();
if
(
!
infoList
.
isEmpty
())
{
m_enabledPlugins
<<
infoList
;
}
if
(
m_infoObjects
.
removeOne
(
infoObj
))
{
delete
infoObj
;
}
else
{
qWarning
()
<<
Q_FUNC_INFO
<<
"Failed to remove info object!"
;
delete
infoObj
;
}
if
(
m_infoObjects
.
isEmpty
())
{
Q_Q
(
TransferEngine
);
...
...
src/transferengine_p.h
View file @
372a9936
...
...
@@ -35,7 +35,9 @@
#include "mediatransferinterface.h"
#include "transfermethodinfo.h"
#include <Accounts/Manager>
namespace
Accounts
{
class
Manager
;
}
class
QFileSystemWatcher
;
class
QTimer
;
...
...
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