Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

Commit

Permalink
Fixed uploading to SkyDrive doesn't upload DB's timestamp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tran Ngoc Van committed Jun 3, 2012
1 parent 5c9a5dd commit 68cecd3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions KeePass/Sources/SkyDrive/SkyDriveAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public override void Conflict(ListItem item,
var name = GetNonConflictName(meta.Title);

_client.Upload(meta.Parent, name, _info.Database,
x => uploaded(item, x, name));
(id, data) => uploaded(item, data, name));
}

private static string GetNonConflictName(string name)
Expand Down Expand Up @@ -80,10 +80,15 @@ public override void Upload(ListItem item,
{
var meta = (MetaListItemInfo)item.Tag;
_client.Upload(meta.Parent, meta.Title,
_info.Database, x =>
_info.Database, (path, data) =>
{
_info.Path = x;
uploaded(item);
_info.Path = data;
_client.GetFileMeta(path, info =>
uploaded(new ListItem
{
Tag = info,
Timestamp = info.Modified,
}));
});
}

Expand Down
6 changes: 3 additions & 3 deletions KeePass/Sources/SkyDrive/SkyDriveClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void Rename(string path, string name,

public void Upload(string folder,
string name, byte[] content,
Action<string> completed)
Action<string, string> completed)
{
var request = Request("{folder}/files/");
request.Method = Method.POST;
Expand All @@ -246,8 +246,8 @@ public void Upload(string folder,
return;
var path = root.GetValue("id");
path = GetSyncPath(path);
completed(path);
var pathData = GetSyncPath(path);
completed(path, pathData);
});
}

Expand Down

0 comments on commit 68cecd3

Please sign in to comment.