Re: [SailfishDevel] Getting log from a thread

2020-07-31 Thread David Llewellyn-Jones
On 31/07/2020 09:11, deloptes wrote:
[snip]
> I see in buteo-syncml that the mentioned OBEX_HandleInput() is called in a
> loop while waiting for input.
> My problem is and hence my request here, that there is no debugging log from
> the obex transport, because it gets started in a thread by msyncd.
> 
> How do I enable debugging for the process started in the thread?

I'm not fully clear on whether you're after debugging (e.g. using gdb)
or logging output.

For debugging, you should be able to connect gdb to the running process
(as long as you know the pid) and can then access individual threads
from there. Something like this:

# ps ax -o "pid command" | grep msyncd
 4500 /usr/bin/invoker -G -o -s --type=qt5 /usr/bin/msyncd
 4504 /usr/bin/msyncd
13063 grep msyncd

# gdb -p 4504

(gdb) info threads
  Id   Target Id  Frame
* 1LWP 4504 "msyncd"  0xe9bd2da4
  2LWP 4513 "QDBusConnection" 0xe9bd2da4
  3LWP 4527 "gmain"   0xe9bd2da4
  4LWP 4528 "dconf worker"0xe9bd2da4
  5LWP 4529 "Qt bearer threa" 0xe9bd2da4
  6LWP 4531 "gdbus"   0xe9bd2da4
(gdb)

If it's the logging you're after, then the cheatsheet implies increasing
logging for msyncd should also increase it for the plugins, so it might
be worth trying something like this:

devel-su -p
systemctl --user stop msyncd
MSYNCD_LOGGING_LEVEL=8 msyncd

I didn't test this with OBEX though I'm afraid.

One final point: I think these mailing lists are supposed to be on ice
now, so people may not be following them so much. You might get a better
response at forum.sailfishos.org.

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] [Postponed] Sailfish OS, OSS community meeting on July 23rd 2020

2020-07-23 Thread David Llewellyn-Jones
On 23/07/2020 09:13, James Noori wrote:
> Hi,
> 
> It will be on the new forum. It is unclear as of yet, but it will be
> announced after the vacation period is over.
> 
> /James
> 
> On 7/23/2020 10:08 AM, rinigus wrote:
>> Hi James,
>>
>> with this new shiny forum site, where are we expected to propose topics?

There is this (I suppose "unofficial") topic on the forum already:

https://forum.sailfishos.org/t/sailfishos-open-source-collaboration-meeting-planning/479

It will probably need some adjustment to use it effectively, since
editing the post directly doesn't really work with the new forum.

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] using icon image provider with custom icons

2020-05-25 Thread David Llewellyn-Jones
On 25/05/2020 14:31, Julien Blanc wrote:
[snip]
> I’d like to benefit from icon coloring and correct size selection.
> However, it seems the "theme" icon provider only looks in the system
> folders, not the app folder (at least that's what strace shows).
> 
> From a quick look, it seems every app is somehow reinventing the wheel
> here, using its own custom image provider or other techniques to
> provide the path.
> 
> Isn't there something smarter to do ? I can't find where the theme
> image provider gets registered, but i suppose it would be a far better
> solution to just extend it somehow, and provide a search path for the
> app folder (the logic being the same).

Creating an ImageProvider as you've described, is the approach I've
always used. This has always been my go-to reference for this:

https://sailfishdev.tumblr.com/post/87464226712/iconbutton-how-to-use-own-icons-with-highlight

Even though I agree it'd be good to have a simpler, more generic
approach, as far as I'm aware there isn't one. I'd be happy to be proven
wrong though.

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Problem in interaction qml and c++

2020-04-23 Thread David Llewellyn-Jones
On 23/04/2020 10:50, michael fuchs wrote:
> Am 23.04.2020 08:59 schrieb David Llewellyn-Jones:
>> On 23/04/2020 09:51, Michael Fuchs wrote:
>>> How can AlbumList access mImgDB and mNetAccess?
>>>
>>> One solution could be to register the controller itself in qml and
>>> then write
>>> sth like this in qml:
>>>
>>> 
>>> AlbumList {
>>>   imgDB: controller.imgDB
>>>   netAccess: controller.netAccess
>>> }
>>> 
>>>
>>> but it's redundant.
>>
>> This doesn't look like a bad approach to me (although passing the
>> controller itself might be cleaner).
>>
>> An alternative might be to make Controller a singleton, that way your
>> AlbumList class could access it from the C++ without needing to be
>> explicitly passed a handle to it.
>>
>> But whether you can do that depends on the how Controller is used.
> 
> Thanks a lot.
> I'm not familiar with singletons, but this sounds promising.
> I found this simple example:
> 
> https://gist.github.com/pazdera/1098119

