Re: [SailfishDevel] Problems with the emulator (I think)

2013-11-17 Thread Lauri Lavanti
Hi,

I mentioned it on a later message, but everything seems to work now. Thanks
everyone!

--
Lauri Lavanti
laurilava...@gmail.com
--
Lähettäjä: Juha Kallioinen
Lähetetty: 18.11.2013 0:17
Vastaanottaja: Sailfish OS Developers
Aihe: Re: [SailfishDevel] Problems with the emulator (I think)

  Hi Lauri,

you don't mention which SDK installer you have used. That would be vital
information in troubleshooting this and any future problems :-)

None of the problems below seem to concern the SDK emulator. I believe
these are build time problems?

On 16.11.2013 12:42, Lavanti Lauri wrote:

  Hi all,



First time on this list, so sorry if this is an old problem but:

When I created my new project on SailfishOS IDE the main.cpp file complains
that:

#include 
”No such file or directory”


The sailfishapp.h is part of the libsailfishapp-devel package, which is
preinstalled in the latest "1310" installer targets released last month. If
you have an older SDK, then this package might not yet be available.

If you are using the latest SDK, then with this information at hand, I
cannot fathom why it would not be found.

When you say "When I created my new project", how did you create it?


And whenever I try to add a package to my sdk it says the following (as an
example):

Operation Progress

 finished: installing package
jolla-sailfish-core - exited with status 0



Loading repository data...

Reading installed packages...

'jolla-sailfish-core' not found in package names. Trying capabilities.

No provider of 'jolla-sailfish-core' found.

Synchronising target to host

cannot delete non-empty directory: usr/bin

Sync completed


This looks perfectly fine, although unnecessarily cryptic.

There is in fact no package called "jolla-sailfish-core". The
jolla-sailfish-core is a pattern, not a package. A pattern is metadata
describing a collection of packages. Unfortunately the web management view
does not understand that and shows it as a normal package and tries to
install it as a normal package.

What's happening in the background is that the web management calls zypper
install for the "package", but since there's no such package, it does
nothing and unnecessarily syncs the results between the target and the host.

If you try to add some real package, then it should report something
different.

Best regards,

 Juha



Thank you J



--

Lauri Lavanti

lauri.lava...@aalto.fi




___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] How to use setContext() or what is recommended?!

2013-11-17 Thread Mariano Boragno
I was wondering exactly the same as Gabriel and Andrey's code solved my
problem.

Thanks a lot, guys!!!


...Mariano Boragno...


On Wed, Nov 13, 2013 at 12:25 PM, Andrey Kozhevnikov  wrote:

> This is almost same what SailfishApp::main() does for you and it keeping
> booster working, just lets you to use application and view instances
> directly.
>
> Have fun with Sailfish ;)
>
>
> On 13.11.2013 21:23, Gabriel Boehme wrote:
>
>> Wow, thanks to you and also Andrey!
>>
>> This is nearly the way I took back in the first Jolla Qt5 SDK, is it
>> also the recommended way to do that?
>>
>> Will it have a (bad) influence on the start up times?
>>
>> Thanks so much! :)
>>
>>  Hi,
>>>
>>> Yes your setContextProperty() to rootContext is the right approach.
>>> Usually I do something like this:
>>>
>>>  QScopedPointer app(Sailfish::createApplication(argc,
>>> argv));
>>>  QScopedPointer view(Sailfish::createView());
>>>  MyClass data;
>>>  view->rootContext()->setContextProperty("myObject", &data);
>>>  Sailfish::setView(view.data(), "qrc:/main.qml");
>>>
>>> 
>>> From: devel-boun...@lists.sailfishos.org [devel-bounces@lists.
>>> sailfishos.org] on behalf of Gabriel Boehme [m.gabrielboehme@googlemail.
>>> com]
>>> Sent: Wednesday, November 13, 2013 4:58 PM
>>> To: Sailfish OS Developers
>>> Subject: [SailfishDevel] How to use setContext() or what is recommended?!
>>>
>>> Hi sailors,
>>>
>>> in the very first (Qt4 version) of the SDK I ported an easy application,
>>> that is using a list model. To connect the list model and also my main
>>> logic stuff I used the setContextProperty() method. In the first Qt5 SDK
>>> version I had to work a bit around that (created a view from
>>> Sailfish::createView() and used the views
>>> data().rootContext()->setContextProperty() methods.
>>>
>>> But now in the latest version I'm not quite sure about, how to do that?
>>>
>>> Or better: What is the recommended way to connect QML UI with C++ logic
>>> and add a model for a view? I'm a bit confused, because coming from
>>> Python/PySide I always used it that way with QDeclarativeView and get a
>>> bit lost with Qt5 and QQuickView and QQuickApplication and all this
>>> stuff, that changed also between 5.0 and 5.1, doesn't it? :-/
>>>
>>> Would be great to get some advice!
>>>
>>> Thank you very much!
>>>
>>> ___
>>> SailfishOS.org Devel mailing list
>>> ___
>>> SailfishOS.org Devel mailing list
>>>
>>
>> ___
>> SailfishOS.org Devel mailing list
>>
>
> ___
> SailfishOS.org Devel mailing list
>
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Problems with the emulator (I think)

2013-11-17 Thread Juha Kallioinen

Hi Lauri,

you don't mention which SDK installer you have used. That would be vital 
information in troubleshooting this and any future problems :-)


