Skip to content

Commit

Permalink
fix: 完善配置锁
Browse files Browse the repository at this point in the history
  • Loading branch information
snomiao committed Apr 11, 2021
1 parent 790d5b4 commit 654d201
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Tools/new-version*.txt
*.user.ahk
*.user.md
*.user.ignores
*.user.ignores.txt
1 change: 1 addition & 0 deletions Core/CapsLockX-Update.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ global T_DownloadUpdate := CapsLockX_Config("Core", "T_DownloadUpdate", 1, "自
global CLXU_Updated :=1
global CLXU_Fail := 2
global CLXU_AlreadyLatest := 4
Sleep, 5000
if(T_CheckUpdate)
CapsLockX_检查更新()
Sleep, 5000
Expand Down
13 changes: 11 additions & 2 deletions Core/CapslockX-Config.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; 保存为 save with UTF8 with DOM

if (!!CapsLockXConfigPath){
CapsLockX_Config("_NOTICE_", "ENCODING_USING", "UTF16_LE", "")
清洗为_UTF16_WITH_BOM_型编码(CapsLockXConfigPath)
; 基本设定
; [Core]
Expand All @@ -23,13 +24,21 @@ if (!!CapsLockXConfigPath){
}

清洗为_UTF16_WITH_BOM_型编码(path){
FileRead CLX配置锁状态, CapsLockX_Config.lock
if(CLX配置锁状态){
return
}
static 锁 := 0
if(锁)
Return
锁 := 1
FileAppend, 1, CapsLockX_Config.lock
FileRead ModuleCode, %path%
FileDelete %path%
FileAppend %ModuleCode%, %path%, UTF-16
if(ModuleCode){
FileDelete %path%
FileAppend %ModuleCode%, %path%, UTF-16
}
FileDelete, CapsLockX_Config.lock
锁 := 0
}
CapsLockX_ConfigSet(field, varName, setValue, comment := ""){
Expand Down
2 changes: 1 addition & 1 deletion Modules/应用-定时任务.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Return
; IfMsgBox, Cancel
; return

global T_ScheduleTasks_UsingHighPerformanceTime := CapsLockX_Config("ScheduleTasks", "T_UsingHighPerformanceTime", "0", "")
global T_ScheduleTasks_UsingHighPerformanceTime := CapsLockX_Config("ScheduleTasks", "T_UsingHighPerformanceTime", "0", "已经配置过高精度时间的Flag")
if(T_ScheduleTasks_UsingHighPerformanceTime)
return
ToolTip, 定时任务开启,正在为您配置系统高精度时间
Expand Down

0 comments on commit 654d201

Please sign in to comment.