add some more error logging
This commit is contained in:
@@ -185,6 +185,8 @@ namespace keepass2android
|
|||||||
|
|
||||||
public override View GetView(int position, View convertView, ViewGroup parent)
|
public override View GetView(int position, View convertView, ViewGroup parent)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
View currView;
|
View currView;
|
||||||
if (convertView == null)
|
if (convertView == null)
|
||||||
{
|
{
|
||||||
@@ -206,8 +208,7 @@ namespace keepass2android
|
|||||||
iv.SetImageDrawable(drawable);
|
iv.SetImageDrawable(drawable);
|
||||||
//App.Kp2a.GetDb().DrawableFactory.AssignDrawableTo(iv, _act, App.Kp2a.GetDb().KpDatabase, (KeePassLib.PwIcon) position, null, false);
|
//App.Kp2a.GetDb().DrawableFactory.AssignDrawableTo(iv, _act, App.Kp2a.GetDb().KpDatabase, (KeePassLib.PwIcon) position, null, false);
|
||||||
|
|
||||||
if (
|
if (PreferenceManager.GetDefaultSharedPreferences(currView.Context)
|
||||||
PreferenceManager.GetDefaultSharedPreferences(currView.Context)
|
|
||||||
.GetString("IconSetKey", currView.Context.PackageName) == currView.Context.PackageName)
|
.GetString("IconSetKey", currView.Context.PackageName) == currView.Context.PackageName)
|
||||||
{
|
{
|
||||||
Android.Graphics.PorterDuff.Mode mMode = Android.Graphics.PorterDuff.Mode.SrcAtop;
|
Android.Graphics.PorterDuff.Mode mMode = Android.Graphics.PorterDuff.Mode.SrcAtop;
|
||||||
@@ -228,6 +229,13 @@ namespace keepass2android
|
|||||||
|
|
||||||
return currView;
|
return currView;
|
||||||
}
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsCustomIcon(int position)
|
public bool IsCustomIcon(int position)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -448,17 +448,22 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnStart()
|
protected override void OnStart()
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
base.OnStart();
|
base.OnStart();
|
||||||
Kp2aLog.Log("FileSelect.OnStart");
|
Kp2aLog.Log("FileSelect.OnStart");
|
||||||
|
|
||||||
|
|
||||||
//if no database is loaded: load the most recent database
|
//if no database is loaded: load the most recent database
|
||||||
if ( (Intent.GetBooleanExtra(NoForwardToPasswordActivity, false)==false) && _dbHelper.HasRecentFiles() && !App.Kp2a.OpenDatabases.Any())
|
if ((Intent.GetBooleanExtra(NoForwardToPasswordActivity, false) == false) && _dbHelper.HasRecentFiles() &&
|
||||||
|
!App.Kp2a.OpenDatabases.Any())
|
||||||
{
|
{
|
||||||
var fileStorage = new LocalFileStorage(App.Kp2a);
|
var fileStorage = new LocalFileStorage(App.Kp2a);
|
||||||
ICursor filesCursor = _dbHelper.FetchAllFiles();
|
ICursor filesCursor = _dbHelper.FetchAllFiles();
|
||||||
filesCursor = new FilteredCursor(filesCursor, cursor => !fileStorage.IsLocalBackup(IOConnectionInfo.FromPath(cursor.GetString(1))));
|
filesCursor = new FilteredCursor(filesCursor,
|
||||||
|
cursor => !fileStorage.IsLocalBackup(IOConnectionInfo.FromPath(cursor.GetString(1))));
|
||||||
StartManagingCursor(filesCursor);
|
StartManagingCursor(filesCursor);
|
||||||
if (filesCursor.Count > 0)
|
if (filesCursor.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -471,11 +476,18 @@ namespace keepass2android
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
App.Kp2a.GetFileStorage(ioc)
|
App.Kp2a.GetFileStorage(ioc)
|
||||||
.PrepareFileUsage(new FileStorageSetupInitiatorActivity(this, OnActivityResult, null), ioc, 0, false);
|
.PrepareFileUsage(new FileStorageSetupInitiatorActivity(this, OnActivityResult, null), ioc,
|
||||||
|
0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
|
Toast.MakeText(this, "Error: " + e.Message, ToastLength.Long).Show();
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user