~michihenning/storage-framework/increase-timeout

« back to all changes in this revision

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

  • Committer: Michi Henning
  • Date: 2016-08-10 06:45:41 UTC
  • mfrom: (10.10.15 more-coverage)
  • Revision ID: michi.henning@canonical.com-20160810064541-ty9vzh6dff8jgfpw
Merged lp:~michihenning/storage-framework/more-coverage:
Improved coverage. Better error reporting/handling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
 
82
82
void RuntimeImpl::shutdown()
83
83
{
84
 
    if (destroyed_.exchange(true))
 
84
    if (destroyed_)
85
85
    {
86
86
        return;
87
87
    }
 
88
    destroyed_ = true;
88
89
    conn_.disconnectFromBus(conn_.name());
89
90
}
90
91
 
91
92
QFuture<QVector<Account::SPtr>> RuntimeImpl::accounts()
92
93
{
 
94
    if (destroyed_)
 
95
    {
 
96
        return make_exceptional_future(qf_, RuntimeDestroyedException("Runtime::accounts()"));
 
97
    }
 
98
 
93
99
    if (!manager_)
94
100
    {
95
101
        manager_.reset(new OnlineAccounts::Manager("", conn_));
110
116
 
111
117
void RuntimeImpl::manager_ready()
112
118
{
 
119
    if (destroyed_)
 
120
    {
 
121
        make_exceptional_future(qf_, RuntimeDestroyedException("Runtime::accounts()"));
 
122
        return;
 
123
    }
 
124
 
113
125
    timer_.stop();
114
126
    try
115
127
    {
133
145
 
134
146
void RuntimeImpl::timeout()
135
147
{
136
 
    make_exceptional_future(qf_, ResourceException("timeout error"));  // TODO
 
148
    make_exceptional_future(qf_, ResourceException("Runtime::accounts(): timeout retrieving Online accounts", 0));
137
149
}
138
150
 
139
151
}  // namespace local_client