~michihenning/storage-framework/check-server-side-metadata

« back to all changes in this revision

Viewing changes to src/qt/client/internal/remote_client/AccountImpl.cpp

  • Committer: Tarmac
  • Author(s): James Henstridge
  • Date: 2016-08-12 01:08:05 UTC
  • mfrom: (48.1.6 account-by-address)
  • Revision ID: tarmac-20160812010805-r6whtccb5ikuzh7h
Provide an API to create a new Account object in the client for a provider identified by an arbitrary (bus_name, object_path) pair.

Approved by unity-api-1-bot, Michi Henning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
namespace remote_client
42
42
{
43
43
 
44
 
static constexpr char BUS_NAME[] = "com.canonical.StorageFramework.Provider.ProviderTest";
45
 
 
46
44
AccountImpl::AccountImpl(weak_ptr<Runtime> const& runtime,
47
 
                         int account_id,
 
45
                         QString const& bus_name,
 
46
                         QString const& object_path,
48
47
                         QString const& owner,
49
48
                         QString const& owner_id,
50
49
                         QString const& description)
55
54
{
56
55
    auto rt_impl = dynamic_pointer_cast<RuntimeImpl>(runtime.lock()->p_);
57
56
    assert(rt_impl);
58
 
    QString bus_path = "/provider/" + QString::number(account_id);
59
 
    provider_.reset(new ProviderInterface(BUS_NAME, bus_path, rt_impl->connection()));
 
57
    provider_.reset(new ProviderInterface(bus_name, object_path, rt_impl->connection()));
60
58
    if (!provider_->isValid())
61
59
    {
62
60
        throw LocalCommsException("AccountImpl(): " + provider_->lastError().message());