[DEVELOPMENT ENVIRONMENT]
* BUG: Some fixes in automatic variable declaration. [GB.DESKTOP] * BUG: $XDG_DATA_DIRS is now taken into account when browsing mime cache files. [GB.FORM] * BUG: Clicking on a TabPanel tab raises the Click event after taking the focus now. git-svn-id: svn://localhost/gambas/trunk@5152 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
c21ae3d19d
commit
006eb4dfd1
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -104,6 +104,10 @@ _init
|
||||
M
|
||||
|
||||
|
||||
_compare
|
||||
m
|
||||
i
|
||||
(hDesktopFile)DesktopFile;
|
||||
_new
|
||||
m
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user