r21732 by jghali - version the font cache file to avoid conflicts between different scribus version with different font directories

scribus-commit scribus-commit at lists.scribus.net
Tue Jan 17 22:13:21 UTC 2017


Author: jghali
Date: Tue Jan 17 22:13:21 2017
New Revision: 21732

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21732
Log:
version the font cache file to avoid conflicts between different scribus version with different font directories

Modified:
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/scfonts.cpp

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21732&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Tue Jan 17 22:13:21 2017
@@ -764,6 +764,10 @@
 	QFileInfo oldPi7 = QFileInfo(oldPR7);
 	if (oldPi7.exists())
 		moveFile(oldPR7, m_prefsLocation+"scripter150.rc");
+	QString oldPR8 = QDir::toNativeSeparators(oldPrefsLocation + "checkfonts.xml");
+	QFileInfo oldPi8 = QFileInfo(oldPR8);
+	if (oldPi8.exists())
+		moveFile(oldPR8, m_prefsLocation+"checkfonts150.xml");
 
 
 	//Move plugin data files to new plugin data file directory
@@ -789,23 +793,26 @@
 		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];
+	QString prefs135[5], prefs140[5], prefs150[5];
 
 	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");
+	prefs135[4]=QDir::toNativeSeparators(m_prefsLocation+"checkfonts.xml");
 	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");
+	prefs140[4]=QDir::toNativeSeparators(m_prefsLocation+"checkfonts.xml");
 	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)
+	prefs150[4]=QDir::toNativeSeparators(m_prefsLocation+"checkfonts150.xml");
+
+	bool existsPrefs135[5], existsPrefs140[5], existsPrefs150[5];
+	for (uint i=0;i<5;++i)
 	{
 		existsPrefs135[i]=QFile::exists(prefs135[i]);
 		existsPrefs140[i]=QFile::exists(prefs140[i]);
@@ -833,7 +840,7 @@
 					QMessageBox::Yes	// batch default
 				)==QMessageBox::Yes )
 			{
-				for (uint i=0;i<4;++i)
+				for (uint i=0;i<5;++i)
 				{
 					if (existsPrefs135[i] && !existsPrefs150[i])
 						copyFile(prefs135[i], prefs150[i]);
@@ -845,7 +852,7 @@
 	}
 	else if(existsPrefs140[0])
 	{
-		for (uint i=0;i<4;++i)
+		for (uint i=0;i<5;++i)
 		{
 			if (existsPrefs140[i] && !existsPrefs150[i])
 				copyFile(prefs140[i], prefs150[i]);
@@ -853,7 +860,7 @@
 	}
 	else if(existsPrefs135[0])
 	{
-		for (uint i=0;i<4;++i)
+		for (uint i=0;i<5;++i)
 		{
 			if (existsPrefs135[i] && !existsPrefs150[i])
 				copyFile(prefs135[i], prefs150[i]);

Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21732&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp	(original)
+++ trunk/Scribus/scribus/scfonts.cpp	Tue Jan 17 22:13:21 2017
@@ -1099,7 +1099,7 @@
 	checkedFonts.clear();
 	struct testCache foCache;
 	QDomDocument docu("fontcacherc");
-	QFile f(pf + "/checkfonts.xml");
+	QFile f(pf + "/checkfonts150.xml");
 	if(!f.open(QIODevice::ReadOnly))
 		return;
 	ScCore->setSplashStatus( QObject::tr("Reading Font Cache") );
@@ -1150,7 +1150,7 @@
 		}
 	}
 	ScCore->setSplashStatus( QObject::tr("Writing updated Font Cache") );
-	QFile f(pf + "/checkfonts.xml");
+	QFile f(pf + "/checkfonts150.xml");
 	if(f.open(QIODevice::WriteOnly))
 	{
 		QTextStream s(&f);




More information about the scribus-commit mailing list