Skip to content

Commit e7d4655

Browse files
committed
3.8.2
Fix initial settings for copy/paste method
1 parent 175f273 commit e7d4655

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

Charu3.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ END
925925
//
926926

927927
VS_VERSION_INFO VERSIONINFO
928-
FILEVERSION 3,8,1,0
929-
PRODUCTVERSION 3,8,1,0
928+
FILEVERSION 3,8,2,0
929+
PRODUCTVERSION 3,8,2,0
930930
FILEFLAGSMASK 0x3fL
931931
#ifdef _DEBUG
932932
FILEFLAGS 0x1L
@@ -944,12 +944,12 @@ BEGIN
944944
VALUE "Comments", "Text input assistant"
945945
VALUE "CompanyName", "C+ Factory / Itagaki Fumihiko"
946946
VALUE "FileDescription", "Charu3(Clipbord and High Amenity Routine for Utility 3) Successor Edition"
947-
VALUE "FileVersion", "3.8.1.0"
947+
VALUE "FileVersion", "3.8.2.0"
948948
VALUE "InternalName", "Charu3 SE"
949949
VALUE "LegalCopyright", "Copyright (C) 1998-2003 matsumoto keizi, 2021-2023 Itagaki Fumihiko"
950950
VALUE "OriginalFilename", "Charu3.EXE"
951951
VALUE "ProductName", "Charu3 SE"
952-
VALUE "ProductVersion", "3.8.1.0"
952+
VALUE "ProductVersion", "3.8.2.0"
953953
END
954954
END
955955
BLOCK "VarFileInfo"

Init.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace {
2626
{
2727
nlohmann::json snippets;
2828
try { snippets = nlohmann::json::parse(std::ifstream(filePath)); }
29-
catch (...) {}
29+
catch (...) { snippets = nlohmann::json(); }
3030
for (nlohmann::json::iterator it = snippets.begin(); it != snippets.end(); it++) {
3131
nlohmann::json jnode = it.value();
3232
MACRO_STRUCT snippet;
@@ -115,7 +115,7 @@ void CInit::initialize()
115115

116116
// read state
117117
try { m_state = nlohmann::json::parse(std::ifstream(m_strStateFile)); }
118-
catch (...) {}
118+
catch (...) { m_state = nlohmann::json(); }
119119

120120
m_strDataPath = CGeneral::getSettingCString(m_state, "data.path", _T(""));
121121
m_strDataFormat = CGeneral::getSettingCString(m_state, "data.format", DAT_FORMAT);
@@ -135,7 +135,7 @@ void CInit::initialize()
135135

136136
// read settings
137137
try { m_settings = nlohmann::json::parse(std::ifstream(m_strSettingsFile)); }
138-
catch (...) {}
138+
catch (...) { m_settings = nlohmann::json(); }
139139

140140
m_etc.m_bPutBackClipboard = CGeneral::getSettingBool(m_settings, "clipboard.putBackAfterPasting", false);
141141
m_nClipboardOpenDelay = static_cast<int>(CGeneral::getSettingNumber(m_settings, "clipboard.openDelay", 0));

Init.h

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,28 +129,36 @@ struct COPYPASTE_KEY
129129

130130
COPYPASTE_KEY()
131131
: m_nMessage(0)
132-
, m_uMod_Paste(0)
133-
, m_uVK_Paste(0)
134-
, m_uMod_Copy(0)
135-
, m_uVK_Copy(0)
132+
, m_uMod_Paste(MOD_CONTROL)
133+
, m_uVK_Paste('V')
134+
, m_uMod_Copy(MOD_CONTROL)
135+
, m_uVK_Copy('C')
136136
, m_copyMessage(WINDOWS_MESSAGE())
137137
, m_pasteMessage(WINDOWS_MESSAGE())
138-
, m_nCopyWait(0)
139-
, m_nPasteWait(0)
138+
, m_nCopyWait(50)
139+
, m_nPasteWait(50)
140140
{
141141
}
142142

143143
COPYPASTE_KEY(nlohmann::json& obj)
144+
: m_nMessage(0)
145+
, m_uMod_Paste(MOD_CONTROL)
146+
, m_uVK_Paste('V')
147+
, m_uMod_Copy(MOD_CONTROL)
148+
, m_uVK_Copy('C')
149+
, m_copyMessage(WINDOWS_MESSAGE())
150+
, m_pasteMessage(WINDOWS_MESSAGE())
151+
, m_nCopyWait(50)
152+
, m_nPasteWait(50)
144153
{
145-
COPYPASTE_KEY();
146154
if (obj.is_object()) {
147155
m_nMessage = static_cast<int>(CGeneral::getSettingNumber(obj, "method", 0));
148-
m_uMod_Copy = static_cast<UINT>(CGeneral::getSettingNumber(obj, "copy.keyCode", 0));
149-
m_uVK_Copy = static_cast<UINT>(CGeneral::getSettingNumber(obj, "copy.keyModifier", 0));
150-
m_nCopyWait = static_cast<int>(CGeneral::getSettingNumber(obj, "copy.delay", 0));
151-
m_uMod_Paste = static_cast<UINT>(CGeneral::getSettingNumber(obj, "paste.keyCode", 0));
152-
m_uVK_Paste = static_cast<UINT>(CGeneral::getSettingNumber(obj, "paste.keyModifier", 0));
153-
m_nPasteWait = static_cast<int>(CGeneral::getSettingNumber(obj, "paste.delay", 0));
156+
m_uMod_Copy = static_cast<UINT>(CGeneral::getSettingNumber(obj, "copy.keyCode", 'C'));
157+
m_uVK_Copy = static_cast<UINT>(CGeneral::getSettingNumber(obj, "copy.keyModifier", MOD_CONTROL));
158+
m_nCopyWait = static_cast<int>(CGeneral::getSettingNumber(obj, "copy.delay", 50));
159+
m_uMod_Paste = static_cast<UINT>(CGeneral::getSettingNumber(obj, "paste.keyCode", 'V'));
160+
m_uVK_Paste = static_cast<UINT>(CGeneral::getSettingNumber(obj, "paste.keyModifier", MOD_CONTROL));
161+
m_nPasteWait = static_cast<int>(CGeneral::getSettingNumber(obj, "paste.delay", 50));
154162

155163
nlohmann::json msg;
156164
msg = obj["copy.message"];

0 commit comments

Comments
 (0)