From 7fcc33b6f02d4d36c1e45051200921dbd9ec4e9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 12 Mar 2013 16:25:34 +0000 Subject: Yandex added to Scriver git-svn-id: http://svn.miranda-ng.org/main/trunk@3987 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/utils.cpp | 86 ++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 47 deletions(-) (limited to 'plugins/Scriver/src/utils.cpp') diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 8a69febd79..8822bf47f5 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -483,47 +483,45 @@ void SearchWord(TCHAR * word, int engine) //char *wordURL = (char *)CallService(MS_NETLIB_URLENCODE, 0, (LPARAM)wordUTF); char *wordURL = url_encode(wordUTF); switch (engine) { - case SEARCHENGINE_WIKIPEDIA: - mir_snprintf( szURL, sizeof( szURL ), "http://en.wikipedia.org/wiki/%s", wordURL ); - break; - case SEARCHENGINE_YAHOO: - mir_snprintf( szURL, sizeof( szURL ), "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL ); - break; - case SEARCHENGINE_FOODNETWORK: - mir_snprintf( szURL, sizeof( szURL ), "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL ); - break; - case SEARCHENGINE_BING: - mir_snprintf( szURL, sizeof( szURL ), "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL ); - break; - case SEARCHENGINE_GOOGLE_MAPS: - mir_snprintf( szURL, sizeof( szURL ), "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL ); - break; - case SEARCHENGINE_GOOGLE_TRANSLATE: - mir_snprintf( szURL, sizeof( szURL ), "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL ); - break; - case SEARCHENGINE_GOOGLE: - default: - mir_snprintf( szURL, sizeof( szURL ), "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL ); - break; + case SEARCHENGINE_WIKIPEDIA: + mir_snprintf(szURL, SIZEOF(szURL), "http://en.wikipedia.org/wiki/%s", wordURL); + break; + case SEARCHENGINE_YAHOO: + mir_snprintf(szURL, SIZEOF(szURL), "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL); + break; + case SEARCHENGINE_FOODNETWORK: + mir_snprintf(szURL, SIZEOF(szURL), "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL); + break; + case SEARCHENGINE_BING: + mir_snprintf(szURL, SIZEOF(szURL), "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL); + break; + case SEARCHENGINE_GOOGLE_MAPS: + mir_snprintf(szURL, SIZEOF(szURL), "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL); + break; + case SEARCHENGINE_GOOGLE_TRANSLATE: + mir_snprintf(szURL, SIZEOF(szURL), "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL); + break; + case SEARCHENGINE_YANDEX: + mir_snprintf(szURL, SIZEOF(szURL), "http://yandex.ru/yandsearch?text=%s", wordURL); + break; + case SEARCHENGINE_GOOGLE: + default: + mir_snprintf(szURL, SIZEOF(szURL), "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL); + break; } -// HeapFree(GetProcessHeap(), 0, wordURL); + mir_free(wordUTF); mir_free(wordURL); CallService(MS_UTILS_OPENURL, 1, (LPARAM) szURL); } } -void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList) { - int i; - for (i=0; ibuttonVisibility & (1 << i)) { - if (buttons[i].controlId != IDC_SMILEYS || g_dat->smileyAddInstalled) { - w += buttons[i].width + buttons[i].spacing; - } -// } - } + int w = 0; + for (int i = 0; i < cControls; i++) + if (buttons[i].controlId != IDC_SMILEYS || g_dat->smileyAddInstalled) + w += buttons[i].width + buttons[i].spacing; + return w; } BOOL IsToolbarVisible(int cControls, int visibilityFlags) { - int i; - for (i = 0; i < cControls; i++) { - if (visibilityFlags & (1 << i)) { + for (int i = 0; i < cControls; i++) + if (visibilityFlags & (1 << i)) return TRUE; - } - } + return FALSE; } -- cgit v1.2.3