[prev in list] [next in list] [prev in thread] [next in thread]
List: ktexteditor-devel
Subject: Re: KTextEditor container extension
From: Dominik Haumann <dhdev () gmx ! de>
Date: 2007-07-30 22:10:11
Message-ID: 200707310010.11910.dhdev () gmx ! de
[Download RAW message or body]
On Monday 30 July 2007, Philippe Fremy wrote:
> +ContainerExtension * Editor::containerExtension()
> +{
> + return d->m_containerExtension;
> +
> +}
[...]
> + * To check if this extension is supported, kpart code should do:
> + * @code
> + * Editor * editor = KTextEditor::EditorChooser::editor();
> + * ContainterExtension * ext = qobject_cast<ContainerExtension *>( editor->ContainerExtension() );
^ lower c
> + * if (ext != NULL && if (ext->supportsDocumentCreation()) {
This does not make sense. Either the return value is 0 or
already a ContainerExtension, or how is it supposed to work?
What about this:
class ...EXPORT... ContainerInterface {
virtual void setContainer( ContainerExtension * ext ) = 0;
virtual ContainerExtension * container() = 0;
};
Then, the following code peaces:
ContainerInterface *iface = qobject_cast<ContainerInterface*>(editor); // cast the editor
if (iface) {
// support + 100% implementation of ContainerExtension exists
} else {
// not supported, now you can't do anything useful with ContainerExtension
// anyway, so it's not supported
}
[...]
+ virtual bool setActiveView( View * view )=0;
We have similar functions in the Kate App in KateViewSpace:
::currentView();
::showView();
...what about a getter function like activeView()?
Instead of calling the functions requestViewRemoval etc, what about simply
removeView() etc? The bool return type already contains the success.
[...]
> +
> +
> +}; // namespace KTextEditor
^
breaks gcc's -pedantic option.
I agree with Chriostoph: Please keep the API minimal. If a lib implements
the interface, it simply should implement all the functions.
Api documentation related stuff (the nitpicking part ;) ):
- use \foo instead of @foo. We agreed on that some time ago, just to be
consistent within KTE
- use
/**
*
*/ ;)
- \see & \sa always comes last, after \return (as in the Qt-documentaion)
Just some thoughts, maybe I'm wrong ;)
Dominik
_______________________________________________
KTextEditor-Devel mailing list
KTextEditor-Devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic