~ubuntu-branches/ubuntu/trusty/content-hub/trusty-proposed

« back to all changes in this revision

Viewing changes to examples/importer/importer.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Ken VanDine, Ubuntu daily release
  • Date: 2014-03-21 00:46:57 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20140321004657-5w0p7mj1qn9lrrj3
Tags: 0.0+14.04.20140321-0ubuntu1
[ Ken VanDine ]
* Adds support for multiple handler types: source, destination and
  share. Enforce single transfer per peer, if a second transfer
  request is made from a peer that already has an unfinished transfer,
  cancel the previous one. This is needed as long as apps are required
  to be single instance.
* If the transfer isn't persistent, attempt to hardlink instead of
  copying. If the link fails, fallback to a copy.
* If the default source is set to anything other than a click appId
  triplet, fallback to the legacy APP_ID. Changed default source for
  contacts to the legacy APP_ID for address-book-app

[ Ubuntu daily release ]
* New rebuild forced

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#include <QCoreApplication>
 
20
#include <QStringList>
20
21
#include "example.h"
21
22
 
22
23
namespace cuc = com::ubuntu::content;
27
28
 
28
29
    Example *e = new Example();
29
30
 
30
 
    e->create_import();
 
31
    QString peerName;
 
32
 
 
33
    if (a.arguments().size() > 1)
 
34
        peerName = a.arguments().at(1);
 
35
 
 
36
    if (!peerName.isEmpty())
 
37
    {
 
38
        qDebug() << peerName;
 
39
        auto hub = cuc::Hub::Client::instance();
 
40
 
 
41
        auto peer = cuc::Peer{peerName};
 
42
        qDebug() << Q_FUNC_INFO << "PEER: " << peer.id();
 
43
        auto transfer = hub->create_import_from_peer(peer);
 
44
        transfer->start();
 
45
    }
 
46
 
 
47
    Q_UNUSED(e);
31
48
 
32
49
    return a.exec();
33
50
}