None of the problems below seem to concern the SDK emulator. I believe 
these are build time problems?


On 16.11.2013 12:42, Lavanti Lauri wrote:


Hi all,

First time on this list, so sorry if this is an old problem but:

When I created my new project on SailfishOS IDE the main.cpp file 
complains that:


#include 
"No such file or directory"



The sailfishapp.h is part of the libsailfishapp-devel package, which is 
preinstalled in the latest "1310" installer targets released last month. 
If you have an older SDK, then this package might not yet be available.


If you are using the latest SDK, then with this information at hand, I 
cannot fathom why it would not be found.


When you say "When I created my new project", how did you create it?



And whenever I try to add a package to my sdk it says the following 
(as an example):


Operation Progress

 finished: installing package 
jolla-sailfish-core - exited with status 0


Loading repository data...

Reading installed packages...

'jolla-sailfish-core' not found in package names. Trying capabilities.

No provider of 'jolla-sailfish-core' found.

Synchronising target to host

cannot delete non-empty directory: usr/bin

Sync completed



This looks perfectly fine, although unnecessarily cryptic.

There is in fact no package called "jolla-sailfish-core". The 
jolla-sailfish-core is a pattern, not a package. A pattern is metadata 
describing a collection of packages. Unfortunately the web management 
view does not understand that and shows it as a normal package and tries 
to install it as a normal package.


What's happening in the background is that the web management calls 
zypper install for the "package", but since there's no such package, it 
does nothing and unnecessarily syncs the results between the target and 
the host.


If you try to add some real package, then it should report something 
different.


Best regards,

 Juha


Thank you J

--

Lauri Lavanti

lauri.lava...@aalto.fi



___
SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] ListModel sorting in QML

2013-11-17 Thread Artem Marchenko
I had similar situation in the past.

Data was coming from web, but I needed to rearrange it for QML lists to
work.
What I found useful and working was to just generate a new model in
JavaScript (based on empty ListModel if I recall correctly). I had only a
couple of dozens of data and it was changing once or twice during app use
sessions. So creating a fresh model from scratch was not a problem at all.

Cheers,
Artem.



On Sun, Nov 17, 2013 at 11:59 PM, Tigre-Bleu  wrote:

