[scribus-dev] Fwd: r18639 by craig - Enable Collect for output to copy permissions on source files

Craig Bradney cbradney at scribus.info
Wed Dec 11 21:27:05 UTC 2013


FYI Mark, a slightly modified version but the same effect.

Author: craig
Date: Wed Dec 11 21:25:14 2013
New Revision: 18639

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18639
Log:
Enable Collect for output to copy permissions on source files

Modified:
    trunk/Scribus/scribus/collect4output.cpp

Modified: trunk/Scribus/scribus/collect4output.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=18639&path=/trunk/Scribus/scribus/collect4output.cpp
==============================================================================
--- trunk/Scribus/scribus/collect4output.cpp (original)
+++ trunk/Scribus/scribus/collect4output.cpp Wed Dec 11 21:25:14 2013
@@ -23,6 +23,7 @@
 #include "scpattern.h"
 #include "util_file.h"

+#include <QDebug>
 #include <QDir>
 #include <QMap>
 #include <QMessageBox>
@@ -465,7 +466,22 @@
 	}
 	if (copy)
 	{
-		copyFileAtomic(oldFile, m_outputDirectory + "images/" + newFile);
+		QString outFile(m_outputDirectory + "images/" + newFile);
+		bool success=copyFileAtomic(oldFile, outFile);
+		if (!success)
+			qDebug()<<"CollectForOutput::collectFile copyFileAtomic failed for"<<oldFile<<"to"<<outFile;
+		else
+		{
+			QFile of(outFile);
+			if (of.exists())
+			{
+				bool permsSet=of.setPermissions(QFile::permissions(oldFile));
+				if (!permsSet)
+					qDebug()<<"Unable to set permissions successfully while collecting for output on"<<outFile;
+			}
+			else
+				qDebug()<<"Unable to set permissions successfully while collecting for output on"<<outFile<<"as
the file does not exist";
+		}
 	}
 	collectedFiles[newFile] = oldFile;
 	return m_outputDirectory + "images/" + newFile;


_______________________________________________
scribus-commit mailing list
scribus-commit at lists.scribus.net
http://lists.scribus.net/mailman/listinfo/scribus-commit





More information about the scribus-dev mailing list