Commit b2069baf authored by Boudewijn Rempt's avatar Boudewijn Rempt

Move the gradient save code to the saveToDevice method

Resources used to be hardcoded to only work with files, but with the
advent of resource bundles, that's not necessarily always the case
anymore, so resources should load/save using io devices.
parent fdb88bbd
......@@ -185,7 +185,15 @@ bool KoSegmentGradient::save()
return false;
}
QTextStream fileContent(&file);
saveToDevice(&file);
file.close();
return true;
}
bool KoSegmentGradient::saveToDevice(QIODevice *dev) const
{
QTextStream fileContent(dev);
fileContent << "GIMP Gradient\n";
fileContent << "Name: " << name() << "\n";
fileContent << m_segments.count() << "\n";
......@@ -206,11 +214,6 @@ bool KoSegmentGradient::save()
return true;
}
bool KoSegmentGradient::saveToDevice(QIODevice *) const
{
return false;
}
KoGradientSegment *KoSegmentGradient::segmentAt(qreal t) const
{
Q_ASSERT(t >= 0 || t <= 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment