Re: QML style guide

2012-11-07 Thread Aaron J. Seigo
On Wednesday, November 7, 2012 11:26:10 Dmitry A. Ashkadov wrote: > Hello, Aaron! > > 1. If usage of item consist of only one property that is set, then may it be > placed on one line? > > Example: > > ScriptAction { script: targetItem.smooth = false } > > PlasmaCore.SvgItem { > ... // blablabl

Re: QML style guide

2012-11-07 Thread Dmitry A. Ashkadov
Hello, Aaron! 1. If usage of item consist of only one property that is set, then may it be placed on one line? Example: ScriptAction { script: targetItem.smooth = false } PlasmaCore.SvgItem { ... // blablabla svg: PlasmaCore.Svg { imagePath: "path" } ... // blablabla } 2. Maybe is it better

Re: QML style guide

2012-11-06 Thread Mark
On Tue, Nov 6, 2012 at 8:10 PM, Aaron J. Seigo wrote: > On Tuesday, November 6, 2012 18:26:17 Mark wrote: >> Why can't the style follow the C++ style as close as possible? > > because this is one place where QMl/JS deviates in a consistent fashion. so > we'd be making all of *our* QML look foreign

Re: QML style guide

2012-11-06 Thread Aaron J. Seigo
On Tuesday, November 6, 2012 18:26:17 Mark wrote: > Why can't the style follow the C++ style as close as possible? because this is one place where QMl/JS deviates in a consistent fashion. so we'd be making all of *our* QML look foreign to the QML the rest of the world writes so as to make it con

Re: QML style guide

2012-11-06 Thread Mark
On Tue, Nov 6, 2012 at 2:26 PM, Aaron J. Seigo wrote: > On Tuesday, November 6, 2012 15:08:21 Dmitry A. Ashkadov wrote: >> Please, notify us when QML style guide is approved if it isn't approved yet. > > Indeed... I think it is ready to go now, though it still needs more content > (esp the "best p

Re: QML style guide

2012-11-06 Thread Aaron J. Seigo
On Tuesday, November 6, 2012 15:08:21 Dmitry A. Ashkadov wrote: > Please, notify us when QML style guide is approved if it isn't approved yet. Indeed... I think it is ready to go now, though it still needs more content (esp the "best practices" section) but that's future work. I adjusted the gui

Re: QML style guide

2012-11-06 Thread Dmitry A. Ashkadov
Hello, Aaron! Please, notify us when QML style guide is approved if it isn't approved yet. I'm waiting for an approved variant of QML style guide to use it. - Исходное сообщение - От: "Aaron J. Seigo" Кому: plasma-devel@kde.org Отправленные: Вторник, 30 Октябрь 2012 г 0:42:18 Тема: QML

Re: QML style guide

2012-10-30 Thread Dmitry Ashkadov
30.10.2012 21:33, Martin Gräßlin пишет: On Tuesday 30 October 2012 18:16:26 Aurélien Gâteau wrote: The only part I don't really like is putting left curly brace on its own line for functions because: - having different conventions for event-handlers and function code blocks look inconsistent -

Re: QML style guide

2012-10-30 Thread Richard Moore
On 29 October 2012 20:42, Aaron J. Seigo wrote: > summary -> i've started putting together a QML style guide draft and would > like your input and to bring it completion in a collaboration with all of you > who are writing QML for Plasma. to that end, i've started a wiki page here: > > htt

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 18:16:26 Aurélien Gâteau wrote: > In the example, "property alias bar : actual.property": there is a space > before the colon, is it on purpose? nope. my mistake. i've fixed it now. thanks for noticing :) > I think it would be good to standardize the id of the top-lev

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 18:40:10 Ivan Čukić wrote: > Whether it has a special markup for folding, or not is not that important, > but doesn't hurt to have it.* ok, executive decision time :) i found something that works in katepart thanks to millian on irc: //BEGIN: functions function foo

Re: QML style guide

2012-10-30 Thread Marco Martin
On Tuesday 30 October 2012, Aurélien Gâteau wrote: > - it differs from many coding styles: Qt QML JavaScript, Douglas Crockford, > jQuery, Node... so I think it is going to look odd and unfamiliar to many > newcomers. i think the historical reason is that the interpreter was used (is still?) to

Re: QML style guide

2012-10-30 Thread Ivan Čukić
> Personally I'm even against allowing it go in at all. It just clutters the > code. It's not our task to cover up bugs in editors. If vim doesn't handle > it, vim should be fixed. Also given that I'm not a vim user I would not > know how many }} I have to place at a position or whether I have

