mirror of
https://github.com/moparisthebest/keepass2android
synced 2025-01-30 14:40:21 -05:00
fixed a bug with creating databases
This commit is contained in:
parent
72ab132979
commit
ed7a85dde7
@ -55,7 +55,8 @@ namespace keepass2android
|
||||
public override void Run ()
|
||||
{
|
||||
|
||||
if (! _dontSave) {
|
||||
if (!_dontSave)
|
||||
{
|
||||
try
|
||||
{
|
||||
StatusLogger.UpdateMessage(UiStringKey.saving_database);
|
||||
@ -80,32 +81,32 @@ namespace keepass2android
|
||||
_app.AskYesNoCancel(UiStringKey.TitleSyncQuestion, UiStringKey.MessageSyncQuestion,
|
||||
//yes = sync
|
||||
(sender, args) =>
|
||||
{
|
||||
Action runHandler = () =>
|
||||
{
|
||||
//note: when synced, the file might be downloaded once again from the server. Caching the data
|
||||
//in the hashing function would solve this but increases complexity. I currently assume the files are
|
||||
//small.
|
||||
MergeIn(fileStorage, ioc);
|
||||
PerformSaveWithoutCheck(fileStorage, ioc);
|
||||
Finish(true);
|
||||
};
|
||||
RunInWorkerThread(runHandler);
|
||||
},
|
||||
{
|
||||
Action runHandler = () =>
|
||||
{
|
||||
//note: when synced, the file might be downloaded once again from the server. Caching the data
|
||||
//in the hashing function would solve this but increases complexity. I currently assume the files are
|
||||
//small.
|
||||
MergeIn(fileStorage, ioc);
|
||||
PerformSaveWithoutCheck(fileStorage, ioc);
|
||||
Finish(true);
|
||||
};
|
||||
RunInWorkerThread(runHandler);
|
||||
},
|
||||
//no = overwrite
|
||||
(sender, args) =>
|
||||
{
|
||||
RunInWorkerThread( () =>
|
||||
{
|
||||
PerformSaveWithoutCheck(fileStorage, ioc);
|
||||
Finish(true);
|
||||
});
|
||||
},
|
||||
{
|
||||
RunInWorkerThread(() =>
|
||||
{
|
||||
PerformSaveWithoutCheck(fileStorage, ioc);
|
||||
Finish(true);
|
||||
});
|
||||
},
|
||||
//cancel
|
||||
(sender, args) =>
|
||||
{
|
||||
RunInWorkerThread(() => Finish(false));
|
||||
},
|
||||
{
|
||||
RunInWorkerThread(() => Finish(false));
|
||||
},
|
||||
_ctx
|
||||
);
|
||||
}
|
||||
@ -115,7 +116,9 @@ namespace keepass2android
|
||||
Finish(true);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
/* TODO KPDesktop:
|
||||
* catch(Exception exSave)
|
||||
{
|
||||
@ -123,12 +126,15 @@ namespace keepass2android
|
||||
bSuccess = false;
|
||||
}
|
||||
*/
|
||||
Kp2aLog.Log("Error while saving: "+e.ToString());
|
||||
Finish (false, e.Message);
|
||||
Kp2aLog.Log("Error while saving: " + e.ToString());
|
||||
Finish(false, e.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Finish(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user