r18719 by craig - #11882: Set permissions on file save to original before loading
scribus-commit
scribus-commit at lists.scribus.net
Sun Jan 12 11:21:21 UTC 2014
Author: craig
Date: Sun Jan 12 11:21:21 2014
New Revision: 18719
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18719
Log:
#11882: Set permissions on file save to original before loading
Modified:
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18719&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Jan 12 11:21:21 2014
@@ -4099,6 +4099,7 @@
prefsManager->appPrefs.fontPrefs.AvailFonts.updateFontMap();
doc=new ScribusDoc();
+ doc->saveFilePermissions(QFile::permissions(fileName));
doc->is12doc=is12doc;
doc->appMode = modeNormal;
doc->HasCMS = false;
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18719&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Jan 12 11:21:21 2014
@@ -196,6 +196,7 @@
ScribusDoc::ScribusDoc() : UndoObject( tr("Document")), Observable<ScribusDoc>(NULL),
m_hasGUI(false),
+ docFilePermissions(QFileDevice::ReadOwner|QFileDevice::WriteOwner),
appPrefsData(PrefsManager::instance()->appPrefs),
docPrefsData(PrefsManager::instance()->appPrefs),
undoManager(UndoManager::instance()),
@@ -310,6 +311,7 @@
ScribusDoc::ScribusDoc(const QString& docName, int unitindex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup) : UndoObject( tr("Document")),
m_hasGUI(false),
+ docFilePermissions(QFileDevice::ReadOwner|QFileDevice::WriteOwner),
appPrefsData(PrefsManager::instance()->appPrefs),
docPrefsData(PrefsManager::instance()->appPrefs),
undoManager(UndoManager::instance()),
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18719&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sun Jan 12 11:21:21 2014
@@ -36,6 +36,7 @@
#include <QRectF>
#include <QStringList>
#include <QTimer>
+#include <QFile>
#include "gtgettext.h" //CB For the ImportSetup struct and itemadduserframe
#include "scribusapi.h"
@@ -1181,11 +1182,13 @@
void removeInlineFrame(int fIndex);
void checkItemForFrames(PageItem *it, int fIndex);
bool hasPreflightErrors();
+ QFileDevice::Permissions filePermissions() { return docFilePermissions; }
+ void saveFilePermissions(QFileDevice::Permissions p) { docFilePermissions=p; }
protected:
void addSymbols();
void applyPrefsPageSizingAndMargins(bool resizePages, bool resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins);
-
+ QFileDevice::Permissions docFilePermissions;
bool m_hasGUI;
ApplicationPrefs& appPrefsData;
ApplicationPrefs docPrefsData;
More information about the scribus-commit
mailing list