summaryrefslogtreecommitdiff
path: root/src/modules/utils/openurl.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-13 16:55:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-13 16:55:17 +0000
commitcbe3cb21f5bca61a03bbd4ae811ee906e09b3f4f (patch)
tree4854fb66f4d59940efa3c1590237915851074dbf /src/modules/utils/openurl.cpp
parent351bcbec48ed77af5f8efcc4d5198707922c5d86 (diff)
- miranda32.exe now does nothing bug extends PATH to %miranda_root%\libs and loads mir_app.dll;
- everything that was in miranda32.exe (including resources) moved to mir_app.dll; - exports from mir_app.dll now available for using directly, without perversions; - src/stdplug.h deleted; git-svn-id: http://svn.miranda-ng.org/main/trunk@14143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/utils/openurl.cpp')
-rw-r--r--src/modules/utils/openurl.cpp82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp
deleted file mode 100644
index afbfa4681b..0000000000
--- a/src/modules/utils/openurl.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-#include <ctype.h>
-
-struct TOpenUrlInfo
-{
- TOpenUrlInfo(TCHAR *_url, int _bNew) :
- szUrl(_url),
- newWindow(_bNew)
- {}
-
- ptrT szUrl;
- int newWindow;
-};
-
-static void OpenURLThread(void *arg)
-{
- TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg;
-
- // wack a protocol on it
- CMString tszUrl;
- if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\')
- tszUrl.Format(_T("file:///%s"), hUrlInfo->szUrl);
- else {
- int i;
- for (i = 0; _istalpha(hUrlInfo->szUrl[i]); i++);
- if (hUrlInfo->szUrl[i] == ':')
- tszUrl = hUrlInfo->szUrl;
- else if (!_tcsnicmp(hUrlInfo->szUrl, _T("ftp."), 4))
- tszUrl.Format(_T("ftp://%s"), hUrlInfo->szUrl);
- else
- tszUrl.Format(_T("http://%s"), hUrlInfo->szUrl);
- }
-
- // check user defined browser for opening urls
- ptrT tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser"));
- if (tszBrowser)
- ShellExecute(NULL, _T("open"), tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
- else
- ShellExecute(NULL, _T("open"), tszUrl, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
-
- delete hUrlInfo;
-}
-
-static INT_PTR OpenURL(WPARAM wParam, LPARAM lParam)
-{
- if (lParam == 0)
- return 1;
-
- TOpenUrlInfo *hUrlInfo = new TOpenUrlInfo((wParam & OUF_UNICODE) ? mir_wstrdup((WCHAR*)lParam) : mir_a2t((char*)lParam), wParam & OUF_NEWWINDOW);
- forkthread(OpenURLThread, 0, hUrlInfo);
- return 0;
-}
-
-int InitOpenUrl(void)
-{
- CreateServiceFunction(MS_UTILS_OPENURL, OpenURL);
- return 0;
-}