Cleanup
This commit is contained in:
1 parent
2f457584d8
commit
def20e607b
3 files changed
+31
-37
No files matched your search
+29
-29
@@ -54,35 +54,6 @@ static char *GetExePath(void)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void DeleteProtocols(void)
|
||||
{
|
||||
#if defined (__WIN32)
|
||||
|
||||
HKEY hKey;
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open\\command"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open\\command"));
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open"));
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell"));
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T("URL Protocol"));
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart"));
|
||||
#elif defined (__unix__) || defined (UNIXCOMMON)
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
const char *homedir = pw->pw_dir;
|
||||
remove(va("%s/.local/share/applications/srb2kart-handler.desktop", homedir));
|
||||
#endif
|
||||
}
|
||||
|
||||
static boolean RegisterProtocols(const char *path)
|
||||
{
|
||||
#if defined (__WIN32)
|
||||
@@ -161,6 +132,35 @@ static boolean RegisterProtocols(const char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void DeleteProtocols(void)
|
||||
{
|
||||
#if defined (__WIN32)
|
||||
|
||||
HKEY hKey;
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open\\command"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open\\command"));
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell\\open"));
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart\\shell"));
|
||||
RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart"), 0, KEY_ALL_ACCESS, &hKey);
|
||||
RegDeleteValue(hKey, _T("URL Protocol"));
|
||||
RegDeleteValue(hKey, _T(""));
|
||||
RegCloseKey(hKey);
|
||||
RegDeleteKey(HKEY_CURRENT_USER, _T("Software\\Classes\\srb2kart"));
|
||||
#elif defined (__unix__) || defined (UNIXCOMMON)
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
const char *homedir = pw->pw_dir;
|
||||
remove(va("%s/.local/share/applications/srb2kart-handler.desktop", homedir));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (__WIN32)
|
||||
static HKEY OpenKey(HKEY hRootKey, const char* strKey)
|
||||
{
|
||||
|
||||
+1
-1
@@ -11,8 +11,8 @@
|
||||
|
||||
void D_SetupProtocol(void);
|
||||
|
||||
void D_DeleteProtocol(void);
|
||||
void D_CreateProtocol(void);
|
||||
void D_DeleteProtocol(void);
|
||||
#ifdef HAVE_CURL
|
||||
void D_DownloadReplay(const char *url, const char *path);
|
||||
#endif
|
||||
+1
-7
@@ -326,7 +326,6 @@ static void M_Addons(INT32 choice);
|
||||
static void M_AddonsOptions(INT32 choice);
|
||||
static patch_t *addonsp[NUM_EXT+5];
|
||||
|
||||
static void M_RegisterProtocol(void);
|
||||
static void M_DeleteProtocol(void);
|
||||
|
||||
#define numaddonsshown 4
|
||||
@@ -1429,7 +1428,7 @@ enum
|
||||
|
||||
static menuitem_t OP_ProtocolMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CALL, NULL, "Register protocol", M_RegisterProtocol, 10},
|
||||
{IT_STRING | IT_CALL, NULL, "Register protocol", D_CreateProtocol, 10},
|
||||
{IT_STRING | IT_CALL, NULL, "\x85" "Disable and delete protocols", M_DeleteProtocol, 20},
|
||||
};
|
||||
|
||||
@@ -9895,11 +9894,6 @@ static void M_ScreenshotOptions(INT32 choice)
|
||||
M_SetupNextMenu(&OP_ScreenshotOptionsDef);
|
||||
}
|
||||
|
||||
static void M_RegisterProtocol(void)
|
||||
{
|
||||
D_CreateProtocol();
|
||||
}
|
||||
|
||||
static void M_DeleteProtocol(void)
|
||||
{
|
||||
M_StartMessage("Are you sure you want to disable and delete protocol registers?\n"
|
||||
|
||||
Reference in new issue
Block a user