Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
张铭森
hive
Commits
cb8db1a0
Commit
cb8db1a0
authored
2 years ago
by
Krille
Browse files
Options
Download
Email Patches
Plain Diff
fix: Created path using collection names
parent
e799aae7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
hive/lib/src/backend/vm/backend_manager.dart
hive/lib/src/backend/vm/backend_manager.dart
+1
-1
hive/lib/src/box_collection/box_collection.dart
hive/lib/src/box_collection/box_collection.dart
+4
-1
No files found.
hive/lib/src/backend/vm/backend_manager.dart
View file @
cb8db1a0
...
...
@@ -37,7 +37,7 @@ class BackendManager implements BackendManagerInterface {
if
(
path
.
endsWith
(
_delimiter
))
path
=
path
.
substring
(
0
,
path
.
length
-
1
);
if
(
collection
!=
null
)
{
path
=
path
+
collection
;
path
=
'
$
path
/
$
collection
'
;
}
var
dir
=
Directory
(
path
);
...
...
This diff is collapsed.
Click to expand it.
hive/lib/src/box_collection/box_collection.dart
View file @
cb8db1a0
...
...
@@ -33,6 +33,9 @@ class BoxCollection implements implementation.BoxCollection {
HiveCipher
?
cipher
,
bool
useLocks
=
true
,
})
async
{
if
(
name
.
contains
(
'/'
)
||
name
.
trim
()
!=
name
||
name
.
isEmpty
)
{
throw
HiveError
(
'Invalid collection name "
$name
"'
);
}
// compatibility for [key]
cipher
??=
key
;
...
...
@@ -140,7 +143,7 @@ class CollectionBox<V> implements implementation.CollectionBox<V> {
if
(
_cachedBox
==
null
||
!
_cachedBox
!.
isOpen
)
{
final
hive
=
Hive
as
HiveImpl
;
_cachedBox
=
hive
.
isBoxOpen
(
name
,
boxCollection
.
name
)
?
hive
.
lazyBox
(
name
,
boxCollection
.
name
)
?
hive
.
lazyBox
(
name
,
boxCollection
.
name
)
:
await
hive
.
openLazyBox
(
name
,
encryptionCipher:
boxCollection
.
_cipher
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment