KTextEditor casts

Bernd Gehrmann Bernd-Gehrmann at gmx.de
Sun May 26 16:09:03 UTC 2002


On Saturday 25 May 2002 19:34, you wrote:
> Hi,
> some KTextEditor news:
> Now each interfaces has a global "cast function":

Nice. But what about making these functions safe against null arguments?
For example, it would be nice if the following would be possible:

  void Foo::activePartChanged(KParts::Part *part)
  {
    // Return if either no part is active or the interface is not implemented
    KTextEditor::EditInterface *iface = KTextEditor::editInterface(part);
    if (!iface)
      return;
    ....
  }

(hypothetical example of course)

Bernd.




More information about the KDevelop-devel mailing list