Bug 97162 - missing file extensions after second time code generation
Summary: missing file extensions after second time code generation
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-16 19:20 UTC by Henrik Steffien
Modified: 2005-07-23 16:43 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 Henrik Steffien 2005-01-16 19:20:19 UTC
Version:           1.4.0-beta1 (using KDE KDE 3.3.1)
Compiler:          g++ (GCC) 3.3.5 (Debian 1:3.3.5-5) 
OS:                Linux

Hello,

i'm testing version 1.4.0-beta1 compiled from source tarball (date: 2005-01-15 05:07). Umbrello shows version 1.3.90.
Perform the following steps:

1. Start with an empty project
2. Insert a class, say named MyTest
3. Generate C++ Code (either with wizard or the "generate all"-option)
4. The generator will correctly create a header- and a source file (mytest.h and mytest.cpp)
   (Don't delete this files. We want to overwrite them in the next step.)
5. Generate the C++ Code a second time.
   (If using the wizard, it will ask for overwrite and so on ... it doesn't matter. The "generate all"-option has the same effect.)
6. Umbrello generates a header file named mytest.h (that's correct). And it generates a file named mytest only. No extension. It does not overwrite the existing cpp-file.
Comment 1 Oliver Kellogg 2005-07-23 16:43:02 UTC
SVN commit 437910 by okellogg:

overwritableName(): Patch by Paulo Sehn adds missing `extension' to `name'.
BUG:97162


 M  +9 -8      codegenerator.cpp  
 M  +1 -1      codegenerator.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerator.cpp #437909:437910
@@ -419,12 +419,12 @@
  * @param	codeDoc
  * @param	name
  */
-QString CodeGenerator::overwritableName( QString name, const QString &extention ) {
+QString CodeGenerator::overwritableName( QString name, const QString &extension ) {
 
     QDir outputDirectory = m_codegeneratorpolicy->getOutputDirectory();
 
-    if (!outputDirectory.exists(name + extention)) {
-        return name + extention;
+    if (!outputDirectory.exists(name + extension)) {
+        return name + extension;
     }
 
     int suffix;
@@ -432,23 +432,24 @@
                                          m_applyToAllRemaining, kapp -> mainWidget() );
     switch(overwritePolicy()) {  //if it exists, check the OverwritePolicy we should use
     case CodeGenerationPolicy::Ok:		//ok to overwrite file
-        name = name + extention;
+        name = name + extension;
         break;
     case CodeGenerationPolicy::Ask:	       //ask if we can overwrite
         switch(overwriteDialogue.exec()) {
         case KDialogBase::Yes:  //overwrite file
             if ( overwriteDialogue.applyToAllRemaining() ) {
                 setOverwritePolicy(CodeGenerationPolicy::Ok);
+                name = name + extension;
             } else {
                 m_applyToAllRemaining = false;
             }
             break;
         case KDialogBase::No: //generate similar name
             suffix = 1;
-            while( outputDirectory.exists(name + "__" + QString::number(suffix) + extention) ) {
+            while( outputDirectory.exists(name + "__" + QString::number(suffix) + extension) ) {
                 suffix++;
             }
-            name = name + "__" + QString::number(suffix) + extention;
+            name = name + "__" + QString::number(suffix) + extension;
             if ( overwriteDialogue.applyToAllRemaining() ) {
                 setOverwritePolicy(CodeGenerationPolicy::Never);
             } else {
@@ -468,10 +469,10 @@
         break;
     case CodeGenerationPolicy::Never: //generate similar name
         suffix = 1;
-        while( outputDirectory.exists(name + "__" + QString::number(suffix) + extention) ) {
+        while( outputDirectory.exists(name + "__" + QString::number(suffix) + extension) ) {
             suffix++;
         }
-        name = name + "__" + QString::number(suffix) + extention;
+        name = name + "__" + QString::number(suffix) + extension;
         break;
     case CodeGenerationPolicy::Cancel: //don't output anything
         return NULL;
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerator.h #437909:437910
@@ -359,7 +359,7 @@
      * @return the real file name that should be used. (with extension?) or 
      *      NULL if none to be used
      */
-    QString overwritableName ( QString name, const QString &extention );
+    QString overwritableName ( QString name, const QString &extension );
 
     /** Opens a file named "name" for writing in the outputDirectory.
      * If something goes wrong, it informs the user