KApplication::cut()....
Aaron J. Seigo
aseigo at kde.org
Sat Sep 24 02:26:47 BST 2005
On Friday 23 September 2005 10:43, Benjamin Meyer wrote:
> On Friday 23 September 2005 12:15 pm, Aaron J. Seigo wrote:
> > On Friday 23 September 2005 09:32, Benjamin Meyer wrote:
> > > Very cool. Attached is the modified version
> >
> > and for apps that don't have a kmainwindow? besides, this is really just
> > tacking these methods on to some class because it "kinda sorta maybe
> > fits". in other words, exactly what was done with kapplication. this is
> > not good design IMHO.
> >
> > david's suggestion of a KStandardSlots class in Frameworks makes a hell
> > of a lot more sense. it has the added bonus of probably making the people
> > currently using these methods a lot happier, and they count more than
> > anyone else when it comes to this API, no?
>
> When would you not have a KMainWindow and want this KAction?
IMHO that's the wrong question.
what is the relationship of a global "cut, copy, paste" to a given
application's design? is my application even guaranteed to have a single main
window? nope: you could have 0 or 4 main windows... additionally, my
cut/copy/paste logic many not be in the mainwdow, it could be in a model or
control class. moreover, i could have a main window and not have any need for
cut/copy/paste making it just noise in the class. so the semantics of a
central cut() slot, for exmaple, does not map naturally or consistently to
the implementation of a main window.
this is why i say that putting it in the mainwindow is completely arbitrary.
why not put in a menubar class? or the statusbar? or any other place that the
app is likely to have one of?
as an appilication developer it would make sense for there to be a class that
represents "comon, global slots" no matter what my app looks like. this does
not make any assumptions about the implementation i have chosen, which makes
it work everywhere i go.
it also makes for a much easier to describe API. instead of having to teach
people that in addition to being the main window for the app, it also holds
these global application wide slots (overloading the conceptual purpose of
KMainWindow), we can teach people about this "common, global slots" class as
a separate concept. think of it from a documentation perspective.
--
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
Full time KDE developer sponsored by Trolltech (http://www.trolltech.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050923/2b829bac/attachment.sig>
More information about the kde-core-devel
mailing list