From 2fb2679db9cb1f3bb3128a4cac638c1d2b53984c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 13 Nov 2013 20:57:16 +0000 Subject: [PATCH] * desktop.cc (STARTMENUDIR): Define. (check_startmenu): Use STARTMENUDIR instead of constant string. (DesktopSetupPage::OnActivate): Use TARGET and TERMINALTITLE defines to simplify calls to check_startmenu and check_desktop. --- ChangeLog | 7 +++++++ desktop.cc | 13 ++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ff0276a..6ffc0cd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-11-13 Corinna Vinschen + + * desktop.cc (STARTMENUDIR): Define. + (check_startmenu): Use STARTMENUDIR instead of constant string. + (DesktopSetupPage::OnActivate): Use TARGET and TERMINALTITLE defines + to simplify calls to check_startmenu and check_desktop. + 2013-11-13 Corinna Vinschen * desktop.cc: Drop dependency on static variable and order of diff --git a/desktop.cc b/desktop.cc index 8813f57c..819a3a73 100644 --- a/desktop.cc +++ b/desktop.cc @@ -221,6 +221,7 @@ save_icon (std::string &iconpath, const char *resource_name) #define TERMINALICON "/Cygwin-Terminal.ico" #define TERMINALTITLE (is_64bit ? "Cygwin64 Terminal" \ : "Cygwin Terminal") +#define STARTMENUDIR "/Cygwin" static void do_desktop_setup () @@ -348,7 +349,7 @@ check_startmenu (const std::string title, const std::string target) msg ("Program directory for program link changed to: %s", path); } // end of Win95 addition - strcat (path, "/Cygwin"); + strcat (path, STARTMENUDIR); std::string fname = std::string(path) + "/" + title + ".lnk"; if (_access (fname.c_str(), 0) == 0) @@ -405,15 +406,15 @@ DesktopSetupPage::OnActivate () } else { + std::string target = backslash (cygpath (TARGET)); + if (NoStartMenuOption) { root_menu = 0; } else { - root_menu = check_startmenu (is_64bit ? "Cygwin64 Terminal" - : "Cygwin Terminal", - backslash (cygpath ("/bin/mintty"))); + root_menu = check_startmenu (TERMINALTITLE, target); } if (NoDesktopOption) @@ -422,9 +423,7 @@ DesktopSetupPage::OnActivate () } else { - root_desktop = check_desktop (is_64bit ? "Cygwin64 Terminal" - : "Cygwin Terminal", - backslash (cygpath ("/bin/mintty"))); + root_desktop = check_desktop (TERMINALTITLE, target); } } -- 2.43.5