[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:
parent
8304ddf53f
commit
211054e73f
2 changed files with 7 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
||||||
# Gambas Project File 3.0
|
# Gambas Project File 3.0
|
||||||
# Compiled with Gambas 3.8.0
|
# Compiled with Gambas 3.8.90
|
||||||
Title=gb.dbus
|
Title=gb.dbus
|
||||||
Startup=MMain
|
Startup=MMain
|
||||||
Version=3.8.0
|
Version=3.8.90
|
||||||
VersionFile=1
|
VersionFile=1
|
||||||
Component=gb.dbus
|
Component=gb.dbus
|
||||||
TabSize=2
|
TabSize=2
|
||||||
|
|
|
@ -36,7 +36,7 @@ Static Public Sub _get((Application) As String) As DBusApplication
|
||||||
|
|
||||||
End
|
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 sRes As String
|
||||||
Dim iInd As Integer
|
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)
|
sCar = Mid$(sName, iInd, 1)
|
||||||
If IsLetter(sCar) Then
|
If IsLetter(sCar) Then
|
||||||
If Not bKeepCase Then sCar = LCase(sCar)
|
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
|
Else
|
||||||
If Right(sRes) <> "." Then
|
If Right(sRes) <> "." Then
|
||||||
sCar = "."
|
sCar = "."
|
||||||
|
@ -91,13 +92,13 @@ End
|
||||||
Static Private Function Name_Read() As String
|
Static Private Function Name_Read() As String
|
||||||
|
|
||||||
If $sAppName Then Return $sAppName
|
If $sAppName Then Return $sAppName
|
||||||
Return "org.gambas." & _Normalize(Application.Name, True)
|
Return "org.gambas." & _Normalize(Application.Name, True, "-_")
|
||||||
|
|
||||||
End
|
End
|
||||||
|
|
||||||
Static Private Sub Name_Write(Value As String)
|
Static Private Sub Name_Write(Value As String)
|
||||||
|
|
||||||
$sAppName = _Normalize(Value, True)
|
$sAppName = _Normalize(Value, True, "-_")
|
||||||
|
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue