From 408839f5c3351344651424449b0e172e72e0df80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 2 Nov 2008 13:59:06 +0000 Subject: [PATCH] [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 --- TODO | 1 + comp/src/gb.web/.info | 8 ++--- comp/src/gb.web/Session.module | 21 +++++------ gb.desktop/src/gb.desktop/.project | 6 ++-- gb.desktop/src/gb.desktop/.settings | 6 ++-- gb.desktop/src/gb.desktop/Main.module | 51 +++++++++++---------------- 6 files changed, 43 insertions(+), 50 deletions(-) diff --git a/TODO b/TODO index 8b16fe0e8..3a25d2542 100644 --- a/TODO +++ b/TODO @@ -72,6 +72,7 @@ GUI RELATED STUFF - Form.KeyPreview - Control.HasFocus - Window.Menus.Hide +- GridView.Cell.WordWrap QT4 COMPONENT diff --git a/comp/src/gb.web/.info b/comp/src/gb.web/.info index 9fb1be618..9743b83f6 100644 --- a/comp/src/gb.web/.info +++ b/comp/src/gb.web/.info @@ -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 diff --git a/comp/src/gb.web/Session.module b/comp/src/gb.web/Session.module index dec17d477..c7966e734 100644 --- a/comp/src/gb.web/Session.module +++ b/comp/src/gb.web/Session.module @@ -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: diff --git a/gb.desktop/src/gb.desktop/.project b/gb.desktop/src/gb.desktop/.project index e097b0bae..0c872fa75 100644 --- a/gb.desktop/src/gb.desktop/.project +++ b/gb.desktop/src/gb.desktop/.project @@ -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 diff --git a/gb.desktop/src/gb.desktop/.settings b/gb.desktop/src/gb.desktop/.settings index ada9a53f5..32eb34be5 100644 --- a/gb.desktop/src/gb.desktop/.settings +++ b/gb.desktop/src/gb.desktop/.settings @@ -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" diff --git a/gb.desktop/src/gb.desktop/Main.module b/gb.desktop/src/gb.desktop/Main.module index 00873870e..4e7627d35 100644 --- a/gb.desktop/src/gb.desktop/Main.module +++ b/gb.desktop/src/gb.desktop/Main.module @@ -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