Yeah, this looks like a decent example: clear and complete.

As you can see from this, you essentially end up with a global object
you can access from anywhere. The downside is that you only ever have
one of them, so if you need more than one Controller, or (as Julian
mentions) think it might be needed in future, then this probably isn't
the right approach.

> I hope this also works for Q_OBJECT s.
> Maybe I should rather make netAccess and imgDB itself singletons?

I don't recall any issues with Q_OBJECTS being singletons, however if
you plan to use it in your QML you may also need to do some work
registering it as a singleton there too.

There's an example here:

https://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType

But I wouldn't worry about this unless you're already registering your
Controller as a QML type and need to use it from QML. As Julien also
pointed out, mixing singletons in C++ and QML adds complexity that can
lead to errors.

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Problem in interaction qml and c++

2020-04-23 Thread David Llewellyn-Jones
On 23/04/2020 09:51, Michael Fuchs wrote:
> How can AlbumList access mImgDB and mNetAccess?
> 
> One solution could be to register the controller itself in qml and then write
> sth like this in qml:
> 
> 
> AlbumList {
>   imgDB: controller.imgDB
>   netAccess: controller.netAccess
> }
> 
> 
> but it's redundant.

This doesn't look like a bad approach to me (although passing the
controller itself might be cleaner).

An alternative might be to make Controller a singleton, that way your
AlbumList class could access it from the C++ without needing to be
explicitly passed a handle to it.

But whether you can do that depends on the how Controller is used.

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] memory leak?

2020-04-13 Thread David Llewellyn-Jones
On 13/04/2020 15:54, E.S. Rosenberg wrote:
> Recently I've noticed my phone running out of memory more often.
> I've update to 3.3.0.14 but I also released a newer version of gPodder
> which may be guilty of this.
> However closing gPodder does not release memory so I'm not really sure
> if I should blame myself or that lipstick is after all leaking memory.
> Also how does one optimize a qml/python apps memory usage? Neither is
> managed to the best of my knowledge.
> I may have time later to test the level of involvement of gPodder by
> downgrading.

Hi Eli,

If the memory isn't released when gPodder's closed (assuming the app is
definitely closed, and not just hidden), then it's highly unlikely to be
gPodder draining your memory.

A very simple way to check memory usage is just to take a look at the
output of "top". The following will show everything running ordered by
memory usage and keep it updated:

top -o %MEM

Or if you just want to track gPodder you could use something like this:

top -o %MEM -p `pgrep sailfish-qml`

I used sailfish-qml as the app name, since probably that's what gPodder
will be called if it's QML/python-only, but you can change it to
whatever you're interested in.

Finally I was going to suggest to run it with valgrind, which gives a
summary of memory leaks when you close the app and I've found useful in
the past for C++ code. Unfortunately when I tried it on another QML-only
app the results weren't very helpful at all. So this may not be a
helpful route to go down.

Nevertheless I uploaded an RPM to openrepos in case it's helpful in some
other context:

https://openrepos.net/content/flypig/valgrind

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Conditional QML element

2020-04-07 Thread David Llewellyn-Jones
Hi Eli,

I'm probably misunderstanding the situation, but can you make individual
items visible or not (visible: true/false), rather than using Loaders in
the list?

David

On 07/04/2020 11:22, E.S. Rosenberg wrote:
> Hi Andrey,
> Thanks for the suggestion, though having them as Components in the same
> file instead of external qml files does improve performance it is still
> a lot slower then just having the component directly in use without a
> Loader.
> 
> ie:
> 
> ListItem {
>     (...)
>     ArtArea {
>     }
> }
> 
> Of course like that there is no logic to have either ArtArea or
> CoverArea but I can have logic in each ArtArea as to which image it is
> displaying so image loading an logic speed are not the issue but rather
> just the loader (I can have 400+ length lists where you really see the
> slowdown).
> 
> Any other suggestions?
> Thanks!
> Eli
> 
> Op di 7 apr. 2020 om 01:15 schreef Андрей Кожевников
> mailto:coderusin...@gmail.com>>:
> 
> wrap inside Component and set using sourceComponent property
> 
> вт, 7 апр. 2020 г. в 01:13, E.S. Rosenberg
>  >:
> 
> Hi all,
> In the application I maintain (gPodder) I would like to show an
> element holding Image(s) in each ListItem, depending on whether
> or not the ListItem has a property either a component with 2
> images or a component with 1 image should be loaded (an possibly
> also a no image fallback).
> 
> I have tried implementing this using a Loader:
>     Loader {
>         id: artArea
>         anchors {
>             left: parent.left
>         }
>         height: titleItem.height + subtitleItem.height
>         width: titleItem.height + subtitleItem.height
> 
>         asynchronous: true
>         source: episode_art ? "ArtArea.qml" : "CoverArea.qml"
>     }
> 
> However this totally tanks performance, using just "ArtArea"
> without the loader is really fast thus the issue is not the
> amount of images that need to be loaded.
> Is there a better/faster way to do this?
> 
> Thanks!
> Eli
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
> 
> 
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
> 
> 
> 
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
> 


