Update of /cvsroot/audacity/audacity-src/src/commands
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19161/src/commands

Modified Files:
        CommandManager.cpp CommandManager.h 
Log Message:
Changed duplicate key combo check.

Index: CommandManager.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/commands/CommandManager.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- CommandManager.h    3 Apr 2009 05:18:26 -0000       1.24
+++ CommandManager.h    25 Apr 2009 19:19:39 -0000      1.25
@@ -157,6 +157,10 @@
    wxString GetKeyFromName(wxString name);
    wxString GetDefaultKeyFromName(wxString name);
 
+#if defined(__WXDEBUG__)
+   void CheckDups();
+#endif
+
    //
    // Loading/Saving
    //

Index: CommandManager.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/commands/CommandManager.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- CommandManager.cpp  6 Apr 2009 07:01:42 -0000       1.67
+++ CommandManager.cpp  25 Apr 2009 19:19:39 -0000      1.68
@@ -652,8 +652,6 @@
 
 wxString CommandManager::GetKey(wxString label)
 {
-   int loc;
-
    wxString key = label.AfterFirst(wxT('\t')).BeforeFirst(wxT('\t'));
    if (key.IsEmpty()) {
       return key;
@@ -661,20 +659,6 @@
 
    key = KeyStringNormalize(key);
 
-#if defined(__WXDEBUG__)
-   if (label.AfterLast(wxT('\t')) != wxT("allowdup")) {
-      for (size_t i = 0; i < mCommandList.GetCount(); i++) {
-         if (mCommandList[i]->key == key) {
-            wxLogDebug(wxT("key combo '%s' assigned to '%s' and '%s'"),
-                      key.c_str(),
-                      mCommandList[i]->label.BeforeFirst(wxT('\t')).c_str(),
-                      label.BeforeFirst(wxT('\t')).c_str());
-            wxASSERT(mCommandList[i]->key != key);
-         }
-      }
-   }
-#endif
-
    return key;
 }
 
@@ -1166,6 +1150,37 @@
    va_end(list);
 }
 
+#if defined(__WXDEBUG__)
+void CommandManager::CheckDups()
+{
+   int cnt = mCommandList.GetCount();
+   for (size_t j = 0;  j < cnt; j++) {
+      if (mCommandList[j]->key.IsEmpty()) {
+         continue;
+      }
+
+      if (mCommandList[j]->label.AfterLast(wxT('\t')) == wxT("allowdup")) {
+         continue;
+      }
+
+      for (size_t i = 0; i < cnt; i++) {
+         if (i == j) {
+            continue;
+         }
+
+         if (mCommandList[i]->key == mCommandList[j]->key) {
+            wxString msg;
+            msg.Printf(wxT("key combo '%s' assigned to '%s' and '%s'"),
+                       mCommandList[i]->key.c_str(),
+                       mCommandList[i]->label.BeforeFirst(wxT('\t')).c_str(),
+                       mCommandList[j]->label.BeforeFirst(wxT('\t')).c_str());
+            wxASSERT_MSG(mCommandList[i]->key != mCommandList[j]->key, msg);
+         }
+      }
+   }
+}
+#endif
+
 // Indentation settings for Vim and Emacs and unique identifier for Arch, a
 // version control system. Please do not modify past this point.
 //


------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to