[Uml-devel] KDE/kdesdk/umbrello/umbrello

David Faure faure at kde.org
Wed Jan 24 09:50:27 UTC 2007


SVN commit 626689 by dfaure:

To copy a single file, KIO::file_copy is enough, and connecting to result(KJob*) instead of the copyingDone signal
which is mostly internal to CopyJob (for undo purposes)


 M  +8 -7      CMakeLists.txt  
 D             docgenerators/CMakeLists.txt  
 M  +3 -3      docgenerators/docbookgenerator.cpp  
 M  +2 -2      docgenerators/docbookgenerator.h  
 M  +5 -6      docgenerators/xhtmlgenerator.cpp  
 M  +1 -1      docgenerators/xhtmlgenerator.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #626688:626689
@@ -1,14 +1,8 @@
 find_package(LibXml2)
 find_package(LibXslt)
 
-add_subdirectory( codeimport ) 
-add_subdirectory( dialogs ) 
-add_subdirectory( clipboard ) 
 add_subdirectory( pics ) 
-add_subdirectory( codegenerators ) 
-add_subdirectory( docgenerators ) 
 add_subdirectory( headings ) 
-add_subdirectory( refactoring ) 
 
 macro(CREATE_VERSION _in_FILE _out_FILE)
     FILE(READ ${_in_FILE} _contents)
@@ -352,8 +346,15 @@
 ########### install files ###############
 
 install( FILES umbrello.desktop  DESTINATION  ${XDG_APPS_DIR} )
-install( FILES tips umbrelloui.rc  DESTINATION  ${DATA_INSTALL_DIR}/umbrello )
 install( FILES x-umbrello.desktop  DESTINATION  ${MIME_INSTALL_DIR}/application )
+install( FILES
+  tips
+  umbrelloui.rc
+  docgenerators/xmi2docbook.xsl
+  docgenerators/docbook2xhtml.xsl
+  docgenerators/xmi.css
+  docgenerators/common.ent
+  DESTINATION ${DATA_INSTALL_DIR}/umbrello )
 
 kde4_install_icons( ${ICON_INSTALL_DIR}   )
 
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/docbookgenerator.cpp #626688:626689
@@ -63,7 +63,7 @@
   return true;
 }
 
-KIO::CopyJob* DocbookGenerator::generateDocbookForProjectInto(const KUrl& destDir)
+KIO::Job* DocbookGenerator::generateDocbookForProjectInto(const KUrl& destDir)
 {
   UMLApp* app = UMLApp::app();
   UMLDoc* umlDoc = app->getDocument();
@@ -89,7 +89,7 @@
   // lets open the file for writing
   if( !file.open() ) {
     KMessageBox::error(0, i18n("There was a problem saving file: %1", file.fileName()), i18n("Save Error"));
-    return false;
+    return 0;
   }
   umlDoc->saveToXMI(file); // save the xmi stuff to it
   
@@ -126,7 +126,7 @@
   url.setPath(destDir.path());
   url.addPath(fileName);
   kDebug() << "Copying result to: " << url << endl;
-  KIO::CopyJob* job = KIO::copy(KUrl::fromPath(tmpDocBook.fileName()),url,true);
+  KIO::Job* job = KIO::file_copy(KUrl::fromPath(tmpDocBook.fileName()),url,true);
   job->ui()->setAutoErrorHandlingEnabled(true);
 
   return job;
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/docbookgenerator.h #626688:626689
@@ -25,7 +25,7 @@
 
 namespace KIO
 {
-  class CopyJob;
+  class Job;
 }
 
 /**
@@ -71,7 +71,7 @@
      * @todo better handling of error conditions
      * @return true if saving is successful and false otherwise.
      */
-    KIO::CopyJob* generateDocbookForProjectInto(const KUrl& destDir);
+    KIO::Job* generateDocbookForProjectInto(const KUrl& destDir);
     
 };
 
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/xhtmlgenerator.cpp #626688:626689
@@ -67,22 +67,22 @@
   kDebug() << "First convert to docbook" << endl;
   m_destDir = destDir;
 //   KUrl url(QString("file://")+m_tmpDir.name());
-  KIO::CopyJob* docbookJob = DocbookGenerator().generateDocbookForProjectInto(destDir);
+  KIO::Job* docbookJob = DocbookGenerator().generateDocbookForProjectInto(destDir);
   if (docbookJob == 0)
   {
     return false;
   }
   kDebug() << "Connecting..." << endl;
-  connect(docbookJob, SIGNAL(copyingDone( KIO::Job *, const KUrl &, const KUrl &, bool, bool )), this, SLOT(slotDocbookToXhtml( KIO::Job *)));
-  return true; 
+  connect(docbookJob, SIGNAL(result(KJob*)), this, SLOT(slotDocbookToXhtml(KJob*)));
+  return true;
 }
 
-void XhtmlGenerator::slotDocbookToXhtml(KIO::Job * docbookJob)
+void XhtmlGenerator::slotDocbookToXhtml(KJob * docbookJob)
 {
   kDebug() << "Now convert docbook to html..." << endl;
   if ( docbookJob->error() )
   {
-    docbookJob->showErrorDialog( 0L  );
+    // error shown by setAutoErrorHandlingEnabled(true) already
     return;
   }
   
@@ -92,7 +92,6 @@
   const KUrl& url = umlDoc->url();
   QString docbookName = url.fileName();
   docbookName.replace(QRegExp(".xmi$"),".docbook");
-//   KUrl docbookUrl(QString("file://")+m_tmpDir.name());
   KUrl docbookUrl = m_destDir;
   docbookUrl.addPath(docbookName);
   
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/xhtmlgenerator.h #626688:626689
@@ -87,7 +87,7 @@
      * @param docbookJob the job copying the docbook file to its destination.
      * Used only for error reporting
      */
-    void slotDocbookToXhtml(KIO::Job * docbookJob);
+    void slotDocbookToXhtml(KJob * docbookJob);
     
     /** Triggered when the copying of the HTML result file is finished. Emits
      * the signal finished(). 




More information about the umbrello-devel mailing list