OSDN Git Service

Rename CProfile::GetApplicaionIndex with one argument GetAppIndex
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Mon, 11 Jul 2011 02:00:32 +0000 (11:00 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Wed, 13 Jul 2011 05:28:24 +0000 (14:28 +0900)
and change its argument to LPCSTR.

xkeymacs/profile.cpp
xkeymacs/profile.h
xkeymacs/properties.cpp

index 0f52fe4..60f9f5e 100644 (file)
@@ -990,7 +990,7 @@ int CProfile::GetApplicationIndex(const CString szApplicationName, const BOOL bS
 {\r
        if (!bSaveAndValidate) // SetDialogData\r
                *nSettingStyle = SETTING_UNDEFINED;\r
-       int nAppID = GetApplicationIndex(szApplicationName);\r
+       int nAppID = GetAppID(szApplicationName);\r
        if (nAppID == MAX_APP) {\r
                if (bSaveAndValidate) { // GetDialogData\r
                        for (nAppID = 0; nAppID < MAX_APP; ++nAppID)\r
@@ -1200,7 +1200,7 @@ void CProfile::CopyData(const CString szDstApp, const CString szSrcApp)
 {\r
        int nSettingStyle = SETTING_SPECIFIC;\r
        const int nDstApp = GetApplicationIndex(szDstApp, TRUE, &nSettingStyle);\r
-       const int nSrcApp = GetApplicationIndex(szSrcApp);\r
+       const int nSrcApp = GetAppID(szSrcApp);\r
 \r
 #define CopyMember(member) CopyMemory(&m_Config. ## member ## [nDstApp], &m_Config. ## member ## [nSrcApp], sizeof(m_Config. ## member ## [nSrcApp]))\r
        CopyMember(b326Compatible);\r
@@ -1216,11 +1216,11 @@ void CProfile::CopyData(const CString szDstApp, const CString szSrcApp)
 \r
 // return application index\r
 // if there is NOT the application in the data, return MAX_APP\r
-int CProfile::GetApplicationIndex(const CString szApplicationName)\r
+int CProfile::GetAppID(const LPCSTR szAppName)\r
 {\r
        int nAppID = 0;\r
        for (nAppID = 0; nAppID < MAX_APP; ++nAppID)\r
-               if (szApplicationName == m_Config.szSpecialApp[nAppID])\r
+               if (!_tcscmp(szAppName, m_Config.szSpecialApp[nAppID]))\r
                        break;\r
        return nAppID;\r
 }\r
index 0b1c961..8687256 100644 (file)
@@ -42,7 +42,7 @@ public:
        static BOOL IsDialog(CString sz);\r
        static BOOL GetUseDialogSetting(int nAppID);\r
        static void SetUseDialogSetting(int nAppID, BOOL bUseDialogSetting);\r
-       static int GetApplicationIndex(CString szApplicationName);\r
+       static int GetAppID(const LPCSTR szAppName);\r
        static void CopyData(CString szDestinationApplication, CString szSourceApplication);\r
        static void ReadKeyBind(int& pnCommandType, int& pnKey, LPCTSTR szKeyBind);\r
        static LPCTSTR Key2String(int nKey);\r
index 226df1d..ad606cf 100644 (file)
@@ -303,7 +303,7 @@ void CProperties::OnSettingSpecific()
        UpdateData();\r
        EnableControl(ACTIVE_TAB);\r
 \r
-       if (CProfile::GetApplicationIndex(m_szCurrentApplication) == MAX_APP) {\r
+       if (CProfile::GetAppID(m_szCurrentApplication) == MAX_APP) {\r
                CProfile::CopyData(m_szCurrentApplication, CString(MAKEINTRESOURCE(IDS_DEFAULT)));\r
                SetDialogData();\r
        }\r