[GB.DESKTOP]

* BUG: Fix the algorithm that returns the desktop path.

[GB.WEB]
* BUG: Remove log messages, but log session loading error in the
  /tmp/session.log file.


git-svn-id: svn://localhost/gambas/trunk@1668 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2008-11-02 13:59:06 +00:00
parent 11f6575f51
commit 408839f5c3
6 changed files with 43 additions and 50 deletions

1
TODO
View file

@ -72,6 +72,7 @@ GUI RELATED STUFF
- Form.KeyPreview
- Control.HasFocus
- Window.Menus.Hide
- GridView.Cell.WordWrap
QT4 COMPONENT

View file

@ -168,10 +168,6 @@ Timeout
P
f
Save
M
_init
M
@ -192,6 +188,10 @@ _put
M
(Value)v(Key)s
Save
M
Load
M

View file

@ -145,7 +145,7 @@ Private Sub SaveSession()
LockSession
Main.Log("SaveSession: " & $sPath & ": Just update time stamp : " & Exist($sPath))
'Main.Log("SaveSession: " & $sPath & ": Just update time stamp : " & Exist($sPath))
hFile = Open $sPath For Write
Write #hFile, CFloat(Now)
Close #hFile
@ -154,7 +154,7 @@ Private Sub SaveSession()
Else
Main.Log("SaveSession: " & $sPath & ": Save all session : " & Exist($sPath))
'Main.Log("SaveSession: " & $sPath & ": Save all session : " & Exist($sPath))
hFile = Open sTemp For Write Create
Write #hFile, CFloat(Now)
@ -173,11 +173,11 @@ Private Sub SaveSession()
Endif
If Exist($sPath) Then
Main.Log("SaveSession: " & $sPath & " (" & Stat($sPath).Size & ")")
Else
Main.Log("SaveSession: " & $sPath & " NOT FOUND!")
Endif
' If Exist($sPath) Then
' Main.Log("SaveSession: " & $sPath & " (" & Stat($sPath).Size & ")")
' Else
' Main.Log("SaveSession: " & $sPath & " NOT FOUND!")
' Endif
End
@ -295,9 +295,10 @@ Private Sub LoadSession()
Catch
Try File.Save(File.Dir($sPath) &/ "session.error", Error.Where & ": " & Error.Text & "\n")
Try Kill $sPath & ".error"
Try Copy $sPath To $sPath & ".error"
Main.Log("LoadSession: " & $sId & ": " & Error.Where & ": " & Error.Text)
'Try File.Save(File.Dir($sPath) &/ "session.error", Error.Where & ": " & Error.Text & "\n")
'Try Kill $sPath & ".error"
'Try Copy $sPath To $sPath & ".error"
_ABANDON:

View file

@ -1,7 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 2.99.0 (r1601)
Startup=Form2
Version=0.0.58
# Compiled with Gambas 2.99.0 (r1645)
Startup=Main
Version=0.0.59
Component=gb.qt
Component=gb.form
Component=gb.desktop

View file

@ -12,15 +12,15 @@ SearchComment=False
SearchString=True
[OpenFile]
File[1]="Desktop.class:12.0"
File[1]="Desktop.class:343.23"
Fold[1]=[]
File[2]="Main.module:135.0"
Active=2
File[2]="Main.module:115.0"
Fold[2]=[]
File[3]="_DesktopVirtual.class:0.0"
Fold[3]=[]
File[4]="_DesktopWindows.class:48.2"
Fold[4]=[]
Active=5
File[5]="DesktopWindow.class:237.38"
Fold[5]=[]
File[6]="Atom.class:0.0"

View file

@ -50,13 +50,21 @@ End
Private Function SearchPathConfig(sXdgConfigHome As String, sXdgConfigDirs As String) As String
If Exist(sXdgConfigHome & "/user-dirs.dirs") Then ' Devrait exister
Return sXdgConfigHome & "/user-dirs.dirs"
Else If Exist(sXdgConfigDirs & "/user-dirs.defaults") Then ' Sinon l'un
Return sXdgConfigDirs & "/user-dirs.defaults"
Else If Exist(sXdgConfigDirs & "/user-dirs.dirs") Then ' Ou l'autre
Return sXdgConfigDirs & "/user-dirs.dirs"
Endif
Dim sDir As String
For Each sDir In Split(sXdgConfigHome, ":")
If Exist(sDir &/ "user-dirs.dirs") Then ' Devrait exister
Return sDir &/ "user-dirs.dirs"
Endif
Next
For Each sDir In Split(sXdgConfigDirs, ":")
If Exist(sDir &/ "user-dirs.defaults") Then ' Sinon l'un
Return sDir &/ "user-dirs.defaults"
Else If Exist(sDir &/ "user-dirs.dirs") Then ' Ou l'autre
Return sDir &/ "user-dirs.dirs"
Endif
Next
End
@ -99,7 +107,11 @@ Public Sub GetDesktopPath() As String
If Not sXdgConfigDirs Then sXdgConfigDirs = "/etc/xdg" ' Sinon val. par défaut
sFileConfig = SearchPathConfig(sXdgConfigHome, sXdgConfigDirs)
sDir = SearchPathVariable(sFileConfig, "XDG_DESKTOP_DIR")
If sFileConfig Then
sDir = SearchPathVariable(sFileConfig, "XDG_DESKTOP_DIR")
Else
sDir = System.User.Home &/ "Desktop"
Endif
Return sDir
@ -108,28 +120,7 @@ End
Public Sub Main()
' Dim hWindow As DesktopWindow
'
' For Each hWindow In Desktop.Windows
' Print Hex$(hWindow.Id);; hWindow.VisibleName
' Next
' Dim iInd As Integer
'
' For iInd = 0 To Desktop.Count - 1
' With Desktop[iInd]
' Print .Name;; .X;; .Y;; .Width;; .Height
' End With
' Next
'Desktop.Passwords["Test"] = "barbapapa"
'Print Desktop.Passwords["Test"]
Dim hDesktopWatcher As DesktopWatcher
hDesktopWatcher = New DesktopWatcher As "Desktop"
Form2.Show
Print Desktop.Path
End