Update of /cvsroot/audacity/audacity-src/src/commands
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv959/commands

Modified Files:
        CommandManager.cpp CommandManager.h 
Log Message:
1) Rework of XML file writing.
2) Cleaned up old (FROM)FILENAME() macro usage and added OSFILENAME() usage 
only where needed.
3) Removed Mac specific filename encodings as it's handled by WX now.
4) Fixed a couple of missing wxT()s (one resulted in a day or so debugging 
session ;-)).
5) Commented all PACKAGE_* macros in configtemplate.h as they conflict with the 
latest SoundTouch.


Index: CommandManager.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/commands/CommandManager.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- CommandManager.h    29 Jun 2006 09:35:26 -0000      1.13
+++ CommandManager.h    23 Sep 2006 02:26:08 -0000      1.14
@@ -150,7 +150,7 @@
    virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
    virtual void HandleXMLEndTag(const wxChar *tag);
    virtual XMLTagHandler *HandleXMLChild(const wxChar *tag);
-   virtual void WriteXML(int depth, FILE *fp);
+   virtual void WriteXML(XMLWriter &xmlFile);
 
  protected:
 

Index: CommandManager.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/commands/CommandManager.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- CommandManager.cpp  7 Jul 2006 11:22:01 -0000       1.34
+++ CommandManager.cpp  23 Sep 2006 02:26:08 -0000      1.35
@@ -849,31 +849,29 @@
    return this;
 }
 
-void CommandManager::WriteXML(int depth, FILE *fp)
+void CommandManager::WriteXML(XMLWriter &xmlFile)
 {
    int i;
    unsigned int j;
 
-   for(i=0; i<depth; i++)
-      fprintf(fp, "\t");
-   fprintf(fp, "<audacitykeyboard audacityversion=\"%s\">\n",
-           AUDACITY_VERSION_STRING);
-   for(j=0; j<mCommandList.GetCount(); j++)
+   xmlFile.StartTag(wxT("audacitykeyboard"));
+   xmlFile.WriteAttr(wxT("audacityversion"), wxT(AUDACITY_VERSION_STRING));
+
+   for(j=0; j<mCommandList.GetCount(); j++) {
       if (!mCommandList[j]->multi) {
-         for(i=0; i<depth+1; i++)
-            fprintf(fp, "\t");
          
          wxString label = mCommandList[j]->label;
          label = wxMenuItem::GetLabelFromText(label.BeforeFirst(wxT('\t')));
          
-         fprintf(fp, "<command name=\"%s\" label=\"%s\" key=\"%s\" />\n",
-                 (const char *)XMLEsc(mCommandList[j]->name).mb_str(),
-                 (const char *)XMLEsc(label).mb_str(),
-                 (const char *)XMLEsc(mCommandList[j]->key).mb_str());
+         xmlFile.StartTag(wxT("command"));
+         xmlFile.WriteAttr(wxT("name"), mCommandList[j]->name);
+         xmlFile.WriteAttr(wxT("label"), label);
+         xmlFile.WriteAttr(wxT("key"), mCommandList[j]->key);
+         xmlFile.EndTag(wxT("command"));
       }
-   for(i=0; i<depth; i++)
-      fprintf(fp, "\t");
-   fprintf(fp, "</audacitykeyboard>\n");
+   }
+   
+   xmlFile.EndTag(wxT("audacitykeyboard"));
 }
 
 void CommandManager::SetDefaultFlags(wxUint32 flags, wxUint32 mask)


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to