summaryrefslogtreecommitdiffstats
path: root/scribus/customfdialog.cpp
diff options
context:
space:
mode:
authorjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-07-15 14:35:16 +0000
committerjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-07-15 14:35:16 +0000
commit617663990119e1cf5c1f8eae308453e81a2e9c7d (patch)
tree2bd837654fc8352eb8567a95d57f9ff7a803d32a /scribus/customfdialog.cpp
parent06ebb4fbc9f069ebad1d8cd63e6eac9a0251e378 (diff)
downloadscribus-617663990119e1cf5c1f8eae308453e81a2e9c7d.tar.gz
scribus-617663990119e1cf5c1f8eae308453e81a2e9c7d.tar.xz
scribus-617663990119e1cf5c1f8eae308453e81a2e9c7d.zip
10689: Incorrect save filename when filename contains multiple points
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17721 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/customfdialog.cpp')
-rw-r--r--scribus/customfdialog.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/scribus/customfdialog.cpp b/scribus/customfdialog.cpp
index 3afd06f..00c5eb4 100644
--- a/scribus/customfdialog.cpp
+++ b/scribus/customfdialog.cpp
@@ -456,26 +456,28 @@ CustomFDialog::~CustomFDialog()
void CustomFDialog::handleCompress()
{
- QFileInfo tmp;
- tmp.setFile(selectedFile());
- QString e(tmp.completeSuffix());
- QStringList ex = e.split(".", QString::SkipEmptyParts);
- QString baseExt = "";
- for (int a = 0; a < ex.count(); a++)
+ QString fileName;
+ QFileInfo tmp(selectedFile());
+ QString fn(tmp.fileName());
+ QStringList fc = fn.split(".", QString::KeepEmptyParts);
+ if (fc.count() > 0)
+ fileName = fc.at(0);
+ for (int a = 1; a < fc.count(); a++)
{
- if ((ex[a] != "sla") && (ex[a] != "SLA") && (ex[a] != "gz") && (ex[a] != "GZ"))
- baseExt += "."+ex[a];
+ if (fc.at(a).compare("sla", Qt::CaseInsensitive) == 0)
+ continue;
+ if (fc.at(a).compare("gz", Qt::CaseInsensitive) == 0)
+ continue;
+ if (fc.at(a).compare(ext, Qt::CaseInsensitive) == 0)
+ continue;
+ if (fc.at(a).compare(extZip, Qt::CaseInsensitive) == 0)
+ continue;
+ fileName += "." + fc[a];
}
if (SaveZip->isChecked())
- {
- if (e != extZip)
- tmp.setFile(tmp.baseName() + baseExt + "." + extZip);
- }
+ tmp.setFile(fileName + "." + extZip);
else
- {
- if (e != ext)
- tmp.setFile(tmp.baseName() + baseExt + "." + ext);
- }
+ tmp.setFile(fileName + "." + ext);
setSelection(tmp.fileName());
}