SVN commit 760132 by aacid: backport r760130 **************** we also need to check for the current extension so that in case the current extension is a .foo.bar we don't duplicate .foo lastExtension is there for a similar purpose but only when changing the current file type thorugh the combo M +2 -0 kfilewidget.cpp --- branches/KDE/4.0/kdelibs/kfile/kfilewidget.cpp #760131:760132 @@ -1828,6 +1828,8 @@ // catch "double extensions" like ".tar.gz" if (lastExtension.length() && fileName.endsWith (lastExtension)) fileName.truncate (len - lastExtension.length()); + else if (extension.length() && fileName.endsWith (extension)) + fileName.truncate (len - extension.length()); // can only handle "single extensions" else fileName.truncate (dot);