From 6faa6fc510d28f4e912035674dbf22dec139fccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 8 Sep 2012 23:42:34 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Be more careful when renaming the code after a control rename. [GB.DESKTOP] * BUG: Search in LXDE mime info cache files first if the current desktop is LXDE. git-svn-id: svn://localhost/gambas/trunk@5144 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- .../gambas3/.src/Editor/Code/FEditor.class | 25 ++++++++++++++++++- gb.desktop/src/gb.desktop/.project | 2 +- .../src/gb.desktop/.src/DesktopFile.class | 14 ++++++++--- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index 34d83a84d..d0568c9dc 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -3185,6 +3185,7 @@ Public Sub RenameControl(sOld As String, sNew As String) Dim iInd As Integer Dim sSym As String Dim bChange As Boolean + Dim bInProc As Boolean sOld = UCase(sOld) @@ -3195,6 +3196,23 @@ Public Sub RenameControl(sOld As String, sNew As String) sLine = Editor.Lines[iLine].Text aSym = Highlight.Analyze(sLine) bChange = False + + If Not bInProc Then + If IsCurrentProc() Then + bInProc = True + Else + Continue + Endif + Else + If IsCurrentEndProc() Then + bInProc = False + Continue + Endif + Endif + + If aSym.Count Then + If aSym[0] = "Dim" Then Continue + Endif For iInd = aSym.Max DownTo 0 @@ -3206,7 +3224,12 @@ Public Sub RenameControl(sOld As String, sNew As String) If Not (sSym Begins (sOld & "_")) Then Continue Else If iInd > 0 Then - If aSym[iInd - 1] = "." Or If aSym[iInd - 1] = "!" Then Continue + sSym = aSym[iInd - 1] + If sSym = "." Then + If iInd <= 1 Or If aSym[iInd - 2] <> "ME" Then Continue + Else If sSym = "!" Or If sSym = "AS" Or If sSym = "NEW" Then + Continue + Endif Endif Endif diff --git a/gb.desktop/src/gb.desktop/.project b/gb.desktop/src/gb.desktop/.project index 4364be325..6039c2ba2 100644 --- a/gb.desktop/src/gb.desktop/.project +++ b/gb.desktop/src/gb.desktop/.project @@ -1,5 +1,5 @@ # Gambas Project File 3.0 -# Compiled with Gambas 3.2.90 +# Compiled with Gambas 3.3.0 Title=Desktop-neutral routines from Portland project Startup=Main Version=3.2.90 diff --git a/gb.desktop/src/gb.desktop/.src/DesktopFile.class b/gb.desktop/src/gb.desktop/.src/DesktopFile.class index 3a60185ae..63c50cfd6 100644 --- a/gb.desktop/src/gb.desktop/.src/DesktopFile.class +++ b/gb.desktop/src/gb.desktop/.src/DesktopFile.class @@ -140,6 +140,7 @@ Public Sub Run(sPath As String) sExec = Replace(sExec, "%u", sPath) sExec = Replace(sExec, "%F", sPath) sExec = Replace(sExec, "%f", sPath) + '' TODO: implement %i, %c & %k sExec = Replace(sExec, "%i", "") sExec = Replace(sExec, "%c", $sName) sExec = Replace(sExec, "%k", $sName) @@ -273,10 +274,17 @@ Static Public Sub FindMime(MimeType As String) As DesktopFile[] For Each sMime In aMime - sList = FindInMimeInfoCache("~/.local/share/applications/mimeinfo.cache", sMime) + 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) - If Not sList Then sList = FindInMimeInfoCache("~/.local/share/applications/mimeapps.list", sMime) - If Not sList Then sList = FindInMimeInfoCache("/usr/share/applications/mimeapps.list", sMime) For Each sList In Split(sList, ";", "", True) hProg = DesktopFile[sList]