-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Error deploying app to a salfish device

2020-04-03 Thread David Llewellyn-Jones
On 03/04/2020 03:23, joao morgado via Devel wrote:
> Note that the error message shows ip 192.168.1.4, but the device ip is
> in fact 192.168.1.6.
> I wonder if there is some other option in QtCreator that I'm overlookin
> to update the device ip.

Do you have the same device set in the deploy menu? See the highlighted
parts of this screenshot:

https://www.flypig.co.uk/images/general/qtcreator.png

Sorry if this is really obvious already, but I've made this mistake a
few times myself, so I thought it could be a possibility.

David
-- 
Website: https://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] libconnman-qt

2020-01-29 Thread David Llewellyn-Jones
On 23/01/2020 03:59, David Weidenkopf wrote:
> Hi, I see that sailfish has forked connman. Is libconnman-qt
> compatible with the upstream connman?
There are certainly some incompatibilities, I'm afraid. As just a couple
of examples, the Sailfish connman fork exposes the ResetCounters and
CreateService dbus methods [1]. However, these aren't available upstream
[2]. Both of these are used by libconnman-qt [3, 4].

It's possible this just breaks the specific functionality rather than
everything, but I've not tried, so couldn't say for sure.

David

[1] See:
https://git.sailfishos.org/mer-core/connman/blob/c411674489ea85332537e1146b71fb1c2c581a80/connman/src/manager.c#L819

[2] See:
https://git.kernel.org/pub/scm/network/connman/connman.git/tree/src/manager.c?id=0b0277cccd78361723d160ed8221c69e014df07f#n560

[3]
https://git.sailfishos.org/mer-core/libconnman-qt/blob/e22ff38effd2a7188ab2b470c29fac5c42aec511/libconnman-qt/networkmanager.cpp#L1087

[4]
https://git.sailfishos.org/mer-core/libconnman-qt/blob/e22ff38effd2a7188ab2b470c29fac5c42aec511/libconnman-qt/networkmanager.cpp#L1283

-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread David Llewellyn-Jones
On 06/01/2020 21:00, szo...@gmail.com wrote:
> Picture will probably illustrate what I mean easier:
> https://i.imgur.com/IKyMnAV.png

The pictures are definitely helpful!

> This is a self-expanding TextArea as you type, but it will happily go
> over the screen size and there is no way to get the text at the
> beginning into focus, I'm probably missing some super obvious way to
> avoid this? The only way I found to force scroll option was
> hardcoding its height which is noy pretty.
I could be misunderstanding completely (especially since you mention in
your other email about it being in a docked panel, and I'm not sure
whether that might affect things).

I think the usual way would be to place the TextArea inside a
SilicaFlickable with SilicaFlickable.contentHeight set to
TextArea.contentHeight (or possibly TextArea.implicitHeight or
TextArea.height). If you include other stuff/padding inside the
flickable you'll need to take that into account too.

You can then set the height of the SilicaFlickable to the height
available on the screen to allow scrolling of everything inside it.

The notes app does something like this. It's not a great example because
there's a lot going on, but it might help:

Line 160 sets the contentHeight:

/usr/share/jolla-notes/pages/NotePage.qml

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread David Llewellyn-Jones
On 06/01/2020 16:10, szo...@gmail.com wrote:
> Picture will be helpful: https://i.imgur.com/knA9qZP.png Is there any
> way to make the text start from left edge after the thumbnail ends?
> Not sure if there is something that would fill remaining space with
> text automatically, or if you can maybe hardcode the thumbnail size
> and force the text field to extend left after x lines?

One way would be along the lines of your second suggestion, to use the
lineLaidOut() signal to increase the indent for something like the first
five lines of your text.