Re: Re: QML style guide

2012-10-30 Thread Martin Gräßlin
On Tuesday 30 October 2012 18:16:26 Aurélien Gâteau wrote: > The only part I don't really like is putting left curly brace on its own > line for functions because: > > - having different conventions for event-handlers and function code blocks > look inconsistent > > - it differs from many coding st

Re: Re: QML style guide

2012-10-30 Thread Martin Gräßlin
On Tuesday 30 October 2012 13:40:22 Sebastian Kügler wrote: > On Tuesday, October 30, 2012 11:35:50 Aaron J. Seigo wrote: > > > >> 5. Vim: > > > >>> The {{{ and }}} are just for the sakes of vim's automatic folding. > > > >> > > > >> Do we all use vim? I think no. So, we must never force developers

Re: QML style guide

2012-10-30 Thread Aurélien Gâteau
Le mardi 30 octobre 2012 18:16:26 Aurélien Gâteau a écrit : > The only part I don't really like is putting left curly brace on its own > line for functions because: > > - having different conventions for event-handlers and function code blocks > look inconsistent > > - it differs from many codin

Re: QML style guide

2012-10-30 Thread Aurélien Gâteau
Le lundi 29 octobre 2012 21:42:18 Aaron J. Seigo a écrit : > hi.. > > we have a style guide for our C++ code: the kdelibs style, which was mostly > borrowed from Qt. unfortunately for us there was no QML guide we could > similarly abscond with. > > and it shows. > > summary -> i've started putti

Re: QML style guide

2012-10-30 Thread Dmitry Ashkadov
30.10.2012 17:20, Marco Martin пишет: On Tuesday 30 October 2012, Dmitry Ashkadov wrote: 30.10.2012 16:01, Sebastian Kügler пишет: There, the JS code should probably be in the QML file itself, as that's the only place where it's used. For the shared code, you'd import: import "plasmapackage:/c

Re: QML style guide

2012-10-30 Thread Marco Martin
On Tuesday 30 October 2012, Dmitry Ashkadov wrote: > 30.10.2012 16:01, Sebastian Kügler пишет: > > There, the JS code should probably be in the QML file itself, as that's > > the only place where it's used. For the shared code, you'd import: > > > > import "plasmapackage:/code/statelesslib.js" as

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 12:22:21 Matt Williams wrote: > It's just a shame that it doesn't align with the Doxygen grouping whatever is used, it should at least work with KDE's own text editor :) this one doesn't work either. perhaps we'll actually need to adjust the QML/js kate syntax highli

Re: QML style guide

2012-10-30 Thread Dmitry Ashkadov
30.10.2012 16:01, Sebastian Kügler пишет: There, the JS code should probably be in the QML file itself, as that's the only place where it's used. For the shared code, you'd import: import "plasmapackage:/code/statelesslib.js" as StatelessLib There is page in documentation http://qt-project.o

Re: QML style guide

2012-10-30 Thread Sebastian Kügler
On Tuesday, October 30, 2012 11:35:50 Aaron J. Seigo wrote: > > >> 5. Vim: > > >>> The {{{ and }}} are just for the sakes of vim's automatic folding. > > >> > > >> Do we all use vim? I think no. So, we must never force developers use > > >> vim. > > > > > > i mostly agree :) i don't think this forc

