[Uml-devel] KDE/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Jul 23 07:45:49 UTC 2005
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
More information about the umbrello-devel
mailing list