https://doc.qt.io/qt-5/qml-qtquick-text.html#lineLaidOut-signal

There's an example of this in the Messages app. When you have a draft
message shown on the main screen, the first line of the message is
shifted slightly to the right to accommodate a little pencil icon. The
code for this is around line 150 of the file
/usr/share/jolla-messages/pages/groups/GroupDelegate.qml in case the
example is helpful.

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Close app in background with visible overlay

2019-12-03 Thread David Llewellyn-Jones
It looks like one solution would be to set the application view as the
parent of your overlay view. I created a PR along these lines:

https://github.com/yurumi/harbour-schwarzenmaker/pull/16

On 03/12/2019 16:26, Thomas Eigel wrote:
> Sure!
>  
> Goal: I want to close my app from home screen when an overlay is visible.
> Problem: The cover disappears but the app itself is still running (e.g.
> overlay can be seen, process still existing).
> Question: How can I close the app correctly - including the overlay?
>  
> Thanks,
> Thomas
>  
> PS: If still unclear, user Najoj opened an issue describing the problem:
> https://github.com/yurumi/harbour-schwarzenmaker/issues/15
>  
> @Андрей: I think, I borrowed the code for the overlay from you a few
> years ago. Thanks for that and all your support!
>  
> *Gesendet:* Dienstag, 03. Dezember 2019 um 08:10 Uhr
> *Von:* "Андрей Кожевников" 
> *An:* "Sailfish OS Developers" 
> *Betreff:* Re: [SailfishDevel] Close app in background with visible overlay
> Hello. Please repeat your actual question. I dont understand what the
> problem is and what are you trying to achieve.
>  
> вт, 3 дек. 2019 г. в 01:27, Thomas Eigel  >:
> 
> Hi all,
>  
> I have a quite special question: When my app (schwarzenmaker) runs
> in the background, an overlay is visible to show some kind of
> progress. If the app is closed from home screen the program keeps up
> running (cover disappears but 'ps aux' still showing the process and
> overlay still visible). Closing works as expected when the overlay
> is hidden beforehand.
>  
> I tried listening to different signals but to no avail:
>  
>   - quit, aboutToQuit: Don't seem to be emitted since the program is
> not quitting until the overlay is hidden.
>   - onStatusChanged: Is emitted when app is moved to background
> (Qt.ApplicationInactive) but no new signal when app is "closed".
>  
> The code to create the overlay (which I don't fully understand) can
> be sketched as follows:
>  
> m_overlayView = SailfishApp::createView();
> 
> m_overlayView->setSource(SailfishApp::pathTo("qml/components/overlay.qml"));
> m_overlayView->create();
> QPlatformNativeInterface *native =
> QGuiApplication::platformNativeInterface();
> native->setWindowProperty(m_overlayView->handle(),
> QLatin1String("CATEGORY"), "notification");
> native->setWindowProperty(m_overlayView->handle(),
> QLatin1String("MOUSE_REGION"), QRegion(0, 0, 0, 0));
> m_overlayView = SailfishApp::createView();
>  
> Maybe closing fails because another "window" is created. So my
> question is: Does anybody know how to detect the attempted closing
> of the app?
>  
> Cheers,
> Thomas
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
> 
> 
> ___ SailfishOS.org Devel
> mailing list To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
> 
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
> 


-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Silica QML objects that can have a menu property

2019-10-11 Thread David Llewellyn-Jones
On 10/10/2019 07:30, E.S. Rosenberg wrote:
> My question may be very simple - is ListItem the only type of object
> that may display a text on a page that can have a "menu" property? I
> went over the Silica reference quickly and I didn't find any other
> similar items.
> 
> The reason I ask this is that I have a single item I am displaying to
> which I am adding a context menu and semantically it just seemed weird
> that I would have to put that inside of a ListItem to be able to add a
> menu: ContextMenu property.
> 
> Or did I miss some other object that does support this property?

Hi Eli,

I don't think there's anything particularly wrong with using a ListItem
in this way. For example it's used to contain the avatar image and
header on contact pages, which doesn't really form part of a list as such.

See line 79 of /usr/lib/qt5/qml/Sailfish/Contacts/ContactHeader.qml

But it's not the only way to create a context menu. For example, when
you press and hold a date in the Calendar app a context menu with
"Change year" appears, and this is implemented without a ListItem:

Line 153 of /usr/share/jolla-calendar/pages/DatePickerPanel.qml

I'm not sure whether this exactly answers your question, but hopefully
it helps.

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] [Solved] RPM validator error