Re: QML style guide

2012-10-30 Thread Matt Williams
On 30 October 2012 12:16, Aaron J. Seigo wrote: > On Tuesday, October 30, 2012 15:01:04 Dmitry Ashkadov wrote: >> 30.10.2012 14:35, Aaron J. Seigo пишет: >> 5. Vim: >> > The {{{ and }}} are just for the sakes of vim's automatic folding. >> >> Do we all use vim? I think no. So, w

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 12:55:31 Marco Martin wrote: > if we agree to use this when possible will add to the wiki ooh, yes, absolutely! -- Aaron J. Seigo signature.asc Description: This is a digitally signed message part. ___ Plasma-devel mailing

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 15:01:04 Dmitry Ashkadov wrote: > 30.10.2012 14:35, Aaron J. Seigo пишет: > 5. Vim: > > The {{{ and }}} are just for the sakes of vim's automatic folding. > > Do we all use vim? I think no. So, we must never force developers use > vim. > >>> > >>

Re: QML style guide

2012-10-30 Thread Sebastian Kügler
On Tuesday, October 30, 2012 12:25:14 Dmitry Ashkadov wrote: > First of all, it a good idea! > > 1. I think you should explain why you have chosen such style instead of > another one. Your decision should be justified. For example: I don't > understand why you put brace on new line in case of fun

Re: QML style guide

2012-10-30 Thread Sebastian Kügler
Hey, On Tuesday, October 30, 2012 14:14:05 Dmitry Ashkadov wrote: > 30.10.2012 13:15, Aaron J. Seigo пишет: > >> 1. I think you should explain why you have chosen such style instead of > >> another one. Your decision should be justified. > > > > this is the death of style guides. for many style

Re: QML style guide

2012-10-30 Thread Marco Martin
On Tuesday 30 October 2012, Aaron J. Seigo wrote: > this is because there is no way to influence how import lines work at > runtime. it's a failing of QML (or, rather, of the people who implemented > it). it makes this a bit (though not much) uglier, but more importantly > this is also a security

Re: QML style guide

2012-10-30 Thread Dmitry Ashkadov
30.10.2012 14:35, Aaron J. Seigo пишет: 5. Vim: The {{{ and }}} are just for the sakes of vim's automatic folding. Do we all use vim? I think no. So, we must never force developers use vim. i mostly agree :) i don't think this forces anyone to use vim, but i would like to see a solution that

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 14:14:05 Dmitry Ashkadov wrote: > 30.10.2012 13:15, Aaron J. Seigo пишет: > > On Tuesday, October 30, 2012 12:25:14 Dmitry Ashkadov wrote: > We see that main.qml and main.js, delegate.qml and delegate.js may be > considered in pairs. main.qml cannot exist without main.

Re: QML style guide

2012-10-30 Thread Dmitry Ashkadov
30.10.2012 13:15, Aaron J. Seigo пишет: On Tuesday, October 30, 2012 12:25:14 Dmitry Ashkadov wrote: First of all, it a good idea! :) 1. I think you should explain why you have chosen such style instead of another one. Your decision should be justified. this is the death of style guides. fo

Re: QML style guide

2012-10-30 Thread Aaron J. Seigo
On Tuesday, October 30, 2012 12:25:14 Dmitry Ashkadov wrote: > First of all, it a good idea! :) > 1. I think you should explain why you have chosen such style instead of > another one. Your decision should be justified. this is the death of style guides. for many style decisions there is no

Re: QML style guide

2012-10-30 Thread Dmitry Ashkadov
Hello! First of all, it a good idea! 1. I think you should explain why you have chosen such style instead of another one. Your decision should be justified. For example: I don't understand why you put brace on new line in case of function. As for me it's terrible because I need always rememb

Re: Re: QML style guide

