[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Fri Feb 16 18:15:59 CET 2007


The function now modifies one of its input arguments for no apparent  
reason.  For consistency it should probably be taking a KstPainter*  
too, but that's much less of a concern.

The code pattern that results is:

QSize mySize(10,10);
....
print(..., mySize, ...);
assert(mySize == QSize(10,10)); // now false ... sometimes??

On 16-Feb-07, at 9:33 AM, Barth Netterfield wrote:

> Can you explain your objection further?
>
> cbn
>
> On Thursday 15 February 2007 10:10:22 pm George Staikos wrote:
>> This API violates our coding conventions and is terribly confusing.
>> We need something better before the release.  Why exactly does this
>> have to be non-const?
>>
>> On 12-Feb-07, at 3:14 PM, Andrew Walker wrote:
>>> SVN commit 632970 by arwalker:
>>>
>>> remove const
>>>
>>>  M  +6 -6      kstviewwindow.cpp
>>>  M  +1 -1      kstviewwindow.h
>>>
>>>
>>> --- trunk/extragear/graphics/kst/src/libkstapp/kstviewwindow.cpp
>>> #632969:632970
>>> @@ -256,7 +256,7 @@
>>>        }
>>>        right = ( 72 * size.height() ) / resolution;
>>>        bottom = ( 72 * size.width() ) / resolution;
>>> -
>>> +
>>>        printer.setMargins(0, 0, 0, 0);
>>>        printer.setResolution(resolution);
>>>        printer.setPageSize(QPrinter::Letter);
>>> @@ -275,7 +275,7 @@
>>>      }
>>>
>>>      //
>>> -    // now try to open the ps file and convert it to an eps...
>>> +    // now try to open the .ps file and convert it to an .eps...
>>>      //
>>>      QFile filePS(filenameNew);
>>>      QFile fileEPS(filenameNewEps);
>>> @@ -285,17 +285,17 @@
>>>        if (fileEPS.open(IO_WriteOnly | IO_Truncate)) {
>>>          QTextStream streamPS(&filePS);
>>>          QTextStream streamEPS(&fileEPS);
>>> -
>>> +
>>>          line = streamPS.readLine();
>>>          if (line.startsWith("%!PS-Adobe-")) {
>>>            //
>>> -          // we have a ps file, so do the conversion...
>>> +          // we have a .ps file, so do the conversion...
>>>            //
>>>            streamEPS << "%!PS-Adobe-2.0 EPSF-2.0\n";
>>>
>>>            line = streamPS.readLine();
>>>            if (line.startsWith("%%BoundingBox:")) {
>>> -            streamEPS << "%%BoundingBox: 0 0 " << right << " " <<
>>> bottom << "\n";
>>> +            streamEPS << "%%BoundingBox: 0 0 " << right << " " <<
>>> bottom << "\n";
>>>            } else {
>>>              streamEPS << line << "\n";
>>>            }
>>> @@ -314,7 +314,7 @@
>>>  }
>>>
>>>
>>> -void KstViewWindow::print(KstPainter& paint, const QSize& size,
>>> int pages, int lineAdjust, bool monochrome, bool
>>> enhanceReadability, bool datetimeFooter, bool maintainAspectRatio,
>>> int pointStyleOrder, int lineStyleOrder, int lineWidthOrder, int
>>> maxLineWidth, int pointDensity) {
>>> +void KstViewWindow::print(KstPainter& paint, QSize& size, int
>>> pages, int lineAdjust, bool monochrome, bool enhanceReadability,
>>> bool datetimeFooter, bool maintainAspectRatio, int pointStyleOrder,
>>> int lineStyleOrder, int lineWidthOrder, int maxLineWidth, int
>>> pointDensity) {
>>>    KstTopLevelViewPtr tlv = kst_cast<KstTopLevelView>(view());
>>>
>>>    if (tlv) {
>>> --- trunk/extragear/graphics/kst/src/libkstapp/kstviewwindow.h
>>> #632969:632970
>>> @@ -50,7 +50,7 @@
>>>      void setPaused(bool paused);
>>>      void togglePaused();
>>>      void save(QTextStream& ts, const QString& indent =
>>> QString::null);
>>> -    void print( KstPainter& paint, const QSize& size, int pages,
>>> int lineAdjust, bool monochrome, bool enhanceReadability, bool
>>> dateTimeFooter, bool maintainAspectRatio, int pointStyleOrder, int
>>> lineStyleOrder, int lineWidthOrder, int maxLineWidth, int
>>> pointDensity );
>>> +    void print( KstPainter& paint, QSize& size, int pages, int
>>> lineAdjust, bool monochrome, bool enhanceReadability, bool
>>> dateTimeFooter, bool maintainAspectRatio, int pointStyleOrder, int
>>> lineStyleOrder, int lineWidthOrder, int maxLineWidth, int
>>> pointDensity );
>>>      KstTopLevelViewPtr view() const;
>>>      virtual void setCaption(const QString& szCaption);
>>>
>>> _______________________________________________
>>> Kst mailing list
>>> Kst at kde.org
>>> https://mail.kde.org/mailman/listinfo/kst
>>
>> --
>> George Staikos
>> KDE Developer				http://www.kde.org/
>> Staikos Computing Services Inc.		http://www.staikos.net/
>>
>>
>>
>> _______________________________________________
>> Kst mailing list
>> Kst at kde.org
>> https://mail.kde.org/mailman/listinfo/kst
>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst

--
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/





More information about the Kst mailing list