diff --git a/app/src/gambas3/.src/Component/CSymbolInfo.class b/app/src/gambas3/.src/Component/CSymbolInfo.class index 40fb5852c..932b50f31 100644 --- a/app/src/gambas3/.src/Component/CSymbolInfo.class +++ b/app/src/gambas3/.src/Component/CSymbolInfo.class @@ -90,6 +90,12 @@ Public Sub IsProperty() As Boolean End +Public Sub IsFunction() As Boolean + + Return InStr("mMx", Kind) > 0 + +End + Public Function GetIcon() As String Dim bStatic As Boolean diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index d0568c9dc..54ab703ab 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -3424,7 +3424,14 @@ Private Sub GetExpressionTypeWithEval(aSym As String[], aType As Integer[]) As S Else If aType[I] = Highlight.Symbol Then - sType = GetSymbolType(aSym[I]) + If I < aSym.Max And If aSym[I + 1] = "." Then + sType = GetSymbolType(aSym[I], True) + Else + sType = GetSymbolType(aSym[I]) + If $hSymbol And If $hSymbol.IsFunction() And If I < aSym.Max And If aSym[I + 1] = "(" Then + I = FindNextBracket(aSym, I, "(", ")") + Endif + Endif 'If $bLastStatic Then sType = "" Else If aType[I] = Highlight.Function Then diff --git a/app/src/gambas3/.src/MMime.module b/app/src/gambas3/.src/MMime.module index dd8275113..5c7f4213b 100644 --- a/app/src/gambas3/.src/MMime.module +++ b/app/src/gambas3/.src/MMime.module @@ -87,7 +87,7 @@ Public Sub GetMime(sPath As String) As String Return "application/zip" Case "html", "htm" Return "text/html" - Case "txt", "" + Case "txt", "", "am", "in", "sh", "m4" Return "text/plain" Case "avi" Return "video/x-msvideo" diff --git a/comp/src/gb.form/.project b/comp/src/gb.form/.project index fb8e2faf7..ea34cdb9c 100644 --- a/comp/src/gb.form/.project +++ b/comp/src/gb.form/.project @@ -1,5 +1,5 @@ # Gambas Project File 3.0 -# Compiled with Gambas 3.2.90 +# Compiled with Gambas 3.3.0 Title=More controls for graphical components Startup=FTabPanel Version=3.2.90 diff --git a/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class b/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class index 8c8fc83b4..174866783 100644 --- a/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class +++ b/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class @@ -206,8 +206,8 @@ Public Sub DrawingArea_MouseDown() hTabPanel._Close(GetIndex()) Else If $bSelected Then Return - hTabPanel.Index = GetIndex() Me.Parent.SetFocus() + hTabPanel.Index = GetIndex() Endif Endif diff --git a/gb.desktop/src/gb.desktop/.info b/gb.desktop/src/gb.desktop/.info index 8a1e2f2a3..be7626811 100644 --- a/gb.desktop/src/gb.desktop/.info +++ b/gb.desktop/src/gb.desktop/.info @@ -104,6 +104,10 @@ _init M +_compare +m +i +(hDesktopFile)DesktopFile; _new m diff --git a/gb.desktop/src/gb.desktop/.settings b/gb.desktop/src/gb.desktop/.settings index ea384c095..e8c14b176 100644 --- a/gb.desktop/src/gb.desktop/.settings +++ b/gb.desktop/src/gb.desktop/.settings @@ -24,10 +24,10 @@ SearchComment=False SearchString=True [OpenFile] -File[1]=".src/Desktop.class:362.0" +File[1]=".src/Desktop.class:219.24" File[2]=".src/DesktopWatcher.class:70.2" Active=3 -File[3]=".src/DesktopFile.class:66.0" +File[3]=".src/DesktopFile.class:296.7" File[4]=".src/Main.module:149.2" File[5]=".src/_DesktopIcons.class:16.0" File[6]=".src/DesktopWindow.class:152.0" diff --git a/gb.desktop/src/gb.desktop/.src/DesktopFile.class b/gb.desktop/src/gb.desktop/.src/DesktopFile.class index 63c50cfd6..735b57873 100644 --- a/gb.desktop/src/gb.desktop/.src/DesktopFile.class +++ b/gb.desktop/src/gb.desktop/.src/DesktopFile.class @@ -4,6 +4,7 @@ Export Class Stock +Static Private $aDataDir As String[] Static Private $aLang As String[] Static Private $aProgDir As String[] Static Private $cProgCache As New Collection @@ -58,6 +59,11 @@ Static Public Sub _init() End +Public Sub _compare(hDesktopFile As DesktopFile) As Integer + + Return String.Comp($sName, hDesktopFile.Name) + +End Public Sub _new(Path As String) @@ -192,6 +198,15 @@ Private Function ProgramName_Read() As String End +Static Private Sub GetDataDir() As String[] + + If Not $aDataDir Then $aDataDir = ["~/.local/share"].Insert(Split(Env["XDG_DATA_DIRS"], ":")) + Return $aDataDir + +End + + + Static Private Sub GetDesktopFileDirectories() As String[] Dim sDir As String @@ -200,7 +215,8 @@ Static Private Sub GetDesktopFileDirectories() As String[] If Not $aProgDir Then $aProgDir = New String[] - For Each sRoot In ["~/.local/share/applications", "/usr/share/applications"] + For Each sRoot In GetDataDir() + sRoot &/= "applications" $aProgDir.Add(sRoot) For Each sDir In RDir(sRoot, "*", gb.Directory) $aProgDir.Add(sRoot &/ sDir) @@ -263,6 +279,8 @@ Static Public Sub FindMime(MimeType As String) As DesktopFile[] Dim sList As String Dim aMime As String[] Dim sMime As String + Dim sDir As String + Dim sFound As String hProgList = $cMimeCache[MimeType] @@ -275,17 +293,23 @@ Static Public Sub FindMime(MimeType As String) As DesktopFile[] For Each sMime In aMime sList = "" - - If Desktop.Type = "LXDE" Then - If Not sList Then sList = FindInMimeInfoCache("~/.local/share/applications/mimeapps.list", sMime) - Endif - If Not sList Then sList = FindInMimeInfoCache("~/.local/share/applications/mimeinfo.cache", sMime) - If Desktop.Type = "LXDE" Then - If Not sList Then sList = FindInMimeInfoCache("/usr/share/applications/mimeapps.list", sMime) - Endif - If Not sList Then sList = FindInMimeInfoCache("/usr/share/applications/mimeinfo.cache", sMime) + 'Print "["; sMime; "]" + For Each sDir In GetDataDir() + sFound = FindInMimeInfoCache(sDir &/ "applications/mimeapps.list", sMime) + If sFound Then sList &= ";" & sFound + Next + + If Not sList Then + For Each sDir In GetDataDir() + sFound = FindInMimeInfoCache(sDir &/ "applications/mimeinfo.cache", sMime) + If sFound Then sList &= ";" & sFound + Next + Endif + + 'Print "--> "; sList + For Each sList In Split(sList, ";", "", True) hProg = DesktopFile[sList] If Not hProg Then hProg = DesktopFile[Replace(sList, "-", "/")] @@ -294,13 +318,14 @@ Static Public Sub FindMime(MimeType As String) As DesktopFile[] If hProgList.Exist(hProg) Then Continue hProgList.Add(hProg) Next + Next $cMimeCache[sMime] = hProgList Endif - Return hProgList + Return hProgList '.Sort() End