2012-10-29 Thread Martin Gräßlin
On Monday 29 October 2012 22:52:33 Marco Martin wrote: > On Monday 29 October 2012, Martin Gräßlin wrote: > > For JavaScript I would recommend to use coding style which validates on > > JSLint [1] and I would say that we should make it a requirement that our > > JavaScript code is JSLint compliant.

Re: QML style guide

2012-10-29 Thread Sebastian Kügler
On Monday, October 29, 2012 21:42:18 Aaron J. Seigo wrote: > http://community.kde.org/Plasma/QMLStyle I'm probably cool with the outcome, whatever the details are and will start adopting right now. :) Thanks for bringing it up, -- sebas http://www.kde.org | http://vizZzion.org | GPG Ke

Re: QML style guide

2012-10-29 Thread Marco Martin
On Monday 29 October 2012, Aaron J. Seigo wrote: > On Monday, October 29, 2012 21:52:38 Ivan Čukić wrote: > > > property declarations > > > signal declarations > > > JavaScript functions > > > object properties > > > child objects > > > states > > > transitions > > other than object properties f

Re: QML style guide

2012-10-29 Thread Ivan Čukić
> other than object properties following functions, this looks nice. the example > on that wiki page does not have signals, states or transitions which do indeed > all need to be added. I agree. It might be nice to have the sections also with comment headers. Currently, my template has them like

Re: QML style guide

2012-10-29 Thread Marco Martin
On Monday 29 October 2012, Aaron J. Seigo wrote: > i did spend some time considering why this happens ... and here's my guess > (though it is only that): one tends to start with and also change most > frequently the geometry properties (anchors, widths/heights, spacing, > margins) and so those "na

Re: QML style guide

2012-10-29 Thread Marco Martin
On Monday 29 October 2012, Martin Gräßlin wrote: > For JavaScript I would recommend to use coding style which validates on > JSLint [1] and I would say that we should make it a requirement that our > JavaScript code is JSLint compliant. Next step then: make build.kde.org > run JSLint on all our Ja

Re: QML style guide

2012-10-29 Thread Aaron J. Seigo
On Monday, October 29, 2012 21:57:40 Marco Martin wrote: > it seems quite sensible, > only thing i would put declared properties immediately after the id: sounds good; note, however, that pretty much NONE of our QML does this. it's almost always id, anchors/geometry, declared properties. since th

Re: QML style guide

2012-10-29 Thread Aaron J. Seigo
On Monday, October 29, 2012 22:01:06 Martin Gräßlin wrote: > For JavaScript I would recommend to use coding style which validates on > JSLint [1] and I would say that we should make it a requirement that our > JavaScript code is JSLint compliant. Next step then: make build.kde.org run > JSLint on a

Re: QML style guide

2012-10-29 Thread Aaron J. Seigo
On Monday, October 29, 2012 21:52:38 Ivan Čukić wrote: > > property declarations > > signal declarations > > JavaScript functions > > object properties > > child objects > > states > > transitions other than object properties following functions, this looks nice. the example on that wiki page do

Re: QML style guide

2012-10-29 Thread Martin Gräßlin
On Monday 29 October 2012 21:42:18 Aaron J. Seigo wrote: > hi.. > > we have a style guide for our C++ code: the kdelibs style, which was mostly > borrowed from Qt. unfortunately for us there was no QML guide we could > similarly abscond with. > > and it shows. > > summary -> i've started putting

Re: QML style guide

2012-10-29 Thread Marco Martin
On Monday 29 October 2012, Aaron J. Seigo wrote: > hi.. > > we have a style guide for our C++ code: the kdelibs style, which was mostly > borrowed from Qt. unfortunately for us there was no QML guide we could > similarly abscond with. > > and it shows. > > summary -> i've started putting togethe

Re: QML style guide

2012-10-29 Thread Ivan Čukić
+1 I've been using a template found somewhere on the Qt-tubes, which goes like this > property declarations > signal declarations > JavaScript functions > object properties > child objects > states > transitions I'd argue that property and signal declarations should be moved to the top - it is k