Revision 126f90b3

b/trunk/Pithos.Client.WPF/SelectiveSynch/SelectiveSynchViewModel.cs
152 152
                                   DisplayName = AccountName ,
153 153
                                   Directories = ownFolders.ToList()
154 154
                               };
155
            
155

  
156
            this.RootNodes.Add(rootItem);
157
            this.RootNodes.Add(othersNode);
156 158

  
157 159
            SetInitialSelections(Account);
158 160
            
159
            Execute.OnUIThread(()=>
160
                                   {
161
                                       this.RootNodes.Add(rootItem);
162
                                       this.RootNodes.Add(othersNode);
163
                                       IsBusy = false;
164
                                   });
161
            IsBusy = false;
165 162
        }
166 163

  
167 164
        public bool IsBusy
......
184 181
            
185 182
            var selects = from rootRecord in RootNodes
186 183
                          from record in rootRecord
187
                          where record.ObjectInfo!=null &&  selections.Contains(record.ObjectInfo.Name)
184
                          where record.Uri !=null &&  selections.Contains(record.Uri.ToString())
188 185
                          select record;
189 186

  
190 187
            selects.Apply(record=>record.IsChecked=true);
b/trunk/Pithos.Core/Agents/PollAgent.cs
212 212
                    var listObjects = (from container in containers
213 213
                                       select Task<IList<ObjectInfo>>.Factory.StartNew(_ =>
214 214
                                             client.ListObjects(accountInfo.UserName, container.Name, since), container.Name)).ToList();
215

  
215
                    //BUG: Can't detect difference between no changes or no objects
216
                    //ListObjects returns nothing if there are no changes since the last check time (since value)                    
217
                    //TODO: Must detect the difference between no server objects an
216 218
                    var listShared = Task<IList<ObjectInfo>>.Factory.StartNew(_ => client.ListSharedObjects(since), "shared");
217 219
                    listObjects.Add(listShared);
218 220
                    var listTasks = await Task.Factory.WhenAll(listObjects.ToArray());
b/trunk/Pithos.Network/CloudFilesClient.cs
318 318
            {
319 319
                if (Log.IsDebugEnabled) Log.DebugFormat("START");
320 320

  
321
                var objects = new List<ObjectInfo>();
322 321
                var accounts = ListSharingAccounts(since);
323
                foreach (var account in accounts)
322
                var items = from account in accounts 
323
                            let containers = ListContainers(account.name) 
324
                            from container in containers 
325
                            select ListObjects(account.name, container.Name);
326
                var objects=items.SelectMany(r=> r).ToList();
327
/*
328
                var objects = new List<ObjectInfo>();
329
                foreach (var containerObjects in items)
324 330
                {
325
                    var containers = ListContainers(account.name);
326
                    foreach (var container in containers)
327
                    {
328
                        var containerObjects = ListObjects(account.name, container.Name);
329
                        objects.AddRange(containerObjects);
330
                    }
331
                    objects.AddRange(containerObjects);
331 332
                }
333
*/
332 334
                if (Log.IsDebugEnabled) Log.DebugFormat("END");
333 335
                return objects;
334 336
            }
......
603 605

  
604 606
                    client.AssertStatusOK("ListObjects failed");
605 607

  
608
                    //HACK: Must add it to all other operations as well
609
                    StatusCode = client.StatusCode;
606 610
                    //If the result is empty, return an empty list,
607 611
                    var infos = String.IsNullOrWhiteSpace(content)
608 612
                                    ? new List<ObjectInfo>()
......
615 619
                        info.Account = account;
616 620
                        info.StorageUri = this.StorageUrl;
617 621
                    }
618
                    if (Log.IsDebugEnabled) Log.DebugFormat("START");
622
                    if (Log.IsDebugEnabled) Log.DebugFormat("END");
619 623
                    return infos;
620 624
                }
621 625
            }
622 626
        }
623 627

  
628
        public HttpStatusCode StatusCode { get; set; }
624 629

  
625 630

  
626 631
        public IList<ObjectInfo> ListObjects(string account, string container, string folder, DateTime? since = null)

Also available in: Unified diff