Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d5983dd3
Commit
d5983dd3
authored
Feb 22, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/udisks2: use the relative path
Closes #487
parent
98258acc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
NEWS
NEWS
+1
-0
UdisksStorage.cxx
src/storage/plugins/UdisksStorage.cxx
+17
-5
No files found.
NEWS
View file @
d5983dd3
...
@@ -7,6 +7,7 @@ ver 0.21.5 (not yet released)
...
@@ -7,6 +7,7 @@ ver 0.21.5 (not yet released)
- fix assertion failures with mount points
- fix assertion failures with mount points
* storage
* storage
- udisks: fix "AlreadyMounted" error
- udisks: fix "AlreadyMounted" error
- udisks: use relative path from mount URI
* input
* input
- buffer: fix crash bug when playing remote WAV file
- buffer: fix crash bug when playing remote WAV file
* tags
* tags
...
...
src/storage/plugins/UdisksStorage.cxx
View file @
d5983dd3
...
@@ -46,6 +46,8 @@ class UdisksStorage final : public Storage {
...
@@ -46,6 +46,8 @@ class UdisksStorage final : public Storage {
const
std
::
string
base_uri
;
const
std
::
string
base_uri
;
const
std
::
string
id
;
const
std
::
string
id
;
const
AllocatedPath
inside_path
;
std
::
string
dbus_path
;
std
::
string
dbus_path
;
SafeSingleton
<
ODBus
::
Glue
>
dbus_glue
;
SafeSingleton
<
ODBus
::
Glue
>
dbus_glue
;
...
@@ -64,10 +66,12 @@ class UdisksStorage final : public Storage {
...
@@ -64,10 +66,12 @@ class UdisksStorage final : public Storage {
DeferEvent
defer_mount
,
defer_unmount
;
DeferEvent
defer_mount
,
defer_unmount
;
public
:
public
:
template
<
typename
B
,
typename
I
>
template
<
typename
B
,
typename
I
,
typename
IP
>
UdisksStorage
(
EventLoop
&
_event_loop
,
B
&&
_base_uri
,
I
&&
_id
)
UdisksStorage
(
EventLoop
&
_event_loop
,
B
&&
_base_uri
,
I
&&
_id
,
IP
&&
_inside_path
)
:
base_uri
(
std
::
forward
<
B
>
(
_base_uri
)),
:
base_uri
(
std
::
forward
<
B
>
(
_base_uri
)),
id
(
std
::
forward
<
I
>
(
_id
)),
id
(
std
::
forward
<
I
>
(
_id
)),
inside_path
(
std
::
forward
<
IP
>
(
_inside_path
)),
dbus_glue
(
_event_loop
),
dbus_glue
(
_event_loop
),
defer_mount
(
_event_loop
,
BIND_THIS_METHOD
(
DeferredMount
)),
defer_mount
(
_event_loop
,
BIND_THIS_METHOD
(
DeferredMount
)),
defer_unmount
(
_event_loop
,
BIND_THIS_METHOD
(
DeferredUnmount
))
{}
defer_unmount
(
_event_loop
,
BIND_THIS_METHOD
(
DeferredUnmount
))
{}
...
@@ -137,7 +141,10 @@ private:
...
@@ -137,7 +141,10 @@ private:
inline
void
inline
void
UdisksStorage
::
SetMountPoint
(
Path
mount_point
)
UdisksStorage
::
SetMountPoint
(
Path
mount_point
)
{
{
mounted_storage
=
CreateLocalStorage
(
mount_point
);
mounted_storage
=
inside_path
.
IsNull
()
?
CreateLocalStorage
(
mount_point
)
:
CreateLocalStorage
(
mount_point
/
inside_path
);
mount_error
=
{};
mount_error
=
{};
want_mount
=
false
;
want_mount
=
false
;
cond
.
broadcast
();
cond
.
broadcast
();
...
@@ -360,12 +367,17 @@ CreateUdisksStorageURI(EventLoop &event_loop, const char *base_uri)
...
@@ -360,12 +367,17 @@ CreateUdisksStorageURI(EventLoop &event_loop, const char *base_uri)
}
else
{
}
else
{
id
=
{
id_begin
,
relative_path
};
id
=
{
id_begin
,
relative_path
};
++
relative_path
;
++
relative_path
;
while
(
*
relative_path
==
'/'
)
++
relative_path
;
}
}
// TODO: use relative_path
auto
inside_path
=
*
relative_path
!=
0
?
AllocatedPath
::
FromUTF8Throw
(
relative_path
)
:
nullptr
;
return
std
::
make_unique
<
UdisksStorage
>
(
event_loop
,
base_uri
,
return
std
::
make_unique
<
UdisksStorage
>
(
event_loop
,
base_uri
,
std
::
move
(
id
));
std
::
move
(
id
),
std
::
move
(
inside_path
));
}
}
const
StoragePlugin
udisks_storage_plugin
=
{
const
StoragePlugin
udisks_storage_plugin
=
{
...
...
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