[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ktexteditor-devel
Subject:    Re: Smart cursors, ranges and performance
From:       Christoph Cullmann <cullmann () babylon2k ! de>
Date:       2005-06-25 9:47:34
Message-ID: 200506251147.37445 () cullmann
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday 25 June 2005 11:35, Hamish Rodda wrote:
> Hmm, interesting... I have actually been working today at implementing a 
> combination of 1 and 2, just creating an internal QObject when someone really 
> wants to have notification via signals, and otherwise not creating a QObject.  
> Your idea sounds quite good though.  I wonder which method would be the most 
> preferred by the users... they're both easy with what I've designed.
I think I would prefer my way over the qobject hassle, but hey, not sure ;)

> 
> Oh, I also wanted to know if there were any objections to removing functions 
> which allow retrieval of values via non-const references or pointers, such as 
> Cursor::position(int &_line, int &_column).  I think you get cleaner and more 
> readable code if you use line(), column() etc. instead.
I am not sure, as this is really a nice thing to have if you need in your code line \
and column as ints, otherwise stuff ends up to be very large or unefficient, like to \
fill 2 ints with cursor pos is now:

int l,c;
view->cursorPosition().position (l, c);

otherwise this would be:

int l (view->cursorPosition().line()), c (view->cursorPosition().column())
(which is much more inefficient)

or 
KTextEditor::Cursor tmp (view->cursorPosition());
int l (tmp.line()), c (tmp.column())

which is much more code, I really would like to have this stay, but btw., I would \
like to have all int line/column api be removed everywhere where it occurs as tuple \
and have the cursor used, like in the current KTextEditor::Range, not sure why we \
need setEnd (int, int), the people should use cursors ;)


-- 
Christoph Cullmann
KDE Developer, kde.org Maintainance Team
http://www.babylon2k.de, cullmann@kde.org


[Attachment #5 (application/pgp-signature)]

_______________________________________________
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