From 211054e73f0f90f2c290fc30d67978c5e375653b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 8 Sep 2015 01:50:05 +0000 Subject: [PATCH] [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 --- gb.dbus/src/gb.dbus/.project | 4 ++-- gb.dbus/src/gb.dbus/.src/DBus.class | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gb.dbus/src/gb.dbus/.project b/gb.dbus/src/gb.dbus/.project index d7e9f74ff..c851eee6c 100644 --- a/gb.dbus/src/gb.dbus/.project +++ b/gb.dbus/src/gb.dbus/.project @@ -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 diff --git a/gb.dbus/src/gb.dbus/.src/DBus.class b/gb.dbus/src/gb.dbus/.src/DBus.class index 0650c7640..4915911cf 100644 --- a/gb.dbus/src/gb.dbus/.src/DBus.class +++ b/gb.dbus/src/gb.dbus/.src/DBus.class @@ -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