> Ok, thanks
>
> I will create my own model with sorting capabilities
>
> Antoine
>
> - Mail original -
> De: "Andrey Kozhevnikov" 
> À: devel@lists.sailfishos.org
> Envoyé: Dimanche 17 Novembre 2013 14:05:39
> Objet: Re: [SailfishDevel] ListModel sorting in QML
>
> afaik the use of JSONListModel not intended the sorting functions.
> you need to make own model and sort json data before pushing it to model.
>
> On 17.11.2013 18:39, Tigre-Bleu wrote:
> > Hi,
> >
> > I have a ListView which loads a model from JSON with JSONListModel. The
> model contains items and category ids, but is not sorted by category.
> >
> > What I wand to do is to display the items sorted by categories in the
> ListView. I have put a section.property in the ListView but it is working
> only half as expected because it is not sorting the model.
> >
> > For instance, if my model content is:
> >
> > Item1 - Category1
> > Item2 - Category1
> > Item3 - Category2
> > Item4 - Category3
> > Item5 - Category3
> > Item6 - Category1
> >
> > Then my ListView will display:
> >
> > Category1
> >Item1
> >Item2
> > Category2
> >Item3
> > Category3
> >Item4
> >Item5
> > Category1
> >Item6
> >
> > Of course I would like Item6 to be set between Item2 and Item3.
> >
> > How is possible to do that in QML? I would like to avoid manually
> iterating on all the items to re-order.
> >
> > Thanks,
> >
> > Antoine
> > ___
> > SailfishOS.org Devel mailing list
>
> ___
> SailfishOS.org Devel mailing list
> ___
> SailfishOS.org Devel mailing list
>



-- 
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] ListModel sorting in QML

2013-11-17 Thread Tigre-Bleu
Ok, thanks

I will create my own model with sorting capabilities

Antoine

- Mail original -
De: "Andrey Kozhevnikov" 
À: devel@lists.sailfishos.org
Envoyé: Dimanche 17 Novembre 2013 14:05:39
Objet: Re: [SailfishDevel] ListModel sorting in QML

afaik the use of JSONListModel not intended the sorting functions.
you need to make own model and sort json data before pushing it to model.

On 17.11.2013 18:39, Tigre-Bleu wrote:
> Hi,
>
> I have a ListView which loads a model from JSON with JSONListModel. The model 
> contains items and category ids, but is not sorted by category.
>
> What I wand to do is to display the items sorted by categories in the 
> ListView. I have put a section.property in the ListView but it is working 
> only half as expected because it is not sorting the model.
>
> For instance, if my model content is:
>
> Item1 - Category1
> Item2 - Category1
> Item3 - Category2
> Item4 - Category3
> Item5 - Category3
> Item6 - Category1
>
> Then my ListView will display:
>
> Category1
>Item1
>Item2
> Category2
>Item3
> Category3
>Item4
>Item5
> Category1
>Item6
>
> Of course I would like Item6 to be set between Item2 and Item3.
>
> How is possible to do that in QML? I would like to avoid manually iterating 
> on all the items to re-order.
>
> Thanks,
>
> Antoine
> ___
> SailfishOS.org Devel mailing list

___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] ListModel sorting in QML

2013-11-17 Thread Andrey Kozhevnikov

afaik the use of JSONListModel not intended the sorting functions.
you need to make own model and sort json data before pushing it to model.

On 17.11.2013 18:39, Tigre-Bleu wrote:

Hi,

I have a ListView which loads a model from JSON with JSONListModel. The model 
contains items and category ids, but is not sorted by category.

What I wand to do is to display the items sorted by categories in the ListView. 
I have put a section.property in the ListView but it is working only half as 
expected because it is not sorting the model.

For instance, if my model content is:

Item1 - Category1
Item2 - Category1
Item3 - Category2
Item4 - Category3
Item5 - Category3
Item6 - Category1

Then my ListView will display:

Category1
   Item1
   Item2
Category2
   Item3
Category3
   Item4
   Item5
Category1
   Item6

Of course I would like Item6 to be set between Item2 and Item3.

How is possible to do that in QML? I would like to avoid manually iterating on 
all the items to re-order.

Thanks,

Antoine
___
SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list


[SailfishDevel] ListModel sorting in QML

2013-11-17 Thread Tigre-Bleu
Hi,

I have a ListView which loads a model from JSON with JSONListModel. The model 
contains items and category ids, but is not sorted by category.