2019-09-18 Thread David Llewellyn-Jones
On 18/09/2019 23:27, Marko Koschak wrote:
> Answering to myself ;)
> 
>> I was trying to check the created rpm for my app ownKeepass but it
>> failed for a strange reason: "cpio: ./usr/bin/harbour-ownkeepass:
>> Cannot open: Permission denied"
> 
> After I changed one line in the .yml file the validation worked again:
> 
> - '%attr(655,-,-) %{_bindir}' -> - '%attr(755,-,-) %{_bindir}'
> 
> It seemed the executable bit was the source of the error...

Glad you solved it; I was too slow! Is this the first release? If not,
it's odd this has never caused problems in the past.

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] RPM validator error

2019-09-18 Thread David Llewellyn-Jones
On 18/09/2019 22:35, Marko Koschak wrote:
> I was trying to check the created rpm for my app ownKeepass but it
> failed for a strange reason: "cpio: ./usr/bin/harbour-ownkeepass:
> Cannot open: Permission denied"
> 
> I have never seen this before and also a search on the web does not
> reveal anything helpful.
> 
> I you want to check yourself you can get a prebuild rpm for my app
> here: https://github.com/jobe-m/ownkeepass/releases

Hi Marko,

When I unpack your rpm, I see that the bin folder has execute
permissions set on it, which prevents access to the contents:

$ ls -l
total 8
drw-r-xr-x 2 flypig flypig 4096 Sep 12 01:20 bin
drwxrwxr-x 5 flypig flypig 4096 Sep 18 23:06 share
$ cd bin/
bash: cd: bin/: Permission denied

It looks like it's being caused by line 41 harbour-ownkeepass.yaml:

- '%attr(655,-,-) %{_bindir}'

I'd suggest removing this line to see if it has any effect.

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] libconnman-qt application examples

2019-07-24 Thread David Llewellyn-Jones
On 24/07/2019 17:16, David Weidenkopf wrote:
> Hi David, thanks for the pointers, very helpful to be able to see the
> code. I could not find the code for TechnologyModel. Is that closed
> source as well? Is it C++ or QML?
> 
> That is the component that interests me the most at this point.
> Thanks

Hi David,

TechnologyModel is part of libconnman-qt and so open source. Unlike most
of the rest of the code it's in the plugin directory though:

https://git.merproject.org/mer-core/libconnman-qt/blob/master/plugin/technologymodel.h

https://git.merproject.org/mer-core/libconnman-qt/blob/master/plugin/technologymodel.cpp

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] libconnman-qt application examples

2019-07-23 Thread David Llewellyn-Jones
On 22/07/2019 23:57, David Weidenkopf wrote:
> Sorry, I forgot to mention an assumption on my part. Given the API
> design, it looks like it is usable from QML, and no C++ would be
> necessary. Is that an incorrect assumption?

Hi David,

I'm struggling a bit with your negatives, but... no, this is a *correct*
assumption! You can use libconnman-qt as a C++ library, but it also
works as a QML plugin by adding "import MeeGo.Connman 0.2" at the top of
your QML file.

> Hi, we are interested in adopting libconnman-qt as our interface to
> connman. Where can I find examples of usage? For example, I would like
> to see how the library could be used to present a list of SSIDs to a
> user. It is not clear from the API how to do this.

If you're interested in the QML side of things, then the Settings app is
a good place to start (jolla-settings-networking). It's not open source,
but you can find the relevant QML files directly on a Sailfish device
(or the emulator).

For example, this file provides the UI for the main WLAN settings page:

/usr/share/jolla-settings/pages/wlan/mainpage.qml

This lists your saved WLAN networks. It does this using the
SavedServiceModel model, which is a QAbstractListModel, and so can be
plugged straight in to a ListView (or any of the related Qt repeaters).

Look out for TechnologyModel, SavedServiceModel, NetworkTechnology and
NetworkManager around lines 225-253 of the file, which are all from
libconnman-qt.

