added CreateFilePath method to IFileStorage and used it after file chooser for save

-> save as works with GDrive as well

minor changes and fixes
This commit is contained in:
Philipp Crocoll
2013-10-27 21:55:19 +01:00
parent 0bf3a3ee7f
commit e6b1d37c21
7 changed files with 299 additions and 229 deletions

View File

@@ -200,5 +200,12 @@ namespace keepass2android.Io
{
return ioc.GetDisplayName();
}
public string CreateFilePath(string parent, string newFilename)
{
if (!parent.EndsWith("/"))
parent += "/";
return parent + newFilename;
}
}
}

View File

@@ -481,6 +481,11 @@ namespace keepass2android.Io
return _cachedStorage.GetDisplayName(ioc);
}
public string CreateFilePath(string parent, string newFilename)
{
return _cachedStorage.CreateFilePath(parent, newFilename);
}
public string GetBaseVersionHash(IOConnectionInfo ioc)
{

View File

@@ -150,6 +150,10 @@ namespace keepass2android.Io
/// Converts the given path to a displayable string
/// </summary>
string GetDisplayName(IOConnectionInfo ioc);
//returns the path of a file "newFilename" in the folder "parent"
//this may create the file if this is required to get a path (if a UUID is part of the file path)
string CreateFilePath(string parent, string newFilename);
}
public interface IWriteTransaction: IDisposable

View File

@@ -280,6 +280,11 @@ namespace keepass2android.Io
return _jfs.GetDisplayName(ioc.Path);
}
public string CreateFilePath(string parent, string newFilename)
{
return _jfs.CreateFilePath(parent, newFilename);
}
private DateTime JavaTimeToCSharp(long javatime)
{
return new DateTime(1970, 1, 1).AddMilliseconds(javatime);