]> git.saurik.com Git - wxWidgets.git/commitdiff
reverted the change of wxCmdLineEntryDesc fields to wxString as this doesn't compile...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 14 Sep 2007 21:05:12 +0000 (21:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 14 Sep 2007 21:05:12 +0000 (21:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/cmdline.h
src/common/appbase.cpp
src/common/appcmn.cpp
utils/wxrc/wxrc.cpp

index 9ad8f61b0c0b90374591638084c1ec14d3e698ca..8300f5c0c630dd3520b41a483be8a53b960587a5 100644 (file)
@@ -24,10 +24,13 @@ changes:
 
   b) Passing NULL as argument: as NULL can't be unambiguously converted to
      wxString, in many cases code using it won't compile any more and NULL
-     should be replaced with an empty string. The same issue also applies to
-     the structure fields which used to contain "const wxChar *" pointers (such
-     as wxCmdLineEntryDesc::shortName, longName and description fields) and are
-     now wxStrings: empty strings should be assigned to them instead of NULL.
+     should be replaced with an empty string.
+
+
+- Some structure fields which used to be of type "const wxChar *" (such as
+  wxCmdLineEntryDesc::shortName, longName and description fields) are now of
+  type "const char *", you need to remove wxT() or _T() around the values used
+  to initialize them (which should normally always be ASCII).
 
 
 
index fc5726d1da960f1eca937aa537b03f85fc3f2187..88ce4e51d311075eb52af7de540b1e34c1363b52 100644 (file)
@@ -64,13 +64,17 @@ enum wxCmdLineEntryType
 struct wxCmdLineEntryDesc
 {
     wxCmdLineEntryType kind;
-    wxString shortName;
-    wxString longName;
-    wxString description;
+    const char *shortName;
+    const char *longName;
+    const char *description;
     wxCmdLineParamType type;
     int flags;
 };
 
+// the list of wxCmdLineEntryDesc objects should be terminated with this one
+#define wxCMD_LINE_DESC_END \
+        { wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 }
+
 // ----------------------------------------------------------------------------
 // wxCmdLineParser is a class for parsing command line.
 //
index 8e819f62d1ca79cdc589f758312e19647c3d8204..66297871a4375928766f395b6ed7bb024a8b29ec 100644 (file)
@@ -485,7 +485,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 #if wxUSE_LOG
         {
             wxCMD_LINE_SWITCH,
-            "",
+            NULL,
             OPTION_VERBOSE,
             gettext_noop("generate verbose log messages"),
             wxCMD_LINE_VAL_NONE,
@@ -494,14 +494,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 #endif // wxUSE_LOG
 
         // terminator
-        {
-            wxCMD_LINE_NONE,
-            "",
-            "",
-            "",
-            wxCMD_LINE_VAL_NONE,
-            0x0
-        }
+        wxCMD_LINE_DESC_END
     };
 
     parser.SetDesc(cmdLineDesc);
index 421fff4699f8cb6814eedf8f309f554bc71460ed..789ebaad7040b8bdfafc4ddefc1b45b5eb942ac2 100644 (file)
@@ -203,7 +203,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
 #ifdef __WXUNIVERSAL__
         {
             wxCMD_LINE_OPTION,
-            "",
+            NULL,
             OPTION_THEME,
             gettext_noop("specify the theme to use"),
             wxCMD_LINE_VAL_STRING,
@@ -217,7 +217,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
         //     and not mgl/app.cpp
         {
             wxCMD_LINE_OPTION,
-            "",
+            NULL,
             OPTION_MODE,
             gettext_noop("specify display mode to use (e.g. 640x480-16)"),
             wxCMD_LINE_VAL_STRING,
@@ -226,14 +226,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
 #endif // __WXMGL__
 
         // terminator
-        {
-            wxCMD_LINE_NONE,
-            "",
-            "",
-            "",
-            wxCMD_LINE_VAL_NONE,
-            0x0
-        }
+        wxCMD_LINE_DESC_END
     };
 
     parser.SetDesc(cmdLineGUIDesc);
index 0ea1ebdc098c43eace40daacaba26393b89e8692..aa5e0476a17a96eca0594c9b3729be55f7d8a755 100644 (file)
@@ -253,11 +253,11 @@ int XmlResApp::OnRun()
 #if 0 // not yet implemented
         { wxCMD_LINE_OPTION, _T("l"), _T("list-of-handlers"),  _T("output list of necessary handlers to this file"), (wxCmdLineParamType)0, 0 },
 #endif
-        { wxCMD_LINE_PARAM,  "", "", _T("input file(s)"),
+        { wxCMD_LINE_PARAM,  NULL, NULL, _T("input file(s)"),
               wxCMD_LINE_VAL_STRING,
               wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
 
-        { wxCMD_LINE_NONE, "", "", "", (wxCmdLineParamType)0, 0 }
+        wxCMD_LINE_DESC_END 
     };
 
     wxCmdLineParser parser(cmdLineDesc, argc, argv);