If you want to manipulate things more specifically, the NetworkManager
provides access to NetworkService objects, and each NetworkService
object provides details of a network (e.g. its name, its domain, whether
it's connected, etc.). NetworkManager and NetworkService are basically
wrappers around their respective connman dbus interfaces:

https://git.merproject.org/mer-core/connman/blob/master/connman/doc/manager-api.txt

https://git.merproject.org/mer-core/connman/blob/master/connman/doc/service-api.txt

Another place to look would be in this file from lipstick-jolla-home,
which provides the Wifi connection selector dialogue:

/usr/share/lipstick-jolla-home-qt5/connectivity/ConnectionSelector.qml

Somewhere around line 918 you can see the TechnologyModel which is used
to populate the list shown to the user.

There may be other better or open source examples, but these are the two
that spring to mind. Getting a simple QML interface that shows saved
Wifi connections should be relatively straightforward using these models.

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Question about connecting a Sailfish phone to Ubuntu Linux box

2019-07-19 Thread David Llewellyn-Jones
On 19/07/2019 12:27, Sahlan wrote:
[snip]
> I have
> purchased a phone which is running Sailfish 3 and have set up Developer
> Mode on it. On Ubuntu 18.04 LTS, I installed the Sailfish Qt Creator IDE
> and built a simple test app. 

Which phone are you using? Did you flash it over USB to install
Sailfish? Your setup with Ubuntu is pretty standard, so it should work.

It's an obvious question, but did you, activate the Remote connection
option, and give yourself a root password?

https://jolla.zendesk.com/hc/en-us/articles/202011863-How-to-enable-Developer-Mode

> I connected the Sailfish phone via USB and
> confirmed with lsusb that the device is recognised as being connected.
> Under Tools / Options / Devices, I try to add the phone as a Sailfish OS
> Physical Device. The IP address, username and password correctly
> correspond to those on the phone, but clicking "Test Connection" always
> gives me the message "Host unreachable". Increasing the SSH timeout does
> not help. I also tried pinging the i.p. address of the phone from a
> terminal window, and it is not found, though I am not sure whether ping
> should work with i.p. over usb. 

Pinging should work over USB, and personally I'd focus on getting that
to work first, since until you can ping it's unlikely ssh will work.

It might also be worth trying to ping in the opposite direction (i.e
pinging your computer from the phone over USB) by opening a console on
the phone and using something like this:

su-devel ping 192.16.2.6

Some of the advice on this page may also be useful (if not now, then
once you have a connection!):

https://sailfishos.org/wiki/Sailfish_OS_Cheat_Sheet

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Wiki page for writing .spec files

2019-05-31 Thread David Llewellyn-Jones
On 31/05/2019 10:17, Oskar Roesler via Devel wrote:
> Hello, are there anywhere instructions how to write a .spec file for
> SFOS or do I have to use the ones from CentOS? Regards, Oskar

Hey Oskar,

There's this info about writing the .yaml files which can be used to
generate sensible SFOS spec files:

https://sailfishos.org/wiki/Application_SDK_Packaging_Apps#The_.yaml_File

Generating some valid spec files this way may provide a good starting
point. I'd also say it's worth being familiar with the general spec
format. There's lots of good documentation out there for this:

https://rpm.org/documentation.html

David
-- 
Website: http://www.flypig.co.uk
<>___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] ListView , Image with large height and EGL errors

2019-05-31 Thread David Llewellyn-Jones
On 31/05/2019 02:57, AL13N wrote:
> I have a ListView with an ListItem delegate and an Image in it;
> 
> when i have 2 images with a large height on it next to each other, after
> scrolling to it, i get an EGL Texture error .

Hey AL13N,

Unless someone else already knows the answer, could you provide some QML
-- a minimal working example -- that generates the error? This would be
a big help in understanding what's going on.

David
-- 
Website: http://www.flypig.co.uk
<>___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Boolean dependencies in RPM SPEC

2019-05-11 Thread David Llewellyn-Jones
On 11/05/2019 16:12, rinigus wrote:
[snip]
> BuildRequires: (libicu52-devel or libicu-devel)
> 
> as in
> https://github.com/rinigus/pkg-mapnik/blob/da5b6a11667b286c89bbee93eb57e2d4d52d5902/rpm/mapnik.spec#L16
>  
[snip]
> Hence the question - how can I add support for 3.0.2.x and 3.0.3.x using
> the same SPEC file? On device, RPM has version 4.14, if its of any
> importance.

For 'BuildRequires', it's presumably the versioning in your SDK tooling
which is important, rather than the RPM version on your device. It may
be worth checking that too.

Or is the problem you're experiencing happening at install time (i.e. in
relation to the 'Requires' on line 36 of that file)? I can't see any
difference between your version and the examples in the spec you posted.

David
-- 
Website: http://www.flypig.co.uk
<>___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Harbour compatibility - including multiple executables in a single RPM

2018-06-02 Thread David Llewellyn-Jones
Hi Martin,

