r21526 by craig - #9808: Switch directory finding for data dirs to QStandardPaths, thereby implementing XDG standards on Linux. Clean up. Bump Qt minimum to 5.5
scribus-commit
scribus-commit at lists.scribus.net
Sun Nov 20 22:34:35 UTC 2016
Author: craig
Date: Sun Nov 20 22:34:35 2016
New Revision: 21526
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21526
Log:
#9808: Switch directory finding for data dirs to QStandardPaths, thereby implementing XDG standards on Linux. Clean up. Bump Qt minimum to 5.5
Modified:
trunk/Scribus/scribus/colorsetmanager.cpp
trunk/Scribus/scribus/filesearch.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pdf.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
trunk/Scribus/scribus/langmgr.cpp
trunk/Scribus/scribus/nftsettings.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
trunk/Scribus/scribus/plugins/barcodegenerator/barcodegeneratorrenderthread.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/plugins/import/ai/importai.cpp
trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
trunk/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
trunk/Scribus/scribus/plugins/scriptplugin/objprinter.cpp
trunk/Scribus/scribus/plugins/short-words/version.h
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/prefsmanager.h
trunk/Scribus/scribus/scfonts.cpp
trunk/Scribus/scribus/scimagecachemanager.cpp
trunk/Scribus/scribus/scimagecacheproxy.cpp
trunk/Scribus/scribus/scpaths.cpp
trunk/Scribus/scribus/scpaths.h
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusXml.cpp
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribuscore.cpp
trunk/Scribus/scribus/third_party/zip/scribus_zip.cpp
trunk/Scribus/scribus/ui/charselect.cpp
trunk/Scribus/scribus/ui/helpbrowser.cpp
trunk/Scribus/scribus/ui/paintmanager.cpp
trunk/Scribus/scribus/ui/prefs_spelling.cpp
trunk/Scribus/scribus/ui/preview.cpp
trunk/Scribus/scribus/ui/resourcemanager.cpp
trunk/Scribus/scribus/ui/scrapbookpalette.cpp
trunk/Scribus/scribus/upgradechecker.cpp
trunk/Scribus/scribus/util_ghostscript.cpp
Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp (original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp Sun Nov 20 22:34:35 2016
@@ -126,9 +126,9 @@
void ColorSetManager::findPaletteLocations()
{
paletteLocations.clear();
- QStringList locations=ScPaths::instance().getSystemCreatePalettesDirs();
+ QStringList locations=ScPaths::instance().systemCreatePalettesDirs();
locations << ScPaths::instance().shareDir()+"swatches/";
- locations << ScPaths::instance().getDirsFromEnvVar("XDG_DATA_HOME", "scribus/swatches/");
+ locations << ScPaths::instance().dirsFromEnvVar("XDG_DATA_HOME", "scribus/swatches/");
for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it )
{
QFileInfo paletteDir(*it);
@@ -138,7 +138,7 @@
paletteLocationLocks.insert((*it), !paletteDir.isWritable());
}
}
- QStringList xdgSysLocations=ScPaths::instance().getDirsFromEnvVar("XDG_DATA_DIRS", "scribus/swatches/");
+ QStringList xdgSysLocations=ScPaths::instance().dirsFromEnvVar("XDG_DATA_DIRS", "scribus/swatches/");
for ( QStringList::Iterator it = xdgSysLocations.begin(); it != xdgSysLocations.end(); ++it )
{
QFile paletteDir(*it);
@@ -171,7 +171,7 @@
if (parent != NULL)
{
QTreeWidgetItem* item;
- if (path + dirs[dc] == ScPaths::getApplicationDataDir()+"swatches/locked")
+ if (path + dirs[dc] == ScPaths::applicationDataDir()+"swatches/locked")
item = parent;
else
{
@@ -199,7 +199,7 @@
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
item->setText(0, setName);
item->setData(0, Qt::UserRole, fi.absolutePath());
- if ((!fi.isWritable()) || (fi.absolutePath().contains(ScPaths::getApplicationDataDir()+"swatches/locked")))
+ if ((!fi.isWritable()) || (fi.absolutePath().contains(ScPaths::applicationDataDir()+"swatches/locked")))
item->setIcon(0, QIcon(IconManager::instance()->loadIcon("16/lock.png")));
}
}
@@ -222,7 +222,7 @@
void ColorSetManager::findUserPalettes(QTreeWidgetItem* parent)
{
userPalettes.clear();
- searchDir(ScPaths::getUserPaletteFilesDir(true), userPalettes, parent);
+ searchDir(ScPaths::userPaletteFilesDir(true), userPalettes, parent);
}
QStringList ColorSetManager::paletteNames()
Modified: trunk/Scribus/scribus/filesearch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/filesearch.cpp
==============================================================================
--- trunk/Scribus/scribus/filesearch.cpp (original)
+++ trunk/Scribus/scribus/filesearch.cpp Sun Nov 20 22:34:35 2016
@@ -5,7 +5,6 @@
for which a new license (GPL+exception) is in place.
*/
#include "filesearch.h"
-//#include "filesearch.moc"
#include <QTimer>
#include <QRegExp>
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pdf.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pdf.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pdf.cpp Sun Nov 20 22:34:35 2016
@@ -41,7 +41,7 @@
QStringList args;
if (!QFile::exists(fn))
return false;
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
QString picFile = QDir::toNativeSeparators(fn);
float xres = gsRes;
float yres = gsRes;
@@ -121,7 +121,7 @@
if (!fi.exists())
return false;
QString tmp, BBox;
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
QString picFile = QDir::toNativeSeparators(fn);
QStringList args;
args.append("-r"+QString::number(gsRes));
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp Sun Nov 20 22:34:35 2016
@@ -183,7 +183,7 @@
QByteArray imgc(thumbLen, ' ');
f.seek(thumbStart);
f.read(imgc.data(), thumbLen);
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "preview.tiff");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "preview.tiff");
QFile f2(tmpFile);
if (f2.open(QIODevice::WriteOnly))
f2.write(imgc.data(), thumbLen);
@@ -479,8 +479,8 @@
QString ext = fi.suffix().toLower();
if (ext.isEmpty())
ext = getImageType(fn);
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + QString("sc%1.png").arg(qMax(1, page)));
- QString tmpFiles = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc%d.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + QString("sc%1.png").arg(qMax(1, page)));
+ QString tmpFiles = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc%d.png");
QString picFile = QDir::toNativeSeparators(fn);
float xres = gsRes;
float yres = gsRes;
@@ -617,9 +617,9 @@
}
QStringList files = QStringList("sc*.png");
- files = QDir(ScPaths::getTempFileDir()).entryList(files);
+ files = QDir(ScPaths::tempFileDir()).entryList(files);
for (int i=0; i < files.count(); ++i)
- QFile::remove(QDir::toNativeSeparators(ScPaths::getTempFileDir() + files[i]));
+ QFile::remove(QDir::toNativeSeparators(ScPaths::tempFileDir() + files[i]));
if (extensionIndicatesEPS(ext))
{
@@ -697,9 +697,9 @@
}
QStringList files = QStringList("sc*.png");
- files = QDir(ScPaths::getTempFileDir()).entryList(files);
+ files = QDir(ScPaths::tempFileDir()).entryList(files);
for (int i=0; i < files.count(); ++i)
- QFile::remove(QDir::toNativeSeparators(ScPaths::getTempFileDir() + files[i]));
+ QFile::remove(QDir::toNativeSeparators(ScPaths::tempFileDir() + files[i]));
if (extensionIndicatesEPS(ext))
{
@@ -741,7 +741,7 @@
double x, y, b, h;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc1.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.png");
int retg;
int GsMajor;
int GsMinor;
@@ -1172,7 +1172,7 @@
ts2 >> x >> y >> b >> h;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc1.jpg");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.jpg");
QFile f2(tmpFile);
QString tmp;
m_image = QImage(m_psXSize, m_psYSize, QImage::Format_ARGB32);
@@ -1308,7 +1308,7 @@
ts2 >> x >> y >> b >> h;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc1.jpg");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.jpg");
QFile f2(tmpFile);
QString tmp;
tmpImg = QImage(m_psXSize, m_psYSize, QImage::Format_ARGB32);
@@ -1428,8 +1428,8 @@
double x, y, b, h;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc1.png");
- QString tmpFile2 = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "tmp.eps");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.png");
+ QString tmpFile2 = QDir::toNativeSeparators(ScPaths::tempFileDir() + "tmp.eps");
QString baseFile = fi.absolutePath();
QString picFile = QDir::toNativeSeparators(fn);
float xres = gsRes;
@@ -1542,7 +1542,7 @@
double x, y, b, h;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc1.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.png");
QString baseFile = fi.absolutePath();
QString picFile;
float xres = gsRes;
@@ -1677,8 +1677,8 @@
if (!fi.exists())
return false;
QString ext = fi.suffix().toLower();
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + QString("sc%1.png").arg(qMax(1, page)));
- QString tmpFiles = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc%d.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + QString("sc%1.png").arg(qMax(1, page)));
+ QString tmpFiles = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc%d.png");
QString picFile = QDir::toNativeSeparators(fn);
double x, y, b, h;
bool found = false;
@@ -1732,9 +1732,9 @@
}
QStringList files = QStringList("sc*.png");
- files = QDir(ScPaths::getTempFileDir()).entryList(files);
+ files = QDir(ScPaths::tempFileDir()).entryList(files);
for (int i=0; i < files.count(); ++i)
- QFile::remove(QDir::toNativeSeparators(ScPaths::getTempFileDir() + files[i]));
+ QFile::remove(QDir::toNativeSeparators(ScPaths::tempFileDir() + files[i]));
hasAlpha = true;
m_imageInfoRecord.actualPageNumber = page;
Modified: trunk/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/langmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/langmgr.cpp (original)
+++ trunk/Scribus/scribus/langmgr.cpp Sun Nov 20 22:34:35 2016
@@ -1044,7 +1044,7 @@
// Find the dic and aff files in the location
QDir dictLocation(dictionaryPaths.at(i));
QStringList dictFilters("hyph*.dic");
- if (dictionaryPaths.at(i)==ScPaths::getUserDictDir(ScPaths::Hyph, false))
+ if (dictionaryPaths.at(i)==ScPaths::userDictDir(ScPaths::Hyph, false))
dictFilters.append("*.dic");
QStringList dictList(dictLocation.entryList(dictFilters, QDir::Files, QDir::Name));
dictList.replaceInStrings(".dic","");
Modified: trunk/Scribus/scribus/nftsettings.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/nftsettings.cpp
==============================================================================
--- trunk/Scribus/scribus/nftsettings.cpp (original)
+++ trunk/Scribus/scribus/nftsettings.cpp Sun Nov 20 22:34:35 2016
@@ -16,7 +16,7 @@
{
lang = guilang;
scribusShare = ScPaths::instance().templateDir();
- scribusUserHome = QDir::toNativeSeparators(ScPaths::getApplicationDataDir());
+ scribusUserHome = QDir::toNativeSeparators(ScPaths::applicationDataDir());
read();
}
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sun Nov 20 22:34:35 2016
@@ -908,7 +908,7 @@
jpgFileName = fn;
else
{
- tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.jpg");
+ tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.jpg");
if (format == ColorSpaceGray && (!precal))
image.convertToGray();
if (image.convert2JPG(tmpFile, quality, format == ColorSpaceCMYK, format == ColorSpaceGray))
@@ -10189,7 +10189,7 @@
{
if (extensionIndicatesEPSorPS(ext))
{
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.pdf");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.pdf");
QStringList opts;
opts.append("-dEPSCrop");
if (Options.Version >= PDFOptions::PDFVersion_14)
Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp (original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp Sun Nov 20 22:34:35 2016
@@ -603,7 +603,7 @@
void BarcodeGenerator::updatePreview(QString errorMsg)
{
- QString pngFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "bcode.png");
+ QString pngFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "bcode.png");
if (errorMsg=="")
{
ui.sampleLabel->setPixmap(QPixmap(pngFile));
@@ -707,7 +707,7 @@
void BarcodeGenerator::okButton_pressed()
{
- QString psFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "bcode.ps");
+ QString psFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "bcode.ps");
// no need to call paintBarcode(pngFile, 300); because
// it's created by previous run...
Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegeneratorrenderthread.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegeneratorrenderthread.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegeneratorrenderthread.cpp (original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegeneratorrenderthread.cpp Sun Nov 20 22:34:35 2016
@@ -48,10 +48,10 @@
void BarcodeGeneratorRenderThread::run()
{
- QString pngFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "bcode.png");
- QString psFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "bcode.ps");
- QString fileStdErr = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "bcode.err");
- QString fileStdOut = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "bcode.out");
+ QString pngFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "bcode.png");
+ QString psFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "bcode.ps");
+ QString fileStdErr = QDir::toNativeSeparators(ScPaths::tempFileDir() + "bcode.err");
+ QString fileStdOut = QDir::toNativeSeparators(ScPaths::tempFileDir() + "bcode.out");
int dpi=72;
forever {
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sun Nov 20 22:34:35 2016
@@ -17,6 +17,7 @@
#include "qtiocompressor.h"
#include "resourcecollection.h"
#include "scconfig.h"
+#include "scpaths.h"
#include "scpattern.h"
#include "scribusdoc.h"
#include "scribusview.h"
@@ -46,7 +47,7 @@
QString Scribus150Format::saveElements(double xp, double yp, double wp, double hp, Selection* selection, QByteArray &prevData)
{
- QString fileDir = QDir::homePath();
+ QString fileDir = ScPaths::applicationDataDir();
QString documentStr;
documentStr.reserve(524288);
ScXmlStreamWriter writer(&documentStr);
Modified: trunk/Scribus/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importai.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importai.cpp Sun Nov 20 22:34:35 2016
@@ -91,7 +91,7 @@
{
QString tmp, cmd1, cmd2;
QString pdfFile = QDir::toNativeSeparators(fName);
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
int ret = -1;
tmp.setNum(1);
QStringList args;
@@ -218,7 +218,7 @@
if (tempBuf.startsWith("%PDF"))
{
QFileInfo bF2(fName);
- QString tmpFile = ScPaths::getTempFileDir()+ "/"+bF2.baseName()+"_tmp.ai";
+ QString tmpFile = ScPaths::tempFileDir()+ "/"+bF2.baseName()+"_tmp.ai";
if (!extractFromPDF(fName, tmpFile))
return false;
convertedPDF = true;
@@ -317,7 +317,7 @@
if (tempBuf.startsWith("%PDF"))
{
QFileInfo bF2(fName);
- QString tmpFile = ScPaths::getTempFileDir()+ "/"+bF2.baseName()+"_tmp.ai";
+ QString tmpFile = ScPaths::tempFileDir()+ "/"+bF2.baseName()+"_tmp.ai";
if (!extractFromPDF(fName, tmpFile))
return false;
convertedPDF = true;
@@ -747,7 +747,7 @@
if (!convertedPDF)
{
QFileInfo bF2(fName);
- QString tmpFile = ScPaths::getTempFileDir()+ "/"+bF2.baseName()+"_tmp.ai";
+ QString tmpFile = ScPaths::tempFileDir()+ "/"+bF2.baseName()+"_tmp.ai";
moveFile(f2, tmpFile);
fName = tmpFile;
convertedPDF = true;
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp Sun Nov 20 22:34:35 2016
@@ -192,8 +192,8 @@
{
// Destill the eps/ps with ghostscript to get a clean pdf file
bool cancel = false;
- QString errFile = getShortPathName(ScPaths::getTempFileDir())+ "/ps.err";
- cleanFile = getShortPathName(ScPaths::getTempFileDir()) + "/" + fi.baseName() + ".pdf";
+ QString errFile = getShortPathName(ScPaths::tempFileDir())+ "/ps.err";
+ cleanFile = getShortPathName(ScPaths::tempFileDir()) + "/" + fi.baseName() + ".pdf";
QStringList args;
args.append( "-q" );
args.append( "-dNOPAUSE" );
Modified: trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp Sun Nov 20 22:34:35 2016
@@ -162,7 +162,7 @@
collectionsWidget->setColumnCount(1);
collectionsWidget->setHeaderLabels(QStringList("Name"));
- cdbFile = ScPaths::instance().getPluginDataDir() + QString("collectionsdb.xml");
+ cdbFile = ScPaths::instance().pluginDataDir(true) + QString("collectionsdb.xml");
//emtpy initialization, maybe accessed before collection is actually loaded
currCollection = new imageCollection;
currCollection->name = "empty";
@@ -1284,7 +1284,7 @@
}
QTreeWidgetItem *parentItem, *tmpItem;
- QString newCollectionFile = ScPaths::instance().getPluginDataDir();
+ QString newCollectionFile = ScPaths::instance().pluginDataDir(false);
parentItem = currItem->parent();
Modified: trunk/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp Sun Nov 20 22:34:35 2016
@@ -174,12 +174,9 @@
cats.insert(QString("Programs") , QObject::tr("Programs"));
cats.insert(QString("Signs") , QObject::tr("Signs"));
cats.insert(QString("Text Documents"), QObject::tr("Text Documents"));
-
- QString scribusHome = ScPaths::getApplicationDataDir();
- QString scribusShare = ScPaths::instance().templateDir();
- addCategories(scribusHome + "/templates");
- addCategories(scribusShare);
+ addCategories(ScPaths::applicationDataDir() + "/templates");
+ addCategories(ScPaths::instance().templateDir());
QString userTemplateDir(PrefsManager::instance()->appPrefs.pathPrefs.documentTemplates);
if (!userTemplateDir.isEmpty())
addCategories(userTemplateDir);
Modified: trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp (original)
+++ trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp Sun Nov 20 22:34:35 2016
@@ -113,7 +113,7 @@
}
void MenuSAT::RunSATPlug(ScribusDoc* doc)
{
- QDir templates(ScPaths::getApplicationDataDir());
+ QDir templates(ScPaths::applicationDataDir());
if (!templates.exists("templates"))
{
templates.mkdir("templates");
@@ -127,7 +127,7 @@
QString oldCollect = dirs->get("collect", ".");
QString templatesDir = ".";
if (userTemplatesDir.isEmpty())
- templatesDir = ScPaths::getApplicationDataDir() + "templates";
+ templatesDir = ScPaths::applicationDataDir() + "templates";
else
{
if (userTemplatesDir.right(1) == "/")
Modified: trunk/Scribus/scribus/plugins/scriptplugin/objprinter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/scriptplugin/objprinter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/objprinter.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/objprinter.cpp Sun Nov 20 22:34:35 2016
@@ -454,7 +454,7 @@
if (dd != NULL)
{
if (!fil)
- fna = QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/tmp.ps");
+ fna = QDir::toNativeSeparators(ScPaths::tempFileDir()+"/tmp.ps");
PSfile = dd->PS_set_file(fna);
fna = QDir::toNativeSeparators(fna);
if (PSfile)
Modified: trunk/Scribus/scribus/plugins/short-words/version.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/plugins/short-words/version.h
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/version.h (original)
+++ trunk/Scribus/scribus/plugins/short-words/version.h Sun Nov 20 22:34:35 2016
@@ -20,7 +20,7 @@
#define _SCRIBUS_SHORTVER_H_
#define RC_PATH QDir::toNativeSeparators(ScPaths::instance().shareDir() + "plugins/scribus-short-words.rc")
-#define RC_PATH_USR QDir::toNativeSeparators(ScPaths::getApplicationDataDir() + "scribus-short-words.rc")
+#define RC_PATH_USR QDir::toNativeSeparators(ScPaths::applicationDataDir() + "scribus-short-words.rc")
#define SPACE QChar(' ')
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sun Nov 20 22:34:35 2016
@@ -120,7 +120,7 @@
{
setupPreferencesLocation();
- m_importingFrom12=copyOldPreferences();
+ m_importingFrom12=copyOldAppConfigAndData();
prefsFile = new PrefsFile( m_prefsLocation + "/prefs150.xml" );
if (m_importingFrom12)
convert12Preferences();
@@ -335,7 +335,7 @@
dpi = 72;
appPrefs.displayPrefs.displayScale = dpi / 72.0;
- appPrefs.pathPrefs.documents = ScPaths::getUserDocumentDir();
+ appPrefs.pathPrefs.documents = ScPaths::userDocumentDir();
appPrefs.pathPrefs.colorProfiles = "";
appPrefs.pathPrefs.scripts = "";
appPrefs.pathPrefs.documentTemplates = "";
@@ -722,92 +722,69 @@
points.resize(0);
}
-QString PrefsManager::setupPreferencesLocation()
-{
- QString Pff = QDir::toNativeSeparators(ScPaths::getApplicationDataDir());
- QFileInfo Pffi = QFileInfo(Pff);
- QString PrefsPfad;
- //If we are using the ScPaths default prefs location
- if (Pffi.exists())
- {
- if (Pffi.isDir())
- PrefsPfad = Pff;
- else
- PrefsPfad = QDir::homePath();
- }
- else // Move to using the ScPaths default prefs location/scribus.* from ~/.scribus.*
- {
- QDir prefsDirectory = QDir();
- prefsDirectory.mkdir(Pff);
- PrefsPfad = Pff;
- QString oldPR = QDir::toNativeSeparators(QDir::homePath()+"/.scribus.rc");
- QFileInfo oldPi = QFileInfo(oldPR);
- if (oldPi.exists())
- moveFile(oldPR, Pff+"/scribus.rc");
- QString oldPR2 = QDir::toNativeSeparators(QDir::homePath()+"/.scribusfont.rc");
- QFileInfo oldPi2 = QFileInfo(oldPR2);
- if (oldPi2.exists())
- moveFile(oldPR2, Pff+"/scribusfont.rc");
- QString oldPR3 = QDir::toNativeSeparators(QDir::homePath()+"/.scribusscrap.scs");
- QFileInfo oldPi3 = QFileInfo(oldPR3);
- if (oldPi3.exists())
- moveFile(oldPR3, Pff+"/scrap.scs");
- }
- QString scP = QDir::toNativeSeparators(ScPaths::getPluginDataDir());
- QFileInfo scPi = QFileInfo(scP);
- if (!scPi.exists())
- {
- QDir pluginDataDirectory = QDir();
- pluginDataDirectory.mkdir(scP);
- }
- QString scB = QDir::toNativeSeparators(Pff+"/scrapbook");
- QFileInfo scBi = QFileInfo(scB);
- if (!scBi.exists())
- {
- QDir scrapDirectory = QDir();
- scrapDirectory.mkdir(scB);
- QDir scrapMainDirectory = QDir();
- scrapDirectory.mkdir(QDir::toNativeSeparators(scB+"/main"));
- }
- QFileInfo scTmp = QFileInfo(QDir::toNativeSeparators(scB+"/tmp"));
- if (!scTmp.exists())
- {
- QDir scrapDirectoryT = QDir();
- scrapDirectoryT.mkdir(QDir::toNativeSeparators(scB+"/tmp"));
- }
- m_prefsLocation=PrefsPfad;
- QFileInfo scSwatch = QFileInfo(ScPaths::getApplicationDataDir()+"swatches");
- if (!scSwatch.exists())
- {
- QDir swatchDir = QDir();
- swatchDir.mkpath(ScPaths::getApplicationDataDir()+"swatches");
- swatchDir.mkpath(ScPaths::getApplicationDataDir()+"swatches/locked");
- }
- return PrefsPfad;
-}
-
const QString PrefsManager::preferencesLocation()
{
return m_prefsLocation;
}
-bool PrefsManager::copyOldPreferences()
-{
+void PrefsManager::setupPreferencesLocation()
+{
+ m_prefsLocation=ScPaths::preferencesDir(true);
+}
+
+bool PrefsManager::copyOldAppConfigAndData()
+{
+ //Move to using the ScPaths default prefs location/scribus.* from ~/.scribus.*
+ QString oldPR = QDir::toNativeSeparators(QDir::homePath()+"/.scribus.rc");
+ QFileInfo oldPi = QFileInfo(oldPR);
+ if (oldPi.exists())
+ moveFile(oldPR, m_prefsLocation+"scribus.rc");
+ QString oldPR2 = QDir::toNativeSeparators(QDir::homePath()+"/.scribusfont.rc");
+ QFileInfo oldPi2 = QFileInfo(oldPR2);
+ if (oldPi2.exists())
+ moveFile(oldPR2, m_prefsLocation+"scribusfont.rc");
+ QString oldPR3 = QDir::toNativeSeparators(QDir::homePath()+"/.scribusscrap.scs");
+ QFileInfo oldPi3 = QFileInfo(oldPR3);
+ if (oldPi3.exists())
+ moveFile(oldPR3, m_prefsLocation+"scrap.scs");
+
+ //Move plugin data files to new plugin data file directory
+ QDir oldPluginData(ScPaths::preferencesDir() + "/plugins");
+ QFileInfoList filPluginData(oldPluginData.entryInfoList());
+ foreach (const QFileInfo &fiP, filPluginData)
+ moveFile(fiP.absoluteFilePath(), ScPaths::pluginDataDir(true) + fiP.fileName());
+
+ //Move scrapbook files to new scrapbook directory
+ QDir oldScrapData(ScPaths::preferencesDir() + "/scrapbook");
+ QFileInfoList filScrapData(oldScrapData.entryInfoList());
+ foreach (const QFileInfo &fiS, filScrapData)
+ moveFile(fiS.absoluteFilePath(), ScPaths::scrapbookDir(true) + fiS.fileName());
+
+ //Move swatch files to new palette directory
+ QDir oldPaletteData(ScPaths::preferencesDir() + "/swatches");
+ QFileInfoList filPaletteData(oldPaletteData.entryInfoList());
+ foreach (const QFileInfo &fiPal, filPaletteData)
+ moveFile(fiPal.absoluteFilePath(), ScPaths::userPaletteFilesDir(true) + fiPal.fileName());
+ QDir oldPaletteData2=ScPaths::preferencesDir() + "/palettes";
+ QFileInfoList filPaletteData2(oldPaletteData2.entryInfoList());
+ foreach (const QFileInfo &fiPal, filPaletteData2)
+ moveFile(fiPal.absoluteFilePath(), ScPaths::userPaletteFilesDir(true) + fiPal.fileName());
+
//Now make copies for 1.3 use and leave the old ones alone for <1.3.0 usage
QString prefs135[4], prefs140[4], prefs150[4];
- prefs135[0]=QDir::toNativeSeparators(m_prefsLocation+"/scribus135.rc");
- prefs135[1]=QDir::toNativeSeparators(m_prefsLocation+"/scrap135.scs");
- prefs135[2]=QDir::toNativeSeparators(m_prefsLocation+"/prefs135.xml");
- prefs135[3]=QDir::toNativeSeparators(m_prefsLocation+"/scripter135.rc");
- prefs140[0]=QDir::toNativeSeparators(m_prefsLocation+"/scribus140.rc");
- prefs140[1]=QDir::toNativeSeparators(m_prefsLocation+"/scrap140.scs");
- prefs140[2]=QDir::toNativeSeparators(m_prefsLocation+"/prefs140.xml");
- prefs140[3]=QDir::toNativeSeparators(m_prefsLocation+"/scripter140.rc");
- prefs150[0]=QDir::toNativeSeparators(m_prefsLocation+"/scribus150.rc");
- prefs150[1]=QDir::toNativeSeparators(m_prefsLocation+"/scrap150.scs");
- prefs150[2]=QDir::toNativeSeparators(m_prefsLocation+"/prefs150.xml");
- prefs150[3]=QDir::toNativeSeparators(m_prefsLocation+"/scripter150.rc");
+ prefs135[0]=QDir::toNativeSeparators(m_prefsLocation+"scribus135.rc");
+ prefs135[1]=QDir::toNativeSeparators(m_prefsLocation+"scrap135.scs");
+ prefs135[2]=QDir::toNativeSeparators(m_prefsLocation+"prefs135.xml");
+ prefs135[3]=QDir::toNativeSeparators(m_prefsLocation+"scripter135.rc");
+ prefs140[0]=QDir::toNativeSeparators(m_prefsLocation+"scribus140.rc");
+ prefs140[1]=QDir::toNativeSeparators(m_prefsLocation+"scrap140.scs");
+ prefs140[2]=QDir::toNativeSeparators(m_prefsLocation+"prefs140.xml");
+ prefs140[3]=QDir::toNativeSeparators(m_prefsLocation+"scripter140.rc");
+ prefs150[0]=QDir::toNativeSeparators(m_prefsLocation+"scribus150.rc");
+ prefs150[1]=QDir::toNativeSeparators(m_prefsLocation+"scrap150.scs");
+ prefs150[2]=QDir::toNativeSeparators(m_prefsLocation+"prefs150.xml");
+ prefs150[3]=QDir::toNativeSeparators(m_prefsLocation+"scripter150.rc");
bool existsPrefs135[4], existsPrefs140[4], existsPrefs150[4];
for (uint i=0;i<4;++i)
Modified: trunk/Scribus/scribus/prefsmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/prefsmanager.h
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.h (original)
+++ trunk/Scribus/scribus/prefsmanager.h Sun Nov 20 22:34:35 2016
@@ -76,14 +76,14 @@
\brief Set the user's preference file location. Rename any existing old preferences files
\retval QString Location of the user's preferences
*/
- QString setupPreferencesLocation();
+ void setupPreferencesLocation();
/*!
\author Craig Bradney
\date Sun 09 Jan 2005
\brief Copy 1.2 prefs XML before loading, and copy rc files we don't yet convert
\retval bool true if prefs were imported
*/
- bool copyOldPreferences();
+ bool copyOldAppConfigAndData();
/*!
\author Craig Ringer
\date Sun 26 June 2005
Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp (original)
+++ trunk/Scribus/scribus/scfonts.cpp Sun Nov 20 22:34:35 2016
@@ -949,14 +949,14 @@
ScCore->setSplashStatus( QObject::tr("Searching for Fonts") );
AddUserPath(pf);
// Search the system paths
- QStringList ftDirs = ScPaths::getSystemFontDirs();
+ QStringList ftDirs = ScPaths::systemFontDirs();
for (int i = 0; i < ftDirs.count(); i++)
AddScalableFonts( ftDirs[i] );
// Search Scribus font path
if (!ScPaths::instance().fontDir().isEmpty() && QDir(ScPaths::instance().fontDir()).exists())
AddScalableFonts( ScPaths::instance().fontDir() );
//Add downloaded user fonts
- QString userFontDir(ScPaths::instance().getUserFontDir(false));
+ QString userFontDir(ScPaths::instance().userFontDir(false));
if (QDir(userFontDir).exists())
AddScalableFonts( userFontDir );
// if fontconfig is there, it does all the work
Modified: trunk/Scribus/scribus/scimagecachemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scimagecachemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecachemanager.cpp (original)
+++ trunk/Scribus/scribus/scimagecachemanager.cpp Sun Nov 20 22:34:35 2016
@@ -358,7 +358,7 @@
QString ScImageCacheManager::absolutePath(const QString & fn)
{
- QString rv(ScPaths::getImageCacheDir() + fn);
+ QString rv(ScPaths::imageCacheDir() + fn);
while (rv.endsWith('/'))
rv.chop(1);
return rv;
@@ -472,8 +472,8 @@
scDebug() << "sanitizing image cache";
QFileInfo masterInfo(masterLockFile());
- QDirIterator di(ScPaths::getImageCacheDir(), QDirIterator::Subdirectories);
- QDir dir(ScPaths::getImageCacheDir());
+ QDirIterator di(ScPaths::imageCacheDir(), QDirIterator::Subdirectories);
+ QDir dir(ScPaths::imageCacheDir());
QHash<QString, QString> metafile; // meta-filename => base
QHash<QString, int> reffile; // ref-filename => refcount
@@ -681,7 +681,7 @@
QStringList suffixes;
suffixes << ScImageCacheProxy::metaSuffix << ScImageCacheProxy::referenceSuffix << ScImageCacheProxy::imageSuffix;
- m_root = new ScImageCacheDir(ScPaths::getImageCacheDir());
+ m_root = new ScImageCacheDir(ScPaths::imageCacheDir());
Q_CHECK_PTR(m_root);
if (!m_root)
@@ -855,7 +855,7 @@
QString ScImageCacheManager::lockDir()
{
- return ScPaths::getImageCacheDir() + "locks/";
+ return ScPaths::imageCacheDir() + "locks/";
}
QString ScImageCacheManager::masterLockFile()
Modified: trunk/Scribus/scribus/scimagecacheproxy.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scimagecacheproxy.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecacheproxy.cpp (original)
+++ trunk/Scribus/scribus/scimagecacheproxy.cpp Sun Nov 20 22:34:35 2016
@@ -328,7 +328,7 @@
bool ScImageCacheProxy::createCacheDir()
{
- QString cachedir = ScPaths::getImageCacheDir();
+ QString cachedir = ScPaths::imageCacheDir();
QDir cdir(cachedir);
if (!cdir.exists())
Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp (original)
+++ trunk/Scribus/scribus/scpaths.cpp Sun Nov 20 22:34:35 2016
@@ -261,7 +261,7 @@
QString windowsLOPath("LibreOffice 3.5/share/extensions");
QDir d;
QStringList spellDirs;
- spellDirs.append(getUserDictDir(ScPaths::Spell, false));
+ spellDirs.append(userDictDir(ScPaths::Spell, false));
spellDirs.append(m_shareDir + "dicts/spelling/");
#ifdef Q_OS_MAC
d.setPath(macPortsPath);
@@ -328,7 +328,7 @@
QString windowsLOPath("LibreOffice 3.5/share/extensions");
QDir d;
QStringList hyphDirs;
- hyphDirs.append(getUserDictDir(ScPaths::Hyph, false));
+ hyphDirs.append(userDictDir(ScPaths::Hyph, false));
hyphDirs.append(m_shareDir + "dicts/hyph/");
#ifdef Q_OS_MAC
d.setPath(macPortsPath);
@@ -384,7 +384,7 @@
return hyphDirs;
}
-QStringList ScPaths::getSystemFontDirs(void)
+QStringList ScPaths::systemFontDirs(void)
{
QStringList fontDirs;
#ifdef Q_OS_MAC
@@ -398,7 +398,7 @@
return fontDirs;
}
-QStringList ScPaths::getSystemProfilesDirs(void)
+QStringList ScPaths::systemProfilesDirs(void)
{
QStringList iccProfDirs;
#ifdef Q_OS_MAC
@@ -437,7 +437,7 @@
return iccProfDirs;
}
-QStringList ScPaths::getDirsFromEnvVar(const QString envVar, const QString dirToFind)
+QStringList ScPaths::dirsFromEnvVar(const QString envVar, const QString dirToFind)
{
QChar sep(':');
#ifdef _WIN32
@@ -464,7 +464,8 @@
}
-QStringList ScPaths::getSystemCreatePalettesDirs(void)
+
+QStringList ScPaths::systemCreatePalettesDirs(void)
{
QStringList createDirs;
#ifdef Q_OS_MAC
@@ -490,89 +491,93 @@
return createDirs;
}
-QString ScPaths::getApplicationDataDir(void)
-{
-#if defined(_WIN32)
- QString appData = getSpecialDir(CSIDL_APPDATA);
- if (QDir(appData).exists())
+QString ScPaths::applicationDataDir(bool createIfNotExists)
+{
+ QString dataDir;
#ifdef APPLICATION_DATA_DIR
- return (appData + "/" + APPLICATION_DATA_DIR + "/");
+ prefsDir = QDir::homePath() + "/" + APPLICATION_DATA_DIR + "/";
#else
- return (appData + "/Scribus/");
-#endif
-#endif
-
-#ifdef APPLICATION_DATA_DIR
- return QDir::homePath() + "/" + APPLICATION_DATA_DIR + "/";
+ dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/";
+#endif
+ QDir prefsDirectory(dataDir);
+ if (createIfNotExists && !prefsDirectory.exists())
+ prefsDirectory.mkpath(prefsDirectory.absolutePath());
+ return dataDir;
+}
+
+QString ScPaths::preferencesDir(bool createIfNotExists)
+{
+ QString prefsDir;
+#ifdef APPLICATION_CONFIG_DIR
+ prefsDir = QDir::homePath() + "/" + APPLICATION_CONFIG_DIR + "/";
#else
- #ifdef Q_OS_MAC
- return (QDir::homePath() + "/Library/Preferences/Scribus/");
+ //Jean wants to make all prefs for Scribus be in the roaming directory on Windows
+ #ifdef Q_OS_WIN32
+ prefsDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/";
#else
- return (QDir::homePath() + "/.scribus/");
+ prefsDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/";
#endif
#endif
-}
-
-QString ScPaths::getImageCacheDir(void)
-{
- return getApplicationDataDir() + "cache/img/";
-}
-
-QString ScPaths::getPluginDataDir(void)
-{
- return getApplicationDataDir() + "plugins/";
-}
-
-QString ScPaths::getUserDictDir(ScPaths::DictType dictType, bool createIfNotExists)
+ QDir prefsDirectory(prefsDir);
+ if (createIfNotExists && !prefsDirectory.exists())
+ prefsDirectory.mkpath(prefsDirectory.absolutePath());
+ return prefsDir;
+}
+
+QString ScPaths::imageCacheDir(void)
+{
+ return applicationDataDir() + "cache/img/";
+}
+
+QString ScPaths::pluginDataDir(bool createIfNotExists)
+{
+ QDir useFilesDirectory(applicationDataDir() + "plugins/");
+ if(createIfNotExists && !useFilesDirectory.exists())
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
+ return useFilesDirectory.absolutePath()+"/";
+}
+
+QString ScPaths::userDictDir(ScPaths::DictType dictType, bool createIfNotExists)
{
QString dictSuffix;
if (dictType == ScPaths::Hyph)
dictSuffix = "hyph/";
if (dictType == ScPaths::Spell)
dictSuffix = "spell/";
- QDir useFilesDirectory(getApplicationDataDir() + "dicts/" + dictSuffix);
- if(createIfNotExists)
- {
- if (!useFilesDirectory.exists())
- useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
- }
+ QDir useFilesDirectory(applicationDataDir() + "dicts/" + dictSuffix);
+ if(createIfNotExists && !useFilesDirectory.exists())
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
return useFilesDirectory.absolutePath()+"/";
}
-QString ScPaths::getUserFontDir(bool createIfNotExists)
-{
- QDir useFilesDirectory(getApplicationDataDir() + "fonts/");
- if(createIfNotExists)
- {
- if (!useFilesDirectory.exists())
- useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
- }
+QString ScPaths::userFontDir(bool createIfNotExists)
+{
+ QDir useFilesDirectory(applicationDataDir() + "fonts/");
+ if(createIfNotExists && !useFilesDirectory.exists())
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
return useFilesDirectory.absolutePath()+"/";
}
-QString ScPaths::getUserHelpFilesDir(bool createIfNotExists)
-{
- QDir useFilesDirectory(getApplicationDataDir() + "helpfiles/");
- if(createIfNotExists)
- {
- if (!useFilesDirectory.exists())
- useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
- }
+QString ScPaths::userHelpFilesDir(bool createIfNotExists)
+{
+ QDir useFilesDirectory(applicationDataDir() + "helpfiles/");
+ if(createIfNotExists && !useFilesDirectory.exists())
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
return useFilesDirectory.absolutePath()+"/";
}
-QString ScPaths::getUserPaletteFilesDir(bool createIfNotExists)
-{
- QDir useFilesDirectory(getApplicationDataDir() + "palettes/");
- if(createIfNotExists)
- {
- if (!useFilesDirectory.exists())
- useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
+QString ScPaths::userPaletteFilesDir(bool createIfNotExists)
+{
+ QDir useFilesDirectory(applicationDataDir() + "palettes/");
+ if(createIfNotExists && !useFilesDirectory.exists())
+ {
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath() + "/locked");
}
return useFilesDirectory.absolutePath()+"/";
}
-QString ScPaths::getUserDocumentDir(void)
+QString ScPaths::userDocumentDir(void)
{
QString userDocs = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
if (QDir(userDocs).exists())
@@ -580,9 +585,21 @@
return QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/";
}
-QString ScPaths::getTempFileDir(void)
-{
-#if defined(_WIN32)
+QString ScPaths::scrapbookDir(bool createIfNotExists)
+{
+ QDir useFilesDirectory(applicationDataDir() + "scrapbook/");
+ if(createIfNotExists && !useFilesDirectory.exists())
+ {
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath() + "/main");
+ useFilesDirectory.mkpath(useFilesDirectory.absolutePath() + "/tmp");
+ }
+ return useFilesDirectory.absolutePath()+"/";
+}
+
+QString ScPaths::tempFileDir(void)
+{
+#ifdef Q_OS_WIN32
QString tempPath;
WCHAR wTempPath[1024];
DWORD result = GetTempPathW(1024, wTempPath);
@@ -598,7 +615,7 @@
}
#endif
- QDir tempAppDirectory(getApplicationDataDir() + "temp/");
+ QDir tempAppDirectory(applicationDataDir() + "temp/");
if (!tempAppDirectory.exists())
tempAppDirectory.mkpath(tempAppDirectory.absolutePath());
return tempAppDirectory.absolutePath()+"/";
@@ -606,16 +623,16 @@
QString ScPaths::downloadDir()
{
- QDir downloadDirectory(getApplicationDataDir() + "downloads/");
+ QDir downloadDirectory(applicationDataDir() + "downloads/");
if (!downloadDirectory.exists())
downloadDirectory.mkpath(downloadDirectory.absolutePath());
return downloadDirectory.absolutePath()+"/";
}
-QString ScPaths::getSpecialDir(int folder)
+QString ScPaths::windowsSpecialDir(int folder)
{
QString qstr;
-#if defined(_WIN32)
+#ifdef Q_OS_WIN32
WCHAR dir[256];
if ( SHGetSpecialFolderPathW(NULL, dir, folder , false) )
{
Modified: trunk/Scribus/scribus/scpaths.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scpaths.h
==============================================================================
--- trunk/Scribus/scribus/scpaths.h (original)
+++ trunk/Scribus/scribus/scpaths.h Sun Nov 20 22:34:35 2016
@@ -62,31 +62,35 @@
QStringList hyphDirs() const;
/** @brief Return paths to system font directories*/
- static QStringList getSystemFontDirs(void);
+ static QStringList systemFontDirs(void);
/** @brief Return paths to system icc profiles directories*/
- static QStringList getSystemProfilesDirs(void);
+ static QStringList systemProfilesDirs(void);
/** @brief Return paths to system create project directories*/
- static QStringList getSystemCreatePalettesDirs(void);
+ static QStringList systemCreatePalettesDirs(void);
/** @brief Return paths to directories held in an environment variable*/
- static QStringList getDirsFromEnvVar(const QString envVar, const QString dirToFind);
+ static QStringList dirsFromEnvVar(const QString envVar, const QString dirToFind);
+ /** @brief Return path to application prefs dir*/
+ static QString preferencesDir(bool createIfNotExists = false);
/** @brief Return path to application data dir*/
- static QString getApplicationDataDir(void);
+ static QString applicationDataDir(bool createIfNotExists = false);
/** @brief Return path to application data dir for downloaded hyph dictionaries*/
- static QString getUserDictDir(ScPaths::DictType dictType, bool createIfNotExists);
+ static QString userDictDir(ScPaths::DictType dictType, bool createIfNotExists);
/** @brief Return path to application data dir for downloaded fonts*/
- static QString getUserFontDir(bool createIfNotExists);
+ static QString userFontDir(bool createIfNotExists);
/** @brief Return path to application data dir for downloaded docs*/
- static QString getUserHelpFilesDir(bool createIfNotExists);
+ static QString userHelpFilesDir(bool createIfNotExists);
/** @brief Return path to application data dir for downloaded palettes */
- static QString getUserPaletteFilesDir(bool createIfNotExists);
+ static QString userPaletteFilesDir(bool createIfNotExists);
/** @brief Return path to image cache dir*/
- static QString getImageCacheDir(void);
+ static QString imageCacheDir(void);
/** @brief Return path to plugin data dir*/
- static QString getPluginDataDir(void);
+ static QString pluginDataDir(bool createIfNotExists);
/** @brief Return path to user documents*/
- static QString getUserDocumentDir(void);
+ static QString userDocumentDir(void);
+ /** @brief Return path to scrapbook dir*/
+ static QString scrapbookDir(bool createIfNotExists);
/** @brief Return path to directory used for temporary files*/
- static QString getTempFileDir(void);
+ static QString tempFileDir(void);
/** @brief Return path to directory used for downloaded (permanent) files*/
static QString downloadDir(void);
/** @brief Return path to Contents OSX subdirectory*/
@@ -103,7 +107,7 @@
~ScPaths();
/** @brief Return path to a special directory, should be used only on Windows*/
- static QString getSpecialDir(int folder);
+ static QString windowsSpecialDir(int folder);
/** @brief Pointer to existing instance of ScPaths, if any. */
static ScPaths* m_instance;
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Nov 20 22:34:35 2016
@@ -316,7 +316,7 @@
int retVal=0;
qsrand(1234);
QByteArray stylesheet;
- if (loadRawText(ScPaths::getApplicationDataDir() + "/stylesheet.css", stylesheet))
+ if (loadRawText(ScPaths::preferencesDir() + "/stylesheet.css", stylesheet))
{
qApp->setStyleSheet(QString(stylesheet));
}
@@ -436,7 +436,7 @@
csm.findPaletteLocations();
csm.findPalettes();
csm.findUserPalettes();
- QString Cpfad = QDir::toNativeSeparators(ScPaths::getApplicationDataDir())+"DefaultColors.xml";
+ QString Cpfad = QDir::toNativeSeparators(ScPaths::applicationDataDir())+"DefaultColors.xml";
QFile fc(Cpfad);
if (fc.exists())
csm.loadPalette(Cpfad, m_doc, m_prefsManager->appPrefs.colorPrefs.DColors, m_prefsManager->appPrefs.defaultGradients, m_prefsManager->appPrefs.defaultPatterns, false);
@@ -2241,7 +2241,7 @@
ColorList colorList;
QHash<QString, VGradient> gradientsList;
QHash<QString, ScPattern> patternsList;
- QString Cpfad = QDir::toNativeSeparators(ScPaths::getApplicationDataDir())+"DefaultColors.xml";
+ QString Cpfad = QDir::toNativeSeparators(ScPaths::applicationDataDir())+"DefaultColors.xml";
QFile fc(Cpfad);
if (fc.exists())
{
@@ -7387,7 +7387,7 @@
{
// Hack
QByteArray stylesheet;
- if (loadRawText(ScPaths::getApplicationDataDir() + "/stylesheet.css", stylesheet))
+ if (loadRawText(ScPaths::preferencesDir() + "/stylesheet.css", stylesheet))
{
qApp->setStyleSheet(QString(stylesheet));
}
@@ -9248,7 +9248,7 @@
propertiesPalette->Cpal->setColors(m_prefsManager->colorSet());
m_prefsManager->appPrefs.defaultGradients = dia->dialogGradients;
m_prefsManager->appPrefs.defaultPatterns = dia->dialogPatterns;
- QString Cpfad = QDir::toNativeSeparators(ScPaths::getApplicationDataDir())+"DefaultColors.xml";
+ QString Cpfad = QDir::toNativeSeparators(ScPaths::applicationDataDir())+"DefaultColors.xml";
const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_SLA150EXPORT);
if (fmt)
{
Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp (original)
+++ trunk/Scribus/scribus/scribusXml.cpp Sun Nov 20 22:34:35 2016
@@ -38,6 +38,7 @@
#include "scclocale.h"
#include "scmimedata.h"
#include "scpage.h"
+#include "scpaths.h"
#include "scribusdoc.h"
#include "selection.h"
#include "units.h"
@@ -119,7 +120,7 @@
bool ScriXmlDoc::ReadElemToLayer(QString fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub, int toLayer)
{
QString elementData;
- QString fileDir = QDir::homePath();
+ QString fileDir = ScPaths::applicationDataDir();
if (isDataFromFile)
{
QByteArray f;
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Sun Nov 20 22:34:35 2016
@@ -388,7 +388,7 @@
langs.append(lang);
//add in user preferences lang, only overridden by lang command line option
- QString Pff = QDir::toNativeSeparators(ScPaths::getApplicationDataDir());
+ QString Pff = QDir::toNativeSeparators(ScPaths::preferencesDir());
QFileInfo Pffi = QFileInfo(Pff);
if (Pffi.exists())
{
@@ -396,7 +396,7 @@
if (Pffi.isDir())
PrefsPfad = Pff;
else
- PrefsPfad = QDir::homePath();
+ PrefsPfad = ScPaths::preferencesDir();
QString prefsXMLFile=QDir::toNativeSeparators(PrefsPfad + "/prefs150.xml");
QFileInfo infoPrefsFile(prefsXMLFile);
if (infoPrefsFile.exists())
@@ -650,29 +650,23 @@
void ScribusQApp::neverSplash(bool splashOff)
{
- QString prefsDir = ScPaths::getApplicationDataDir();
- QFile ns(prefsDir + ".neversplash");
+ QString prefsDir = ScPaths::preferencesDir(true);
+ QFile nsFile(prefsDir + ".neversplash");
if (splashOff)
{
- if (QFileInfo(QDir::homePath()).exists())
- {
- QDir prefsDirectory(prefsDir);
- if (!QFileInfo(prefsDir).exists())
- prefsDirectory.mkdir(prefsDir);
- if (!ns.exists() && ns.open(QIODevice::WriteOnly))
- ns.close();
- }
+ if (!nsFile.exists() && nsFile.open(QIODevice::WriteOnly))
+ nsFile.close();
}
else
{
if (neverSplashExists())
- ns.remove();
+ nsFile.remove();
}
}
bool ScribusQApp::neverSplashExists()
{
- return QFileInfo(ScPaths::getApplicationDataDir() + ".neversplash").exists();
+ return QFileInfo(ScPaths::preferencesDir() + ".neversplash").exists();
}
void ScribusQApp::downloadComplete(const QString &t)
Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Sun Nov 20 22:34:35 2016
@@ -312,7 +312,7 @@
InputProfiles.clear();
InputProfilesCMYK.clear();
LabProfiles.clear();
- profDirs = ScPaths::getSystemProfilesDirs();
+ profDirs = ScPaths::systemProfilesDirs();
profDirs.prepend( m_prefsManager->appPrefs.pathPrefs.colorProfiles );
profDirs.prepend( ScPaths::instance().shareDir()+"profiles/");
for(int i = 0; i < profDirs.count(); i++)
Modified: trunk/Scribus/scribus/third_party/zip/scribus_zip.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/third_party/zip/scribus_zip.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/zip/scribus_zip.cpp (original)
+++ trunk/Scribus/scribus/third_party/zip/scribus_zip.cpp Sun Nov 20 22:34:35 2016
@@ -118,13 +118,13 @@
QString pwd = QDir::currentPath();
QString outDir;
if (path.isNull())
- outDir = ScPaths::getTempFileDir();
+ outDir = ScPaths::tempFileDir();
else
outDir=path;
QFile f(outDir);
QFileInfo fi(f);
if (!fi.isWritable())
- outDir = ScPaths::getApplicationDataDir();
+ outDir = ScPaths::applicationDataDir();
QDir::setCurrent(outDir);
UnZip::ErrorCode ec = m_uz->extractFile(name, outDir, static_cast<UnZip::ExtractionOption>(eo));
retVal = (ec == UnZip::Ok);
Modified: trunk/Scribus/scribus/ui/charselect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/charselect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/charselect.cpp (original)
+++ trunk/Scribus/scribus/ui/charselect.cpp Sun Nov 20 22:34:35 2016
@@ -37,7 +37,7 @@
uniClearButton->setIcon(IconManager::instance()->loadIcon("16/document-new.png"));
m_userTableModel = new CharTableModel(this, 6, m_doc, PrefsManager::instance()->appPrefs.itemToolPrefs.textFont);
- loadUserContent(ScPaths::getApplicationDataDir() + "charpalette.ucp");
+ loadUserContent(ScPaths::applicationDataDir() + "charpalette.ucp");
m_unicodeSearchModel = new UnicodeSearchModel(this);
@@ -71,7 +71,7 @@
if (!m_doc)
{
- saveUserContent(ScPaths::getApplicationDataDir() + "charpalette.ucp");
+ saveUserContent(ScPaths::applicationDataDir() + "charpalette.ucp");
return;
}
Modified: trunk/Scribus/scribus/ui/helpbrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/helpbrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/helpbrowser.cpp (original)
+++ trunk/Scribus/scribus/ui/helpbrowser.cpp Sun Nov 20 22:34:35 2016
@@ -548,7 +548,7 @@
{
// QString baseHelpDir = ScPaths::instance().docDir();
// QString altHelpDir = ScPaths::instance().getApplicationDataDir();
- QString baseHelpDir = ScPaths::instance().getUserHelpFilesDir(false);
+ QString baseHelpDir = ScPaths::instance().userHelpFilesDir(false);
QString installHelpDir = ScPaths::instance().docDir();
QString baseHelpMenuFile = QDir::toNativeSeparators(baseHelpDir + language + "/menu.xml");
@@ -708,7 +708,7 @@
*/
QString HelpBrowser::bookmarkFile()
{
- QString appDataDir(ScPaths::getApplicationDataDir());
+ QString appDataDir(ScPaths::applicationDataDir());
QString fname(appDataDir + "doc/bookmarks.xml");
if (!QFile::exists(fname))
{
@@ -725,7 +725,7 @@
*/
QString HelpBrowser::historyFile()
{
- QString appDataDir(ScPaths::getApplicationDataDir());
+ QString appDataDir(ScPaths::applicationDataDir());
QString fname(appDataDir + "doc/history.xml");
if (!QFile::exists(fname))
{
Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Sun Nov 20 22:34:35 2016
@@ -125,7 +125,7 @@
else
pfad = csm.paletteFileFromName(docColSet);
QFileInfo fi(pfad);
- if (fi.absolutePath().contains(ScPaths::getApplicationDataDir()+"swatches/locked"))
+ if (fi.absolutePath().contains(ScPaths::applicationDataDir()+"swatches/locked"))
paletteLocked = true;
else
paletteLocked = !fi.isWritable();
@@ -1833,7 +1833,7 @@
if (!mainWin->HaveDoc)
{
QFileInfo fi(pfadC2);
- if (fi.absolutePath().contains(ScPaths::getApplicationDataDir()+"swatches/locked"))
+ if (fi.absolutePath().contains(ScPaths::applicationDataDir()+"swatches/locked"))
paletteLocked = true;
else
paletteLocked = !fi.isWritable();
@@ -1880,7 +1880,7 @@
{
QString filename = name;
filename.replace(" ", "_");
- filename = QDir::toNativeSeparators(ScPaths::getUserPaletteFilesDir(true)) + filename;
+ filename = QDir::toNativeSeparators(ScPaths::userPaletteFilesDir(true)) + filename;
filename += ".xml";
const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_SLA150EXPORT);
if (fmt)
Modified: trunk/Scribus/scribus/ui/prefs_spelling.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/prefs_spelling.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_spelling.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_spelling.cpp Sun Nov 20 22:34:35 2016
@@ -80,7 +80,7 @@
downloadProgressBar->setVisible(true);
dlLabel->setVisible(true);
int i=0;
- QString userDictDir(ScPaths::getUserDictDir(ScPaths::Spell, true));
+ QString userDictDir(ScPaths::userDictDir(ScPaths::Spell, true));
foreach(DownloadItem d, dictList)
{
if (dlLangs.contains(d.lang))
Modified: trunk/Scribus/scribus/ui/preview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/preview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/preview.cpp (original)
+++ trunk/Scribus/scribus/ui/preview.cpp Sun Nov 20 22:34:35 2016
@@ -583,7 +583,7 @@
PSLib *dd = new PSLib(options, true, prefsManager->appPrefs.fontPrefs.AvailFonts, ReallyUsed, doc->PageColors, false, !spotColors->isChecked());
if (dd != NULL)
{
- dd->PS_set_file( ScPaths::getTempFileDir() + "/tmp.ps");
+ dd->PS_set_file( ScPaths::tempFileDir() + "/tmp.ps");
ret = dd->CreatePS(doc, options);
delete dd;
if (ret != 0) return 1;
@@ -652,10 +652,10 @@
args.append( cmd1 );
// then add any final args and call gs
if ((EnableCMYK->isChecked()) && HaveTiffSep)
- args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.tif")) );
+ args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sc.tif")) );
else
- args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.png")) );
- args.append( QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/tmp.ps") );
+ args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sc.png")) );
+ args.append( QDir::toNativeSeparators(ScPaths::tempFileDir()+"/tmp.ps") );
args.append( "-c" );
args.append( "showpage" );
args.append( "-c" );
@@ -698,7 +698,7 @@
PSLib *dd = new PSLib(options, true, prefsManager->appPrefs.fontPrefs.AvailFonts, ReallyUsed, doc->PageColors, false, !spotColors->isChecked());
if (dd != NULL)
{
- dd->PS_set_file(ScPaths::getTempFileDir()+"/tmp.ps");
+ dd->PS_set_file(ScPaths::tempFileDir()+"/tmp.ps");
ret = dd->CreatePS(doc, options);
delete dd;
if (ret != 0) return 1;
@@ -742,9 +742,9 @@
cmd += QString("%1%2").arg(sep).arg(QDir::toNativeSeparators(extraFonts->get(i,0)));
if (!cmd.isEmpty())
args1.append(cmd);
- args1.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.tif")) );
-
- args2.append( QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/tmp.ps") );
+ args1.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sc.tif")) );
+
+ args2.append( QDir::toNativeSeparators(ScPaths::tempFileDir()+"/tmp.ps") );
args2.append("-c");
args2.append("quit");
@@ -762,7 +762,7 @@
}
allSeps += "]";
cmd += allSeps + " /SeparationOrder [ /Cyan /Magenta /Yellow /Black] >> setpagedevice";
- QFile fx(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+ QFile fx(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sep.ps"));
if (fx.open(QIODevice::WriteOnly))
{
QTextStream tsx(&fx);
@@ -775,9 +775,9 @@
// args3.append("-f");
QString gsExe(getShortPathName(prefsManager->ghostscriptExecutable()));
- ret = System(gsExe, args1 + args3 + args2, ScPaths::getTempFileDir()+"/sc.tif.txt" );
-
- QFile sepInfo(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.tif.txt"));
+ ret = System(gsExe, args1 + args3 + args2, ScPaths::tempFileDir()+"/sc.tif.txt" );
+
+ QFile sepInfo(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sc.tif.txt"));
sepsToFileNum.clear();
if (sepInfo.open(QIODevice::ReadOnly))
{
@@ -806,7 +806,7 @@
{
args3.clear();
args3.append("-sDEVICE=tiffsep");
- QFile fx(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+ QFile fx(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sep.ps"));
if (fx.open(QIODevice::WriteOnly))
{
QTextStream tsx(&fx);
@@ -814,7 +814,7 @@
fx.close();
}
args3.append("-f");
- args3.append(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+ args3.append(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sep.ps"));
// args3.append("-c");
// args3.append("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
// args3.append("-f");
@@ -827,7 +827,7 @@
{
args3.clear();
args3.append("-sDEVICE=tiffsep");
- QFile fx(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+ QFile fx(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sep.ps"));
if (fx.open(QIODevice::WriteOnly))
{
QTextStream tsx(&fx);
@@ -835,7 +835,7 @@
fx.close();
}
args3.append("-f");
- args3.append(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+ args3.append(QDir::toNativeSeparators(ScPaths::tempFileDir()+"/sep.ps"));
// args3.append("-c");
// args3.append("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
// args3.append("-f");
@@ -968,11 +968,11 @@
if (flagsVisible["Cyan"]->isChecked())
{
if ((GsMinor < 54) && (GsMajor < 9))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Cyan.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.tif.Cyan.tif", 1, cms, ScImage::RGBData, 72, &mode);
else if ((GsMajor < 9) || ((GsMajor == 9) && (GsMinor <= 5)))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Cyan.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.Cyan.tif", 1, cms, ScImage::RGBData, 72, &mode);
else
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc(Cyan).tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc(Cyan).tif", 1, cms, ScImage::RGBData, 72, &mode);
if (!loaderror)
{
imageLoadError(Bild, Seite);
@@ -986,11 +986,11 @@
if (flagsVisible["Magenta"]->isChecked())
{
if ((GsMinor < 54) && (GsMajor < 9))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Magenta.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.tif.Magenta.tif", 1, cms, ScImage::RGBData, 72, &mode);
else if ((GsMajor < 9) || ((GsMajor == 9) && (GsMinor <= 5)))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Magenta.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.Magenta.tif", 1, cms, ScImage::RGBData, 72, &mode);
else
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc(Magenta).tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc(Magenta).tif", 1, cms, ScImage::RGBData, 72, &mode);
if (!loaderror)
{
imageLoadError(Bild, Seite);
@@ -1004,11 +1004,11 @@
if (flagsVisible["Yellow"]->isChecked())
{
if ((GsMinor < 54) && (GsMajor < 9))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Yellow.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.tif.Yellow.tif", 1, cms, ScImage::RGBData, 72, &mode);
else if ((GsMajor < 9) || ((GsMajor == 9) && (GsMinor <= 5)))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Yellow.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.Yellow.tif", 1, cms, ScImage::RGBData, 72, &mode);
else
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc(Yellow).tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc(Yellow).tif", 1, cms, ScImage::RGBData, 72, &mode);
if (!loaderror)
{
imageLoadError(Bild, Seite);
@@ -1029,11 +1029,11 @@
{
QString fnam;
if ((GsMinor < 54) && (GsMajor < 9))
- fnam = QString(ScPaths::getTempFileDir()+"/sc.tif.s%1.tif").arg(sepit.value());
+ fnam = QString(ScPaths::tempFileDir()+"/sc.tif.s%1.tif").arg(sepit.value());
else if ((GsMajor < 9) || ((GsMajor == 9) && (GsMinor <= 5)))
- fnam = QString(ScPaths::getTempFileDir()+"/sc.s%1.tif").arg(sepit.value());
+ fnam = QString(ScPaths::tempFileDir()+"/sc.s%1.tif").arg(sepit.value());
else
- fnam = QString(ScPaths::getTempFileDir()+"/sc(%1).tif").arg(sepit.key());
+ fnam = QString(ScPaths::tempFileDir()+"/sc(%1).tif").arg(sepit.key());
if (!im.loadPicture(fnam, 1, cms, ScImage::RGBData, 72, &mode))
{
imageLoadError(Bild, Seite);
@@ -1051,11 +1051,11 @@
CMSettings cms(doc, "", Intent_Perceptual);
cms.allowColorManagement(false);
if ((GsMinor < 54) && (GsMajor < 9))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Black.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.tif.Black.tif", 1, cms, ScImage::RGBData, 72, &mode);
else if ((GsMajor < 9) || ((GsMajor == 9) && (GsMinor <= 5)))
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Black.tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc.Black.tif", 1, cms, ScImage::RGBData, 72, &mode);
else
- loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc(Black).tif", 1, cms, ScImage::RGBData, 72, &mode);
+ loaderror = im.loadPicture(ScPaths::tempFileDir()+"/sc(Black).tif", 1, cms, ScImage::RGBData, 72, &mode);
if (!loaderror)
{
imageLoadError(Bild, Seite);
@@ -1164,7 +1164,7 @@
int h2 = qRound(h);
image = QImage(w, h2, QImage::Format_ARGB32);
QByteArray imgc(w2, ' ');
- QFile f(ScPaths::getTempFileDir()+"/sc.png");
+ QFile f(ScPaths::tempFileDir()+"/sc.png");
if (f.open(QIODevice::ReadOnly))
{
if (doc->HasCMS || ScCore->haveCMS())
@@ -1256,7 +1256,7 @@
}
else
{
- if (!image.load(ScPaths::getTempFileDir()+"/sc.png"))
+ if (!image.load(ScPaths::tempFileDir()+"/sc.png"))
{
imageLoadError(Bild, Seite);
return Bild;
Modified: trunk/Scribus/scribus/ui/resourcemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/resourcemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/resourcemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/resourcemanager.cpp Sun Nov 20 22:34:35 2016
@@ -842,24 +842,24 @@
switch (category)
{
case RM_FONTS:
- destinationFolder=ScPaths::getUserFontDir(true);
+ destinationFolder=ScPaths::userFontDir(true);
break;
case RM_HYPH:
- destinationFolder=ScPaths::getUserDictDir(ScPaths::Hyph, true);
+ destinationFolder=ScPaths::userDictDir(ScPaths::Hyph, true);
break;
case RM_SPELL:
- destinationFolder=ScPaths::getUserDictDir(ScPaths::Spell, true);
+ destinationFolder=ScPaths::userDictDir(ScPaths::Spell, true);
break;
case RM_TEMPLATES:
//temporary
- destinationFolder=ScPaths::getTempFileDir();
+ destinationFolder=ScPaths::tempFileDir();
//TODO!!!! destinationFolder=ScPaths::getUserDictDir(true);
break;
case RM_HELP:
- destinationFolder=ScPaths::getUserHelpFilesDir(true);
+ destinationFolder=ScPaths::userHelpFilesDir(true);
break;
case RM_PALETTES:
- destinationFolder=ScPaths::getUserPaletteFilesDir(true);
+ destinationFolder=ScPaths::userPaletteFilesDir(true);
break;
case RM_TEST:
destinationFolder=ScPaths::downloadDir();
@@ -1000,7 +1000,7 @@
{
if (d.filetype=="zip")
{
- QString fn(ScPaths::getUserFontDir(true)+d.files);
+ QString fn(ScPaths::userFontDir(true)+d.files);
QFile dledFile(fn);
QFileInfo fi(dledFile);
if (!dledFile.exists())
@@ -1014,8 +1014,8 @@
{
QStringList zipFileContents(fun->files());
QStringList extractFiles(d.extractfiles.split(";", QString::SkipEmptyParts));
- QString toDir(ScPaths::getUserFontDir(false)+fi.baseName()+"/");
- QDir dir(ScPaths::getUserFontDir(false));
+ QString toDir(ScPaths::userFontDir(false)+fi.baseName()+"/");
+ QDir dir(ScPaths::userFontDir(false));
if (!dir.exists(fi.baseName()))
dir.mkdir(fi.baseName());
foreach (QString f2e, zipFileContents)
@@ -1040,7 +1040,7 @@
{
if (d.filetype=="zip")
{
- QString fn(ScPaths::getUserDictDir(static_cast<ScPaths::DictType>(fileType), true)+d.files);
+ QString fn(ScPaths::userDictDir(static_cast<ScPaths::DictType>(fileType), true)+d.files);
QFile dledFile(fn);
QFileInfo fi(dledFile);
if (!dledFile.exists())
@@ -1054,7 +1054,7 @@
{
QStringList zipContents(fun->files());
QStringList extractFiles(d.extractfiles.split(";", QString::SkipEmptyParts));
- QString toDir(ScPaths::getUserDictDir(static_cast<ScPaths::DictType>(fileType), false));
+ QString toDir(ScPaths::userDictDir(static_cast<ScPaths::DictType>(fileType), false));
QDir dir(toDir);
if (dir.exists())
{
@@ -1083,7 +1083,7 @@
//qDebug()<<d.desc<<d.download<<d.files<<d.type;
if (d.filetype=="zip")
{
- QString fn(ScPaths::getUserHelpFilesDir(true)+d.files);
+ QString fn(ScPaths::userHelpFilesDir(true)+d.files);
//qDebug()<<fn;
QFile dledFile(fn);
QFileInfo fi(dledFile);
@@ -1093,7 +1093,7 @@
qDebug()<<"File doesn\'t exist"<<fn<<fn+".sha256";
else
{
- if (checkFileHash(ScPaths::getUserHelpFilesDir(false), fi.fileName(), fiSHA256.fileName(), QCryptographicHash::Sha256))
+ if (checkFileHash(ScPaths::userHelpFilesDir(false), fi.fileName(), fiSHA256.fileName(), QCryptographicHash::Sha256))
{
ScZipHandler* fun = new ScZipHandler();
if (!fun->open(fn))
@@ -1102,8 +1102,8 @@
{
QStringList zipFileContents(fun->files());
QStringList extractFiles(d.extractfiles.split(";", QString::SkipEmptyParts));
- QString toDir(ScPaths::getUserHelpFilesDir(false)+d.lang+"/");
- QDir dir(ScPaths::getUserHelpFilesDir(false));
+ QString toDir(ScPaths::userHelpFilesDir(false)+d.lang+"/");
+ QDir dir(ScPaths::userHelpFilesDir(false));
if (!dir.exists(d.lang))
dir.mkdir(d.lang);
foreach (QString f2e, zipFileContents)
@@ -1387,7 +1387,7 @@
{
if (filesToDownload.contains(d.desc))
{
- ScQApp->dlManager()->addURL(d.url+"/"+licenceFileName, true, ScPaths::downloadDir(), ScPaths::getTempFileDir());
+ ScQApp->dlManager()->addURL(d.url+"/"+licenceFileName, true, ScPaths::downloadDir(), ScPaths::tempFileDir());
connect(ScQApp->dlManager(), SIGNAL(finished()), this, SLOT(downloadLicenseFinished()));
connect(ScQApp->dlManager(), SIGNAL(fileReceived(const QString&)), this, SLOT(downloadLicenseFileFinished(const QString&)));
connect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(downloadLicenseFileFailed(const QString&)));
Modified: trunk/Scribus/scribus/ui/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.cpp Sun Nov 20 22:34:35 2016
@@ -46,6 +46,7 @@
#include "prefsmanager.h"
#include "query.h"
#include "scimage.h"
+#include "scpaths.h"
#include "scpreview.h"
#include "scribuscore.h"
#include "util.h"
@@ -261,7 +262,7 @@
dd.mkdir(QDir::cleanPath(QDir::toNativeSeparators(dir + "/" + fid.baseName())));
}
QString source = "";
- QString fileDir = QDir::homePath();
+ QString fileDir = ScPaths::scrapbookDir(true);
bool first = true;
DOC = elem.firstChild();
while(!DOC.isNull())
Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp (original)
+++ trunk/Scribus/scribus/upgradechecker.cpp Sun Nov 20 22:34:35 2016
@@ -71,7 +71,7 @@
void UpgradeChecker::fetch()
{
QString filename("scribusversions.xml");
- m_tempFile=ScPaths::getTempFileDir()+filename;
+ m_tempFile=ScPaths::tempFileDir()+filename;
m_fin=false;
Modified: trunk/Scribus/scribus/util_ghostscript.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21526&path=/trunk/Scribus/scribus/util_ghostscript.cpp
==============================================================================
--- trunk/Scribus/scribus/util_ghostscript.cpp (original)
+++ trunk/Scribus/scribus/util_ghostscript.cpp Sun Nov 20 22:34:35 2016
@@ -413,7 +413,7 @@
{
QString tmp, cmd1, cmd2;
QString pdfFile = QDir::toNativeSeparators(fn);
- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.png");
+ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
QPixmap pm;
int ret = -1;
tmp.setNum(Page);
More information about the scribus-commit
mailing list