r19976 by craig - Fix up some old variable naming
scribus-commit
scribus-commit at lists.scribus.net
Tue Apr 7 18:10:10 UTC 2015
Author: craig
Date: Tue Apr 7 18:10:10 2015
New Revision: 19976
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19976
Log:
Fix up some old variable naming
Modified:
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribus.h
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19976&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Apr 7 18:10:10 2015
@@ -3972,7 +3972,7 @@
if (currItem->isImageInline())
{
QFileInfo fiB(currItem->Pfile);
- QString fna = fiB.fileName();
+
PrefsContext* docContext = prefsManager->prefsFile->getContext("docdirs", false);
QString wdir = ".";
if (doc->hasName)
@@ -3989,7 +3989,7 @@
wdir = docContext->get("place_as", ".");
wdir = QDir::fromNativeSeparators( wdir );
}
- QString fileName = CFileDialog(wdir, tr("Filename and Path for Image"), tr("All Files (*)"), fna, fdHidePreviewCheckBox);
+ QString fileName = CFileDialog(wdir, tr("Filename and Path for Image"), tr("All Files (*)"), fiB.fileName(), fdHidePreviewCheckBox);
if (!fileName.isEmpty())
{
if (ScCore->fileWatcher->files().contains(currItem->Pfile) != 0)
@@ -4104,7 +4104,7 @@
doc->is12doc=false;
//
bool ret = false;
- QString fna;
+ QString filename;
PrefsContext* docContext = prefsManager->prefsFile->getContext("docdirs", false);
QString wdir = ".";
if (doc->hasName)
@@ -4116,7 +4116,7 @@
else if (completeBaseName.endsWith(".gz", Qt::CaseInsensitive))
completeBaseName.chop(3);
wdir = QDir::fromNativeSeparators( fi.path() );
- fna = QDir::fromNativeSeparators( fi.path()+"/"+completeBaseName+".sla" );
+ filename = QDir::fromNativeSeparators( fi.path()+"/"+completeBaseName+".sla" );
}
else
{
@@ -4127,29 +4127,29 @@
wdir = docContext->get("save_as", ".");
wdir = QDir::fromNativeSeparators( wdir );
if (wdir.right(1) != "/")
- fna = wdir + "/";
+ filename = wdir + "/";
else
- fna = wdir;
- fna += doc->DocName + ".sla";
+ filename = wdir;
+ filename += doc->DocName + ".sla";
}
bool saveCompressed=prefsManager->appPrefs.docSetupPrefs.saveCompressed;
if (saveCompressed)
- fna.append(".gz");
+ filename.append(".gz");
QString fileSpec = tr("Documents (*.sla *.sla.gz);;All Files (*)");
int optionFlags = fdCompressFile | fdHidePreviewCheckBox;
- QString fn = CFileDialog( wdir, tr("Save As"), fileSpec, fna, optionFlags, &saveCompressed);
+ QString fn = CFileDialog( wdir, tr("Save As"), fileSpec, filename, optionFlags, &saveCompressed);
if (!fn.isEmpty())
{
docContext->set("save_as", fn.left(fn.lastIndexOf("/")));
if ((fn.endsWith(".sla")) || (fn.endsWith(".sla.gz")))
- fna = fn;
+ filename = fn;
else
- fna = fn+".sla";
- if (overwrite(this, fna))
+ filename = fn+".sla";
+ if (overwrite(this, filename))
{
QString savedFileName;
- ret = DoFileSave(fna, &savedFileName);
+ ret = DoFileSave(filename, &savedFileName);
if (!ret && !savedFileName.isEmpty())
ScMessageBox::warning(this, CommonStrings::trWarning, tr("Your document was saved to a temporary file and could not be moved: \n%1").arg( QDir::toNativeSeparators(savedFileName) ));
else if (!ret)
@@ -6864,7 +6864,7 @@
void ScribusMainWindow::reallySaveAsEps()
{
- QString fna;
+ QString filename;
if (docCheckerPalette->isIgnoreEnabled())
{
docCheckerPalette->hide();
@@ -6877,26 +6877,26 @@
{
QFileInfo fi(doc->DocName);
if (!doc->m_Selection->isEmpty())
- fna = fi.path() + "/" + fi.completeBaseName() + "_selection.eps";
+ filename = fi.path() + "/" + fi.completeBaseName() + "_selection.eps";
else
- fna = fi.path() + "/" + getFileNameByPage(doc, doc->currentPage()->pageNr(), "eps");
+ filename = fi.path() + "/" + getFileNameByPage(doc, doc->currentPage()->pageNr(), "eps");
}
else
{
QDir di = QDir();
if (!doc->m_Selection->isEmpty())
- fna = di.currentPath() + "/" + doc->DocName + "_selection.eps";
+ filename = di.currentPath() + "/" + doc->DocName + "_selection.eps";
else
- fna = di.currentPath() + "/" + getFileNameByPage(doc, doc->currentPage()->pageNr(), "eps");
- }
- fna = QDir::toNativeSeparators(fna);
+ filename = di.currentPath() + "/" + getFileNameByPage(doc, doc->currentPage()->pageNr(), "eps");
+ }
+ filename = QDir::toNativeSeparators(filename);
QString wdir = ".";
QString prefsDocDir=prefsManager->documentDir();
if (!prefsDocDir.isEmpty())
wdir = prefsManager->prefsFile->getContext("dirs")->get("eps", prefsDocDir);
else
wdir = prefsManager->prefsFile->getContext("dirs")->get("eps", ".");
- QString fn = CFileDialog( wdir, tr("Save As"), tr("%1;;All Files (*)").arg(formatsManager->extensionsForFormat(FormatsManager::EPS)), fna, fdHidePreviewCheckBox | fdNone);
+ QString fn = CFileDialog( wdir, tr("Save As"), tr("%1;;All Files (*)").arg(formatsManager->extensionsForFormat(FormatsManager::EPS)), filename, fdHidePreviewCheckBox | fdNone);
if (!fn.isEmpty())
{
prefsManager->prefsFile->getContext("dirs")->set("eps", fn.left(fn.lastIndexOf("/")));
@@ -7832,30 +7832,30 @@
delete dia;
}
-QString ScribusMainWindow::CFileDialog(QString wDir, QString caption, QString filter, QString defNa, int optionFlags, bool *docom, bool *doFont, bool *doProfiles)
-{
- QString retval("");
+QString ScribusMainWindow::CFileDialog(QString workingDirectory, QString dialogCaption, QString fileFilter, QString defaultFilename, int optionFlags, bool *useCompression, bool *useFonts, bool *useProfiles)
+{
// changed from "this" to qApp->activeWindow() to be sure it will be opened
// with the current active window as parent. E.g. it won't hide StoryEditor etc. -- PV
- CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), wDir, caption, filter, optionFlags);
- if (!defNa.isEmpty())
- {
- QFileInfo f(defNa);
+ CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), workingDirectory, dialogCaption, fileFilter, optionFlags);
+ if (!defaultFilename.isEmpty())
+ {
+ QFileInfo f(defaultFilename);
dia->setExtension(f.suffix());
dia->setZipExtension(f.suffix() + ".gz");
- dia->setSelection(defNa);
- if (docom != NULL && dia->SaveZip != NULL)
- dia->SaveZip->setChecked(*docom);
+ dia->setSelection(defaultFilename);
+ if (useCompression != NULL && dia->SaveZip != NULL)
+ dia->SaveZip->setChecked(*useCompression);
}
if (optionFlags & fdDirectoriesOnly)
{
- if (docom != NULL && dia->SaveZip != NULL)
- dia->SaveZip->setChecked(*docom);
- if (doFont != NULL)
- dia->WithFonts->setChecked(*doFont);
- if (doProfiles != NULL)
- dia->WithProfiles->setChecked(*doProfiles);
- }
+ if (useCompression != NULL && dia->SaveZip != NULL)
+ dia->SaveZip->setChecked(*useCompression);
+ if (useFonts != NULL)
+ dia->WithFonts->setChecked(*useFonts);
+ if (useProfiles != NULL)
+ dia->WithProfiles->setChecked(*useProfiles);
+ }
+ QString retval("");
if (dia->exec() == QDialog::Accepted)
{
LoadEnc = "";
@@ -7870,12 +7870,12 @@
}
else
{
- if (docom != NULL && dia->SaveZip != NULL)
- *docom = dia->SaveZip->isChecked();
- if (doFont != NULL)
- *doFont = dia->WithFonts->isChecked();
- if (doProfiles != NULL)
- *doProfiles = dia->WithProfiles->isChecked();
+ if (useCompression != NULL && dia->SaveZip != NULL)
+ *useCompression = dia->SaveZip->isChecked();
+ if (useFonts != NULL)
+ *useFonts = dia->WithFonts->isChecked();
+ if (useProfiles != NULL)
+ *useProfiles = dia->WithProfiles->isChecked();
}
this->repaint();
retval = dia->selectedFile();
Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19976&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Tue Apr 7 18:10:10 2015
@@ -160,8 +160,8 @@
void doPasteRecent(QString data);
bool getPDFDriver(const QString & filename, const QString & name, int components, const std::vector<int> & pageNumbers, const QMap<int,QPixmap> & thumbs, QString& error, bool* cancelled = NULL);
bool DoSaveAsEps(QString fn, QString& error);
- QString CFileDialog(QString wDir = ".", QString caption = "", QString filter = "", QString defNa = "",
- int optionFlags = fdExistingFiles, bool *docom = 0, bool *doFont = 0, bool *doProfiles = 0);
+ QString CFileDialog(QString workingDirectory = ".", QString dialogCaption = "", QString fileFilter = "", QString defNa = "",
+ int optionFlags = fdExistingFiles, bool *useCompression = 0, bool *useFonts = 0, bool *useProfiles = 0);
/*! \brief Recalculate the colors after changing CMS settings.
Call the appropriate document function and then update the GUI elements.
\param dia optional progress widget */
More information about the scribus-commit
mailing list