Patch submission #298

Patch for Migraction of Cursor Shape from QYzis to libyzis

Added by Anonymous 146 days ago. Updated 87 days ago.

Status:New Start:06/26/2008
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:libyzis
Target version:-

Description

This is a patch corresponding to the wiki TODO item:
http://www.yzis.org/wiki/index.php?title=TODO#Create_cursor_shape_interface

The cursor enum was moved to the YViewIface class and guiCursorChanged was added to the view interface.

QYzis was updated to take advantage of this.

cursorShapeMigration.patch (14.1 KB) Anonymous, 06/26/2008 11:39 PM

cursorKpart.patch - Patch to update KPart ot take advantage of Cursor callbacks. (19.4 KB) Donald Curtis, 06/28/2008 02:46 AM

History

06/27/2008 01:51 AM - Loïc Paulevé

Thank your for your contribution, your patch is looking quite good.
Here are a few remarks :

diff -r aa0fd44b3ff1 libyzis/view.cpp --- a/libyzis/view.cpp Thu Jun 26 00:35:16 2008 +0200 +++ b/libyzis/view.cpp Thu Jun 26 15:49:27 2008 -0500

..

void YView::updateMode() { QString mode; + YMode::ModeType mt;

mode = currentMode()->toString(); + mt = currentMode()->modeType(); + + YViewIface::CursorShape newCursorShape = YViewIface::CursorHidden;

you never use this one ;)

+YViewIface::CursorShape YView::cursorShape() const +{ + return mCursorShape; +}

shouldn't be necessary :

diff -r aa0fd44b3ff1 qyzis/qyedit.cpp --- a/qyzis/qyedit.cpp Thu Jun 26 00:35:16 2008 +0200 +++ b/qyzis/qyedit.cpp Thu Jun 26 15:49:27 2008 -0500 -QYCursor::CursorShape QYEdit::cursorShape() +void QYEdit::setCursorShape( YViewIface::CursorShape cs ) {

why don't you set mPreviousCursorShapre to cs here? it will save an accessor.

06/28/2008 02:46 AM - Donald Curtis

Thanks for the remarks.

YViewIface::CursorHidden was in there before. It's in there so when people do EX mode, the cursor disappears from the screen. Is this something that the GUI needs to handle through guiSelectMainWindow or whatever. That is fine with me.

I am submitting an additional patch that will also update the KPart to take advantage of the cursor callbacks added.

08/25/2008 03:56 AM - Thomas Capricelli

Hello. The first patch seems mostly good. I have two questions though:

1) is there any reason to call guiUpdateCursor() in YView::setCursorShape() ?

(btw, this function's name is misleading, i've renamed it to guiUpdateCursorPosition() to clarify, see commit ae04f2df3636)

2) YDebugStream& operator<<( YDebugStream& out, const YViewIface::CursorShape & shape ); shouldn't this be moved in libyzis, where CursorShape is defined ?

Hope you wont find me too much a nitpicker, i'll apply the patch as soone as those two points are clarified.

08/25/2008 04:09 AM - Thomas Capricelli

Concerning the second patch (kpart)

1) there's a lot of noise because of the renaming "mParent" to "mView", this really doesn't help understanding the patch

2) why not using qycursor here anyway ? it's a QWidget in both case

3) it's probably not worth worrying too much about the kpart anyway, it's going to be worked on soon, and I'll probably share a lot more code between qyzis and kpart_yzis.

Also available in: Atom PDF