diff options
author | Aki <please@ignore.pl> | 2022-04-07 00:27:27 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-07 00:27:27 +0200 |
commit | 4d2f305f191f3e39e28836262ca2029b39926e6a (patch) | |
tree | 8fe5fb7d6a7df06ead6d5e7c333760222f3b48e5 /StarsEx | |
parent | d8c1d5b840acc183e2cef112ebc6760952583f87 (diff) | |
download | starshatter-4d2f305f191f3e39e28836262ca2029b39926e6a.zip starshatter-4d2f305f191f3e39e28836262ca2029b39926e6a.tar.gz starshatter-4d2f305f191f3e39e28836262ca2029b39926e6a.tar.bz2 |
Removed unused WebBrowser launcher
Diffstat (limited to 'StarsEx')
-rw-r--r-- | StarsEx/CMakeLists.txt | 1 | ||||
-rw-r--r-- | StarsEx/Starshatter.cpp | 1 | ||||
-rw-r--r-- | StarsEx/WebBrowser.cpp | 131 | ||||
-rw-r--r-- | StarsEx/WebBrowser.h | 45 |
4 files changed, 0 insertions, 178 deletions
diff --git a/StarsEx/CMakeLists.txt b/StarsEx/CMakeLists.txt index f9deace..290c81c 100644 --- a/StarsEx/CMakeLists.txt +++ b/StarsEx/CMakeLists.txt @@ -266,7 +266,6 @@ add_library( WeaponDesign.cpp WeaponGroup.cpp Weather.cpp - WebBrowser.cpp WepView.cpp Window.cpp WndProc.cpp diff --git a/StarsEx/Starshatter.cpp b/StarsEx/Starshatter.cpp index 5121d33..894644b 100644 --- a/StarsEx/Starshatter.cpp +++ b/StarsEx/Starshatter.cpp @@ -111,7 +111,6 @@ #include "Universe.h" #include "Video.h" #include "VideoSettings.h" -#include "WebBrowser.h" // +--------------------------------------------------------------------+ diff --git a/StarsEx/WebBrowser.cpp b/StarsEx/WebBrowser.cpp deleted file mode 100644 index fba3d71..0000000 --- a/StarsEx/WebBrowser.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* Starshatter: The Open Source Project - Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors - Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors - Copyright (c) 1997-2006, Destroyer Studios LLC. - - AUTHOR: John DiCamillo - - - OVERVIEW - ======== - Helper class to find and launch user's default web browser -*/ - -#include "WebBrowser.h" - -// +--------------------------------------------------------------------+ - -WebBrowser::WebBrowser() -{ - FindDefaultBrowser(); - FindOpenCommand(); -} - -WebBrowser::~WebBrowser() -{ -} - -// +--------------------------------------------------------------------+ - - -void -WebBrowser::OpenURL(const char* url) -{ - if (url) { - char cmdline[256]; - - if (command.contains("%1")) { - strcpy_s(cmdline, command.replace("%1", url).data()); - } - else { - strcpy_s(cmdline, Text(command + " " + url).data()); - } - - STARTUPINFO s; - ZeroMemory(&s, sizeof(s)); - s.cb = sizeof(s); - - PROCESS_INFORMATION pi; - ZeroMemory(&pi, sizeof(pi)); - - if (CreateProcess(NULL, cmdline, 0, 0, 0, 0, 0, 0, &s, &pi)) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - else { - ::Print("Unable to launch web browser for url '%s'\n", url); - } - } -} - -// +--------------------------------------------------------------------+ - -void -WebBrowser::FindDefaultBrowser() -{ - HKEY hkey; - char value[256] = ""; - DWORD dwSize; - - ZeroMemory(value, 256); - - if (RegOpenKeyEx(HKEY_CLASSES_ROOT, - ".html", - 0, - KEY_READ, - &hkey) == ERROR_SUCCESS) { - - dwSize = 256; - RegQueryValueEx(hkey, - "", - NULL, - NULL, - (LPBYTE) value, - &dwSize); - - RegCloseKey(hkey); - - if (dwSize > 0) { - ::Print("Default Web Browser: %s\n", value); - browser = value; - } - } -} - -// +--------------------------------------------------------------------+ - -void -WebBrowser::FindOpenCommand() -{ - HKEY hkey; - char value[256] = ""; - DWORD dwSize; - - ZeroMemory(value, 256); - - if (RegOpenKeyEx(HKEY_CLASSES_ROOT, - browser + "\\shell\\open\\command", - 0, - KEY_READ, - &hkey) == ERROR_SUCCESS) { - - dwSize = 256; - RegQueryValueEx(hkey, - "", - NULL, - NULL, - (LPBYTE) value, - &dwSize); - - RegCloseKey(hkey); - - if (dwSize > 0) { - ::Print("Browser Shell Open Command: %s\n", value); - command = value; - } - } -} - -// +--------------------------------------------------------------------+ - - diff --git a/StarsEx/WebBrowser.h b/StarsEx/WebBrowser.h deleted file mode 100644 index 6ea731f..0000000 --- a/StarsEx/WebBrowser.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Starshatter: The Open Source Project - Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors - Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors - Copyright (c) 1997-2006, Destroyer Studios LLC. - - AUTHOR: John DiCamillo - - - OVERVIEW - ======== - Helper class to find and launch user's default web browser -*/ - -#ifndef WebBrowser_h -#define WebBrowser_h - -#include "Types.h" -#include "List.h" -#include "Text.h" - -// +--------------------------------------------------------------------+ - -class WebBrowser -{ -public: - static const char* TYPENAME() { return "WebBrowser"; } - - WebBrowser(); - virtual ~WebBrowser(); - - virtual void OpenURL(const char* url); - -protected: - void FindDefaultBrowser(); - void FindOpenCommand(); - - Text browser; - Text command; -}; - -// +--------------------------------------------------------------------+ - -#endif // WebBrowser_h - - |