On 02/06/18 02:05, Martin Kolman wrote:
> Fri, 1 Jun 2018 09:53:10 +0100 David Llewellyn-jones:
>> On 01/06/18 09:07, rinigus wrote:

[snip - discussion about multiple executables in a Harbour package]

>>>
>>> I understand, its a sport in the beginning. There is a simpler solution
>>> - you can always release a fart app for getting into the store :)
>> Yes, unfortunately "not releasing a fart app" is also one of my life
>> goals :)
>>
>> I make light of it, but it's actually more than a sport. I submitted my
>> first app back in 2014 and I'm still trying. Developers are held back by
>> Harbour's restrictive policies and lack of support for payment, while
>> user adoption is held back by lack of apps in the store (or so people
>> say). Anything that increases the quantity of quality docked apps in the
>> harbour has to be a good thing.
>>
>> At the same time, the Harbour rules should represent a checklist of
>> good-practice for developers,
>>
> While in some cases the rules are clearly understandable,
> such as mandating that developers use only external libraries
> with known stable API so that applications remain working
> in the future.
> 
> In other cases I think the rules are detrimental to the overall application
> and packaging quality, such as:
> 
> - you have to cram everything, including any external dependencies,
>  into a single package, which is the direct opposite of good Linux
>  distro packaging practices

I suppose this is tied up with the fact developers can only use a
restricted set of external APIs, all of which are part of the default
install.

So, while I agree this is restrictive, doesn't it make package curation
much easier, avoiding situations where one person updates a package and
causes some other app to break?

> - no RPM scriptlets are allowed, so code that would run once to handle
>   any local data migration and similar tasks will have to run at every
>   application start rather than once at package update as on normal
>   Linux distros

This is presumably for security reasons, since the RPM scriplets will
run as root, which no app is allowed to do.

Can the RPM scripts be set to run as the user? If so, I can't see any
reason why this shouldn't be allowed.

> - Harbour applications still (AFAIK) can't use such basic functionality
>   such as assigning custom actions to volume buttons, keeping the
>   device screen on or temporarily inhibiting device suspend to keep
>   important background tasks running without interruption

Perhaps this is a consequence of the lack of permission-based access
control on Sailfish? So, maybe Sailfish 3 will provide some respite if
it's due to have a a proper permissions system.

I would dearly love to have background tasks, and the aggressive halting
of background processing restricts a whole class of apps. I can
understand why Jolla enforce it though. iOS has a similar problem
(although Apple provides various esoteric APIs to try to get around it
without impacting battery life).

> - socket activation is no longer allowed, which effectively removed
>   OSM Scout Server, the best provider of offline mapping services
>   on any mobile platform currently in existence from the Jolla Store
>   and thus from many potential users

What's the reason for this? Is this related to the restriction on
background services? It sounds particularly unfortunate.

> - applications can be submitted as binary only, there is no option
>   to submit application source to be built on trusted build infrastructure,
>   so users and store QA have to believe developer the application actually
>   is built from the given source (if any) and actually does what the
>   developer claims it does

Yeah, this is really strange. I can understand some developers being
unhappy about supplying their source for commercial reasons, but why
wouldn't Jolla accept it as part of the review process if a developer is
happy to?

> In the end I ended up with two versions of the modRana package,
> one that's full featured and goes to OpenRepos and another one
> cut down & hacked to hell to pass all the Harbour hoops.

I see modRana on both stores. What were the changes you had to make?

> And that's just rule/process induced badness, if we compare Jolla Store
> with OpenRepos or some Linux distro repositories on features:
> 
> - Jolla Store lacks any web interface, people without a Sailfish OS device
>   can't check what apps are available & you can't send people links pointing
>   to apps in the Jolla Store

Right, I fully agree. Even if Jolla just made available a cut-down
read-only version of the "Your apps" page on Jolla Harbour, it'd be a
great start.

> - developers get no notification about new comments from user

Re: [SailfishDevel] Harbour compatibility - including multiple executables in a single RPM

2018-05-31 Thread David Llewellyn-Jones
Hi Ringus,

On 14/05/18 19:52, rinigus wrote:
> Hi David,
> 
> the rules regarding single executable haven't changed, to my knowledge.

I actually can't see anything in the rules that states you can't have
multiple executables, but it is a requirement to pass through the
rpmvalidator. If it's a requirement, I'm thinking it would be helpful to
make this explicit in the FAQ (which is the closest thing I'm aware of
to a stated set of rules).

