Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3152 → Rev 3153

/trunk/Scribus/scribus/scribusXml.cpp
3190,7 → 3190,8
if(!f.open(IO_WriteOnly))
return;
QTextStream s(&f);
s<<docu.toCString();
s.setEncoding(QTextStream::UnicodeUTF8);
s<<docu.toString();
f.close();
}
 
3200,8 → 3201,13
QFile f(ho);
if(!f.open(IO_ReadOnly))
return false;
if(!docu.setContent(&f))
QTextStream ts(&f);
ts.setEncoding(QTextStream::UnicodeUTF8);
QString errorMsg;
int errorLine = 0, errorColumn = 0;
if( !docu.setContent(ts.read(), &errorMsg, &errorLine, &errorColumn) )
{
qDebug("Failed to read prefs XML: %s at line %i, col %i", errorMsg.local8Bit().data(), errorLine, errorColumn);
f.close();
return false;
}
3469,7 → 3475,7
lf.setNamedColor(dc.attribute("CMYK"));
else
lf.fromQColor(QColor(dc.attribute("RGB")));
Vorein->DColors[dc.attribute("NAME")] = lf;
Vorein->DColors[dc.attribute("NAME")] = lf;
}
if (dc.tagName()=="Substitute")
Vorein->GFontSub[dc.attribute("Name")] = dc.attribute("Replace");
/trunk/Scribus/scribus/scribus.cpp
7145,7 → 7145,7
Prefs.PrinterFile = PDef.Dname;
Prefs.PrinterCommand = PDef.Command;
ScriXmlDoc *ss = new ScriXmlDoc();
ss->WritePref(&Prefs, PrefsPfad+"/scribus.rc");
ss->WritePref(&Prefs, PrefsPfad+"/scribus123.rc");
delete ss;
//Continue with new Prefs Format
SavePrefsXML();
7167,7 → 7167,13
void ScribusApp::ReadPrefs()
{
ScriXmlDoc *ss = new ScriXmlDoc();
bool erg = ss->ReadPref(&Prefs, PrefsPfad+"/scribus.rc", splash);
QString loadPrefsFileName(PrefsPfad+"/scribus123.rc");
if (!QFile::exists(loadPrefsFileName))
// Import potentially mangled prefs generated by 1.2.2.1 and older
// These will either be valid utf-8, or damaged in ways that let
// us still load them but with 8-bit text mangled.
loadPrefsFileName = PrefsPfad+"/scribus.rc";
bool erg = ss->ReadPref(&Prefs, loadPrefsFileName, splash);
delete ss;
if (!erg)
return;
7183,11 → 7189,11
uint max = QMIN(Prefs.RecentDCount, Prefs.RecentDocs.count());
for (uint m = 0; m < max; ++m)
{
QFileInfo fd(QString::fromUtf8(Prefs.RecentDocs[m]));
QFileInfo fd(Prefs.RecentDocs[m]);
if (fd.exists())
{
RecentDocs.append(QString::fromUtf8(Prefs.RecentDocs[m]));
recentMenu->insertItem(QString::fromUtf8(Prefs.RecentDocs[m]));
RecentDocs.append(Prefs.RecentDocs[m]);
recentMenu->insertItem(Prefs.RecentDocs[m]);
}
}
MaPal->move(Prefs.Mapalx, Prefs.Mapaly);