Bug 71633 - Clean API Documentation: should also clean latex
Summary: Clean API Documentation: should also clean latex
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.0b2
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amilcar do Carmo Lucas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-02 00:36 UTC by Frans Pop
Modified: 2004-01-09 19:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frans Pop 2004-01-02 00:36:40 UTC
Version:           3.0.0b2 (kdevelop-031231) (using KDE KDE 3.1.4)
Installed from:    Debian stable Packages
OS:          Linux

The option Clean API Documentation in the Build menu currently only cleans the documentation (generated with Doxygen) html/ directory.

It should also clean the latex/ directory.
Comment 1 Frans Pop 2004-01-02 01:05:58 UTC
The same goes for the documents in xml.

Also, from the configuration file Doxyfile, I see that Doxygen can also generate other formats.

P.S. Would it not be a good idea to bring all these directories together under a single directory?
Comment 2 Frans Pop 2004-01-02 01:22:20 UTC
Sorry, I noticed one final problem (and a fairly basic one): the files currently are not actually deleted.
Cause is that the wildcard is not expanded because the filesspecification is quoted (see parts/doxygen/doxygenpart.cpp, DoxygenPart::slotDoxClean()).

Current command is:
rm -f '<project directory>/html/*'

This should be:
rm -f <project directory>/html/*
or (if you want to allow for spaces in the path):
rm -f '/home/fjp/kdevelop/sigcreate/xml'/*
Comment 3 Amilcar do Carmo Lucas 2004-01-09 19:41:09 UTC
Subject: kdevelop/parts/doxygen

CVS commit by aclu: 

Fix 71633

CCMAIL: 71633-done@bugs.kde.org


  M +58 -10    doxygenpart.cpp   1.28


--- kdevelop/parts/doxygen/doxygenpart.cpp  #1.27:1.28
@@ -236,4 +236,5 @@ void DoxygenPart::slotDoxygen()
 void DoxygenPart::slotDoxClean()
 {
+    bool could_be_dirty = false;
 
     QString outputDirectory = Config_getString("OUTPUT_DIRECTORY");
@@ -242,5 +243,7 @@ void DoxygenPart::slotDoxClean()
     if ( outputDirectory.right(1) != "/" )
         outputDirectory += "/";
+    QString cmdline = "cd " + KShellProcess::quote( outputDirectory );
 
+    if ( Config_getBool("GENERATE_HTML") ) {
     QString htmlDirectory   = Config_getString("HTML_OUTPUT");
     if ( htmlDirectory.isEmpty() )
@@ -248,10 +251,55 @@ void DoxygenPart::slotDoxClean()
     if ( htmlDirectory.right(1) != "/" )
         htmlDirectory += "/";
+        cmdline += " && rm -f " + KShellProcess::quote( htmlDirectory ) + "*";
+        could_be_dirty= true;
+    }
 
-    QString cmdline = "rm -f " + KShellProcess::quote( outputDirectory + htmlDirectory + "*");
+    if ( Config_getBool("GENERATE_LATEX") ) {
+        QString latexDirectory   = Config_getString("LATEX_OUTPUT");
+        if ( latexDirectory.isEmpty() )
+            latexDirectory = "latex";
+        if ( latexDirectory.right(1) != "/" )
+            latexDirectory += "/";
+        cmdline += " && rm -f " + KShellProcess::quote( latexDirectory ) + "*";
+        could_be_dirty= true;
+    }
     
-    kdDebug(9026) << "Cleaning Doxygen html generated API documentation using: " << cmdline << endl;
+    if ( Config_getBool("GENERATE_RTF") ) {
+        QString rtfDirectory   = Config_getString("RTF_OUTPUT");
+        if ( rtfDirectory.isEmpty() )
+            rtfDirectory = "rtf";
+        if ( rtfDirectory.right(1) != "/" )
+            rtfDirectory += "/";
+        cmdline += " && rm -f " + KShellProcess::quote( rtfDirectory ) + "*";
+        could_be_dirty= true;
+    }
 
+    if ( Config_getBool("GENERATE_MAN") ) {
+        QString manDirectory   = Config_getString("MAN_OUTPUT");
+        if ( manDirectory.isEmpty() )
+            manDirectory = "man";
+        if ( manDirectory.right(1) != "/" )
+            manDirectory += "/";
+        cmdline += " && rm -f " + KShellProcess::quote( manDirectory ) + "*";
+        could_be_dirty= true;
+    }
+
+    if ( Config_getBool("GENERATE_XML") ) {
+        QString xmlDirectory   = Config_getString("XML_OUTPUT");
+        if ( xmlDirectory.isEmpty() )
+            xmlDirectory = "xml";
+        if ( xmlDirectory.right(1) != "/" )
+            xmlDirectory += "/";
+        cmdline += " && rm -f " + KShellProcess::quote( xmlDirectory ) + "*";
+        could_be_dirty= true;
+    }
+
+    if (could_be_dirty) {
+        kdDebug(9026) << "Cleaning Doxygen generated API documentation using: " << cmdline << endl;
     makeFrontend()->queueCommand(KShellProcess::quote(project()->projectDirectory()), cmdline);
+    }
+    else
+       kdDebug(9026) << "No Doxygen generated API documentation exists. There's nothing to clean!" << endl;
+
 }