Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
e059e36d
Commit
e059e36d
authored
Jun 07, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/scripts/Utils/utils): provide a `getUriFromSystemPath` function
parent
796205cd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
FileChooserButton.qml
...ktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml
+2
-5
DroppableTextArea.qml
...hone-desktop/ui/modules/Common/Form/DroppableTextArea.qml
+1
-1
NotificationReceivedFileMessage.qml
...inphone/Notifications/NotificationReceivedFileMessage.qml
+1
-1
utils.js
linphone-desktop/ui/scripts/Utils/utils.js
+14
-1
No files found.
linphone-desktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml
View file @
e059e36d
...
...
@@ -75,14 +75,11 @@ TextField {
return
''
}
var
folder
=
Utils
.
dirname
(
textField
.
selectedFile
)
return
!
Utils
.
startsWith
(
folder
,
'
file:
'
)
?
'
file:
'
+
folder
:
folder
return
Utils
.
getUriFromSystemPath
(
Utils
.
dirname
(
textField
.
selectedFile
))
}
onAccepted
:
{
textField
.
selectedFile
=
Utils
.
getPathFromUri
(
fileUrl
)
textField
.
selectedFile
=
Utils
.
get
System
PathFromUri
(
fileUrl
)
textField
.
accepted
(
textField
.
selectedFile
)
}
...
...
linphone-desktop/ui/modules/Common/Form/DroppableTextArea.qml
View file @
e059e36d
...
...
@@ -29,7 +29,7 @@ Item {
// Filtering files, other urls are forbidden.
files
=
files
.
reduce
(
function
(
files
,
file
)
{
if
(
file
.
startsWith
(
'
file:
'
))
{
files
.
push
(
Utils
.
getPathFromUri
(
file
))
files
.
push
(
Utils
.
get
System
PathFromUri
(
file
))
}
return
files
...
...
linphone-desktop/ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml
View file @
e059e36d
...
...
@@ -71,7 +71,7 @@ Notification {
hoverEnabled
:
true
onClicked
:
notification
.
_close
(
function
()
{
Qt
.
openUrlExternally
(
'
file://
'
+
Utils
.
dirname
(
notification
.
_fileUri
))
Qt
.
openUrlExternally
(
Utils
.
getUriFromSystemPath
(
Utils
.
dirname
(
notification
.
_fileUri
)
))
})
}
}
...
...
linphone-desktop/ui/scripts/Utils/utils.js
View file @
e059e36d
...
...
@@ -155,7 +155,7 @@ function openWindow (window, parent, options) {
// -----------------------------------------------------------------------------
function
getPathFromUri
(
uri
)
{
function
get
System
PathFromUri
(
uri
)
{
var
str
=
uri
.
toString
()
if
(
startsWith
(
str
,
'
file://
'
))
{
str
=
str
.
substring
(
7
)
...
...
@@ -172,6 +172,19 @@ function getPathFromUri (uri) {
return
str
}
function
getUriFromSystemPath
(
path
)
{
if
(
path
.
startsWith
(
'
file://
'
))
{
return
path
}
var
os
=
Qt
.
platform
.
os
if
(
os
===
'
windows
'
||
os
===
'
winrt
'
)
{
return
'
file://
'
+
(
/^
[^
:
]
+:/
.
exec
(
path
)
?
''
:
'
/
'
)
}
return
'
file://
'
+
path
}
// -----------------------------------------------------------------------------
// Test if a point is in a item.
...
...
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