[Uml-devel] KDE_3_2_BRANCH: kdesdk/umbrello/umbrello/dialogs

Sebastian Stein seb.kde at hpfsc.de
Tue Feb 3 13:33:33 UTC 2004


CVS commit by sstein: 

backport of fix for bug #73042: code generation ignores output directory


  M +18 -14    codegenerationwizard.cpp   1.13.2.1


--- kdesdk/umbrello/umbrello/dialogs/codegenerationwizard.cpp  #1.13:1.13.2.1
@@ -157,14 +157,19 @@ void CodeGenerationWizard::populateStatu
 void CodeGenerationWizard::showPage(QWidget *page) {
         if (indexOf(page) == 2)
-        {//before advancint to the final page, check that the output directory exists and is
-         //writtable
-/*
-// FIX, needed?
-                SettingsDlg::CodeGenState codegenState;
-                ((CodeGenerationOptionsPage*)QWizard::page(1))->state(codegenState);
-                QFileInfo info(codegenState.outputDir);
+        {
+                // first save the settings to the selected generator policy
+                ((CodeGenerationOptionsPage*)QWizard::page(1))->apply();
+
+                // before going on to the final page, check that the output directory exists and is
+                // writable
+
+                // get the policy for the current code generator
+                CodeGenerationPolicy *policy = m_doc->getCurrentCodeGenerator()->getPolicy();
+                
+                // get the output directory path
+                QFileInfo info(policy->getOutputDirectory().absPath());
                 if(!info.exists())
                 {
-                        if(KMessageBox::questionYesNo(this,
+                        if (KMessageBox::questionYesNo(this,
                         i18n("The directory %1 does not exist. Do you want to create it now?").arg(info.filePath()),
                         i18n("Output Directoy Does Not Exist")) == KMessageBox::Yes)
@@ -185,6 +190,6 @@ void CodeGenerationWizard::showPage(QWid
                                 return;
                         }
-                }
-                {//directory exists.. make sure we can write to it
+                } else {
+                //directory exists.. make sure we can write to it
                         if(!info.isWritable())
                         {
@@ -202,5 +207,4 @@ void CodeGenerationWizard::showPage(QWid
                         }
                 }
-*/
         }
                 populateStatusList();






More information about the umbrello-devel mailing list