[GB.DBUS]

* BUG: Replace hyphens by dots in normalized interface names. But allow 
  them in application names (as well as underscores).


git-svn-id: svn://localhost/gambas/trunk@7289 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-09-08 01:50:05 +00:00
parent 8304ddf53f
commit 211054e73f
2 changed files with 7 additions and 6 deletions

View file

@ -1,8 +1,8 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.8.0
# Compiled with Gambas 3.8.90
Title=gb.dbus
Startup=MMain
Version=3.8.0
Version=3.8.90
VersionFile=1
Component=gb.dbus
TabSize=2

View file

@ -36,7 +36,7 @@ Static Public Sub _get((Application) As String) As DBusApplication
End
Static Public Sub _Normalize(sName As String, Optional bKeepCase As Boolean) As String
Static Public Sub _Normalize(sName As String, Optional bKeepCase As Boolean, Optional sMore As String) As String
Dim sRes As String
Dim iInd As Integer
@ -46,7 +46,8 @@ Static Public Sub _Normalize(sName As String, Optional bKeepCase As Boolean) As
sCar = Mid$(sName, iInd, 1)
If IsLetter(sCar) Then
If Not bKeepCase Then sCar = LCase(sCar)
Else If IsDigit(sCar) Or If InStr("-", sCar) Then
Else If IsDigit(sCar) Or If sCar = "_" Then
Else If InStr(sMore, sCar) Then
Else
If Right(sRes) <> "." Then
sCar = "."
@ -91,13 +92,13 @@ End
Static Private Function Name_Read() As String
If $sAppName Then Return $sAppName
Return "org.gambas." & _Normalize(Application.Name, True)
Return "org.gambas." & _Normalize(Application.Name, True, "-_")
End
Static Private Sub Name_Write(Value As String)
$sAppName = _Normalize(Value, True)
$sAppName = _Normalize(Value, True, "-_")
End