Merging in changes

This commit is contained in:
AlexVallat 2013-06-20 08:19:07 +01:00
parent f442a04520
commit dea5a7152f
6 changed files with 12 additions and 13 deletions

View File

@ -15,8 +15,9 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using KeePassLib;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using KeePassLib;
using KeePassLib.Collections;
using KeePassLib.Interfaces;
using KeePassLib.Utility;

View File

@ -145,9 +145,9 @@ namespace keepass2android
}
public PwGroup Search(SearchParameters searchParams)
public PwGroup Search(SearchParameters searchParams, IDictionary<PwUuid, String> resultContexts)
{
return SearchHelper.Search(this, searchParams);
return SearchHelper.Search(this, searchParams, resultContexts);
}

View File

@ -18,6 +18,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Android.App;
using Android.Content;

View File

@ -61,7 +61,6 @@
<string name="entry_user_name">User Name</string>
<string name="entry_extra_strings">Extra string fields</string>
<string name="entry_binaries">File attachments</string>
<string name="entry_notes">Notes</string>
<string name="error_arc4">The ArcFour stream cipher is not supported.</string>
<string name="error_can_not_handle_uri">Keepass2Android cannot handle this uri.</string>
<string name="error_could_not_create_group">Error creating group.</string>

View File

@ -46,10 +46,8 @@ namespace keepass2android.search
private const string GetIconPathQuery = "get_icon";
private const string IconIdParameter = "IconId";
private const string CustomIconUuidParameter = "CustomIconUuid";
//public static readonly String AUTHORITY = "keepass2android.search.SearchProvider";
//public static readonly Android.Net.Uri CONTENT_URI = Android.Net.Uri.Parse("content://" + AUTHORITY + "/dictionary");
private Database mDb;
private Database _db;
private static UriMatcher UriMatcher = BuildUriMatcher();
@ -66,13 +64,13 @@ namespace keepass2android.search
public override bool OnCreate()
{
mDb = App.getDB();
_db = App.Kp2a.GetDb();
return true;
}
public override Android.Database.ICursor Query(Android.Net.Uri uri, string[] projection, string selection, string[] selectionArgs, string sortOrder)
{
if (mDb.Open) // Can't show suggestions if the database is locked!
if (_db.Open) // Can't show suggestions if the database is locked!
{
switch ((UriMatches)UriMatcher.Match(uri))
{
@ -83,7 +81,7 @@ namespace keepass2android.search
try
{
var resultsContexts = new Dictionary<PwUuid, String>();
var result = mDb.Search(new SearchParameters { SearchString = searchString }, resultsContexts );
var result = _db.Search(new SearchParameters { SearchString = searchString }, resultsContexts );
return new GroupCursor(result, resultsContexts);
}
catch (Exception e)
@ -112,7 +110,7 @@ namespace keepass2android.search
var iconId = (PwIcon)Enum.Parse(typeof(PwIcon), uri.GetQueryParameter(IconIdParameter));
var customIconUuid = new PwUuid(MemUtil.HexStringToByteArray(uri.GetQueryParameter(CustomIconUuidParameter)));
var iconDrawable = mDb.drawFactory.getIconDrawable(App.Context.Resources, mDb.pm, iconId, customIconUuid) as BitmapDrawable;
var iconDrawable = _db.DrawableFactory.GetIconDrawable(App.Context.Resources, _db.KpDatabase, iconId, customIconUuid) as BitmapDrawable;
if (iconDrawable != null)
{
var pipe = ParcelFileDescriptor.CreatePipe();
@ -273,7 +271,7 @@ namespace keepass2android.search
intlResourceId = Resource.String.entry_url;
break;
case PwDefs.NotesField:
intlResourceId = Resource.String.entry_notes;
intlResourceId = Resource.String.entry_comment;
break;
case PwGroup.SearchContextTags:
intlResourceId = Resource.String.entry_tags;

View File

@ -82,7 +82,7 @@ namespace keepass2android.search
private void Query (SearchParameters searchParams)
{
try {
Group = _db.Search (searchParams);
Group = _db.Search (searchParams, null);
} catch (Exception e) {
Toast.MakeText(this,e.Message, ToastLength.Long).Show();
Finish();