What I wand to do is to display the items sorted by categories in the ListView. 
I have put a section.property in the ListView but it is working only half as 
expected because it is not sorting the model.

For instance, if my model content is:

Item1 - Category1
Item2 - Category1
Item3 - Category2
Item4 - Category3
Item5 - Category3
Item6 - Category1

Then my ListView will display:

Category1
  Item1
  Item2
Category2
  Item3
Category3
  Item4
  Item5
Category1
  Item6

Of course I would like Item6 to be set between Item2 and Item3.

How is possible to do that in QML? I would like to avoid manually iterating on 
all the items to re-order.

Thanks,

Antoine
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Problems with the emulator (I think)

2013-11-17 Thread Alessandro Portale
Perhaps your project configuration still has some old SDK paths in it. Two
different ways of fixing this:

- Delete and Re-add the SailfishOS kit(s) in the "Project" mode in Qt
Creator
- Manually delete the .user file from you project folder and open
the Project in Qt Creator

Cheers,
Alessandro


On Sat, Nov 16, 2013 at 7:27 PM, Lauri Lavanti wrote:

> Haha :D
>
>
>
> Now Qt creator doesn’t complain about it, but when I try to run it on the
> emulator it says ”Sailfish has not been declared” and when I try to install
> new packages it still says the same thing, so almost there
>
>
>
> --
>
> Lauri Lavanti
>
> laurilava...@gmail.com
>
>
>
> *Lähettäjä:* devel-boun...@lists.sailfishos.org [mailto:
> devel-boun...@lists.sailfishos.org] *Puolesta *Alessandro Portale
> *Lähetetty:* 16. marraskuuta 2013 20:04
> *Vastaanottaja:* Sailfish OS Developers
> *Aihe:* Re: [SailfishDevel] Problems with the emulator (I think)
>
>
>
> Something that helped a few times against Alpha update hiccups is deleting
> the SDK settings which are somewhere (typing from my lousy memory)
> c:\...\Roaming\MerSdkAlpha and then start your Qt Creator.
>
>
>
> Hope that helps,
>
> Alessandro
>
> On Saturday, November 16, 2013, Lauri Lavanti wrote:
>
> Okay, a little background.
>
> I had the old alpha version installed under Program Files (windows) and
> after I uninstalled it and installed the new version I got the problem I
> described earlier.
>
> Another symptom of the problem has been, when I try to install it straight
> to C (not under Program Files) it can't find the emulators at all, or it
> "finds" them under the old install folder in Program Files (even though it
> doesn't exist at all anymore).
>
> Please if any of you can help me I'd be sooo happy, because I can't
> develop at all at the moment.
>
> --
> Lauri Lavanti
> laurilava...@gmail.com
> --
>
> *Lähettäjä: *Lavanti Lauri
> *Lähetetty: *16.11.2013 13:20
> *Vastaanottaja: *devel@lists.sailfishos.org
> *Aihe: *[SailfishDevel] Problems with the emulator (I think)
>
> Hi all,
>
>
>
> First time on this list, so sorry if this is an old problem but:
>
> When I created my new project on SailfishOS IDE the main.cpp file
> complains that:
>
> #include 
> ”No such file or directory”
>
> And whenever I try to add a package to my sdk it says the following (as an
> example):
>
> Operation Progress
>
>  finished: installing package
> jolla-sailfish-core - exited with status 0
>
>
>
> Loading repository data...
>
> Reading installed packages...
>
> 'jolla-sailfish-core' not found in package names. Trying capabilities.
>
> No provider of 'jolla-sailfish-core' found.
>
> Synchronising target to host
>
> cannot delete non-empty directory: usr/bin
>
> Sync completed
>
>
>
> Thank you J
>
>
>
> --
>
> Lauri Lavanti
>
> lauri.lava...@aalto.fi
>
>
>
>
> --
>
>
> Tässä sähköpostiviestissä ei ole viruksia eikä haittaohjelmia, koska avast!
> Antivirus  suojaus on käytössä.
>
>
> ___
> SailfishOS.org Devel mailing list
>
___
SailfishOS.org Devel mailing list