> That particular problem was solved for my case by writing a wrapper and
> called either QML main or the main I wanted to use from Valhalla
> (https://github.com/rinigus/osmscout-server-route/blob/master/src/harbour-osmscout-server-module-route.cpp#L19).

Just so I'm clear, for your workaround you joined the two code bases at
compile time?

Unfortunately that won't work in my case, because I have my programme
(C++) calling a Perl programme, which then calls another (C-complied)
executable. It's possible using Perl would be reason enough to reject
from Harbour, but one step at a time! The issue of multiple executables
seems more fundamental to me.

> This solution would work, but its a touch harder to maintain. In the
> end, its up to you whether you want to have the app in the harbour or
> not. After all, its your decision. However, I would suggest to consider
> distribution via OpenRepos and not waste too much time for working
> around Harbour rules. 

Ultimately, I agree it's much simpler to release through OpenRepos (I'm
already doing this in fact), and I can appreciate the frustration for
you of having to pull your app later. At least you achieved it, even f
just temporarily. Getting something into Harbour is an important life
goal for me ;)

David

> Best wishes,
> 
> Rinigus
> 
> PS: Ironically, few month later, I had to pull out of Harbour anyway due
> to the changes in systemd API
> 
> On Mon, May 14, 2018 at 4:12 PM, David Llewellyn-Jones
> mailto:da...@flypig.co.uk>> wrote:
> 
> Hi,
> 
> The Harbour rpmvalidator is currently highlighting problems with my app
> because it has more than one executable packaged with it. I get errors
> like this:
> 
> ERROR [/usr/share/harbour-getiplay/lib/bin/rtmpdump] ELF binary in wrong
> location (must be /usr/bin/harbour-getiplay)
> 
> ERROR [/usr/share/harbour-getiplay/lib/bin/rtmpdump] File must not be
> executable (current permissions: 755)
> 
> Is there any way to create a Harbour-compatible package that includes
> more than one executable? From the validator, it looks to be impossible,
> but the FAQ doesn't say anything about it, so I'm still hopeful :)
> 
> For context, my app is just a UI wrapper around a separate executable
> that I call using QProcess. Since the underlying executable isn't
> written by me (and itself calls several other executables), integrating
> them into a single executable would be hard.
> 
> David
> 
> P.S. I checked the mailing list archives and together.jolla.com
> <http://together.jolla.com>, and
> although this has come up before (e.g.
> https://lists.sailfishos.org/pipermail/devel/2017-May/007898.html
> <https://lists.sailfishos.org/pipermail/devel/2017-May/007898.html>) I
> didn't see any clear solutions or conclusions.
> -- 
> Website: http://www.flypig.co.uk
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
> <mailto:devel-unsubscr...@lists.sailfishos.org>
> 
> 
> 
> 
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
> 


-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] Harbour compatibility - including multiple executables in a single RPM

2018-05-14 Thread David Llewellyn-Jones
Hi,

The Harbour rpmvalidator is currently highlighting problems with my app
because it has more than one executable packaged with it. I get errors
like this:

ERROR [/usr/share/harbour-getiplay/lib/bin/rtmpdump] ELF binary in wrong
location (must be /usr/bin/harbour-getiplay)

ERROR [/usr/share/harbour-getiplay/lib/bin/rtmpdump] File must not be
executable (current permissions: 755)

Is there any way to create a Harbour-compatible package that includes
more than one executable? From the validator, it looks to be impossible,
but the FAQ doesn't say anything about it, so I'm still hopeful :)

For context, my app is just a UI wrapper around a separate executable
that I call using QProcess. Since the underlying executable isn't
written by me (and itself calls several other executables), integrating
them into a single executable would be hard.

David

P.S. I checked the mailing list archives and together.jolla.com, and
although this has come up before (e.g.
https://lists.sailfishos.org/pipermail/devel/2017-May/007898.html) I
didn't see any clear solutions or conclusions.
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] bluez5 breaks sdp_connect()

2017-09-03 Thread David Llewellyn-Jones
Hello!

I recently upgraded my Jolla C to 2.1.1.26, and so moved from bluez-libs
to bluez5-libs.

This triggered the issue that sdp_connect() is no longer supported by
bluez5. Running the bluetooth daemon in compatibility mode (as described
here: https://raspberrypi.stackexchange.com/a/42262) allows sdp_conned()
to work again, but I'd rather address the issue properly in my code.

Does anyone have advice on good ways to register a Bluetooth service
using Bluez on Sailfish OS that would work across devices?

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org