void logFailure(const QString & reason, const KoColorSpace * srcCs, const KoColorSpace * dstCs) { QString profile1("no profile"); QString profile2("no profile"); if (srcCs->profile()) profile1 = srcCs->profile()->name(); if (dstCs->profile()) profile2 = dstCs->profile()->name(); QWARN(QString("Failed %1 %2 -> %3 %4 %5") .arg(srcCs->name()) .arg(profile1) .arg(dstCs->name()) .arg(profile2) .arg(reason) .toLatin1()); }
void ArtworkCalligraphyOptionWidget::addDefaultProfiles() { // check if the profiles where already added KConfig config(KGlobal::mainComponent(), RCFILENAME); KConfigGroup generalGroup(&config, "General"); if (generalGroup.readEntry("defaultProfilesAdded", false)) return; KConfigGroup profile0(&config, "Profile0"); profile0.writeEntry("name", i18n("Mouse")); profile0.writeEntry("usePath", false); profile0.writeEntry("usePressure", false); profile0.writeEntry("useAngle", false); profile0.writeEntry("width", 30.0); profile0.writeEntry("thinning", 0.2); profile0.writeEntry("angle", 30); profile0.writeEntry("fixation", 1.0); profile0.writeEntry("caps", 0.0); profile0.writeEntry("mass", 3.0); profile0.writeEntry("drag", 0.7); KConfigGroup profile1(&config, "Profile1"); profile1.writeEntry("name", i18n("Graphics Pen")); profile1.writeEntry("width", 50.0); profile1.writeEntry("usePath", false); profile1.writeEntry("usePressure", false); profile1.writeEntry("useAngle", false); profile1.writeEntry("thinning", 0.2); profile1.writeEntry("angle", 30); profile1.writeEntry("fixation", 1.0); profile1.writeEntry("caps", 0.0); profile1.writeEntry("mass", 1.0); profile1.writeEntry("drag", 0.9); generalGroup.writeEntry("profile", i18n("Mouse")); generalGroup.writeEntry("defaultProfilesAdded", true); config.sync(); }