*** zbenjamin is now known as Guest58107 | 01:53 | |
*** zbenjamin_ is now known as zbenjamin | 01:53 | |
r0kk3rz | not sure it does | 03:03 |
---|---|---|
*** frinring_ is now known as frinring | 03:40 | |
*** jameshjacks0njr_ is now known as jameshjacks0njr | 04:54 | |
*** monich_ is now known as monich | 10:33 | |
attah | Okay Qt-wizards.. Are QProcess instances with the same parent fighting for time on the same CPU core or not? | 17:33 |
attah | Them showing separately in top would suggest they aren't, but the CPU utilization summing to 100, within margin of error makes me wonder... and trying to search for answers on the internet certainly didn't make anything clearer | 17:34 |
attah | Hmm, if i just get my head on straight and compare apples to apples, i can see it performs just the same as a regular pipe... so no reason to complain | 17:51 |
attah | still lots of confusion on the interwebs... | 17:51 |
Nico[m] | Man, once qmllivebench and sfsdk work, they are actually really fun to use :D | 20:13 |
Mister_Magister | mal: monich: how can i receive in my app network change? | 20:27 |
Nico[m] | Mister_Magister: static ContextProperty *prop = new ContextProperty("Internet.NetworkState"); | 20:29 |
Nico[m] | connect(prop, &ContextProperty::valueChanged, [this]() {}); | 20:29 |
Nico[m] | (You can do the same from Qml too) | 20:29 |
Mister_Magister | Nico[m]: my savior! | 20:30 |
Nico[m] | Basically you want to connect to the Internet.NetworkState property from statefs | 20:30 |
Mister_Magister | the hell is context property lmao | 20:30 |
Mister_Magister | huuh | 20:30 |
Nico[m] | There also is one for the carrier etc | 20:30 |
Mister_Magister | i need to know if its wifi, roaming, mobile yaknow | 20:30 |
Nico[m] | Yeah, that one is called a bit differently, let me check | 20:31 |
Nico[m] | You wanto Internet.NetworkType | 20:32 |
Nico[m] | You can also read the current value from here on your device: /var/run/state/namespaces/Internet/NetworkType | 20:33 |
Mister_Magister | thanks! | 20:34 |
Mister_Magister | Nico[m]: will ContextProperty *prop = new ContextProperty("Internet.NetworkType"); tell me if there's no network? | 20:35 |
monich | Mister_Magister: I would consider NetworkManager::connected | 20:35 |
monich | https://git.sailfishos.org/mer-core/libconnman-qt/blob/e0448d13/libconnman-qt/networkmanager.h#L50 | 20:35 |
monich | or NetworkManager::state | 20:36 |
Mister_Magister | well i need both if its connected or not and connection type | 20:36 |
Nico[m] | Mister_Magister: Not sure, I think I used the network state for it :3 | 20:36 |
Nico[m] | And you can connect to multiple properties .-. | 20:37 |
monich | Mister_Magister: how about NetworkManager::defaultRoute then | 20:37 |
monich | more than one service can be connected at the same time | 20:38 |
Mister_Magister | but how do i use that | 20:38 |
monich | it's certainly the case certainly in case of vpn | 20:38 |
monich | Mister_Magister: you can use that any way tou like! | 20:38 |
Mister_Magister | i mean | 20:38 |
Mister_Magister | how do i connect and stuff | 20:38 |
monich | it's a property, there's a signal associated with it | 20:39 |
monich | in c++ you better get the instance from NetworkManager::instance() | 20:40 |
monich | from qml you can also get the shared instance somehow | 20:40 |
Mister_Magister | c++ interests me only | 20:41 |
Mister_Magister | i mean NetworkManager? didn't sfos have connman | 20:41 |
Mister_Magister | confused | 20:42 |
monich | NetworkManager is a wrapper for net.connman.Manager dbus interface | 20:42 |
Mister_Magister | ahh | 20:42 |
monich | yeah, it's a bit confusing)) | 20:42 |
Mister_Magister | how do i include it | 20:42 |
monich | BuildRequires: pkgconfig(connman-qt5) | 20:44 |
monich | connman-qt5-devel package | 20:44 |
Mister_Magister | anything in .pro? | 20:45 |
Mister_Magister | but like header to include | 20:45 |
monich | regular pkgconfig stuff in .pro | 20:45 |
Mister_Magister | networkmanager.h found! | 20:46 |
monich | PKGCONFIG += connman-qt5 | 20:46 |
monich | CONFIG += link_pkgconfig | 20:47 |
Mister_Magister | yeah yeah | 20:47 |
Mister_Magister | already said its found | 20:47 |
Mister_Magister | ;) | 20:47 |
Mister_Magister | monich: i can use connectedChanged for connection state but what about type? | 20:48 |
monich | from defaultRoute you get NetworkService which has the type | 20:49 |
monich | don't keep the pointer to NetworkService though, it can be spontaneously deleted | 20:50 |
monich | or watch its deleted() signal | 20:50 |
monich | or what it's called | 20:51 |
monich | destroyed() it is | 20:51 |
Mister_Magister | nice warning | 20:54 |
Mister_Magister | xd | 20:54 |
Mister_Magister | but how do you keep signal slot then | 20:54 |
Mister_Magister | wouldn't contextproperty be better then? | 20:55 |
monich | well, it's programming | 21:00 |
monich | there are 100500 ways to do the same thing | 21:00 |
Mister_Magister | yeah but context property won't magically suddenly remove connection | 21:01 |
Mister_Magister | monich: how can i mitigate networkmanager going RIP | 21:01 |
monich | I think networkmanager lives forever, its networkservice that can die anytime | 21:02 |
Mister_Magister | yeah how can i mitigate that? | 21:03 |
Mister_Magister | onDelete, assign new instance and connection? | 21:03 |
monich | first, do you really need to keep that pointer | 21:03 |
Mister_Magister | i really need to keep connected to signal | 21:04 |
Mister_Magister | so i get network state/type change signal | 21:04 |
monich | to defaultRoute you have to if you want to get notified | 21:04 |
Mister_Magister | yeah but if pointer will get deleted, signal will too | 21:05 |
monich | defaultRoute is networkmanager's property | 21:05 |
monich | that thing never dies I think | 21:05 |
monich | but the value is networkservice* | 21:06 |
monich | which can die later | 21:06 |
Mister_Magister | ohhh | 21:06 |
Mister_Magister | yeah no i just need change | 21:06 |
Mister_Magister | so i set network type in library | 21:06 |
Mister_Magister | i dont need its pointer | 21:06 |
monich | then you handle defaultRoute, check it for null, query the type | 21:06 |
monich | and you're done | 21:07 |
monich | handle defaultRouteChanged that is | 21:07 |
monich | the signal | 21:07 |
monich | Q_PROPERTY(NetworkService* defaultRoute READ defaultRoute NOTIFY defaultRouteChanged) | 21:07 |
Mister_Magister | okay | 21:29 |
Mister_Magister | monich: but what types are there | 21:45 |
Mister_Magister | can't seem to find it | 21:45 |
Mister_Magister | https://git.sailfishos.org/mer-core/libconnman-qt/blob/e0448d13/libconnman-qt/networkmanager.cpp#L97 found this | 21:47 |
Mister_Magister | but its not enough | 21:47 |
Mister_Magister | guess i can take roaming value in case its cellural | 21:50 |
Mister_Magister | or however you type that | 21:50 |
monich | https://git.sailfishos.org/mer-core/connman/blob/41b88740/connman/src/service.c#L558 | 21:51 |
monich | Mister_Magister: types ^ | 21:51 |
Mister_Magister | monich: i need wifi. cellular, roaming, none. https://paste.opensuse.org/709a3ec5 would this be sufficient? | 21:52 |
Mister_Magister | and if networkService is nulptr then none | 21:52 |
monich | then you're not connected | 21:53 |
Mister_Magister | yeah networkservice isn't null but type is empty, so is that sufficient for my needs? | 21:54 |
Mister_Magister | or do i need to bother with bt etc | 21:54 |
Mister_Magister | if its vpn i don't know which one is it right? | 21:54 |
Mister_Magister | how's gps a connection even | 21:55 |
Mister_Magister | so confused | 21:55 |
Mister_Magister | monich: ? | 22:02 |
monich | Mister_Magister: in reality you won't see anything other than wifi, cellular and vpn | 22:08 |
monich | actually | 22:08 |
Mister_Magister | vpn is the scary one | 22:08 |
monich | I'm not sure what's usb connection | 22:08 |
Mister_Magister | because idk if its cellular or wifi | 22:08 |
monich | possibly gadget | 22:08 |
Mister_Magister | monich: gadget | 22:08 |
Mister_Magister | monich: can i determine if vpn is over cellular or wifi? | 22:09 |
monich | that I'm not sure | 22:09 |
monich | iirc wifi takes precedence over cellular | 22:10 |
Mister_Magister | yeah | 22:10 |
Mister_Magister | ill set vpn to other | 22:10 |
monich | so if both are connected, wifi is the one actually being used | 22:10 |
Mister_Magister | why would i bother | 22:10 |
Mister_Magister | anything else i'll set to other | 22:10 |
Mister_Magister | i know | 22:10 |
Mister_Magister | thanks monich for help | 22:14 |
monich | cheers! | 22:14 |
Mister_Magister | :3 | 22:15 |
Mister_Magister | monich: will i get defaultroutechanged signal if i change from 2g to 3g? | 22:21 |
monich | Mister_Magister: probably not, unless connection breaks in the process | 22:23 |
Mister_Magister | thats… okay i guess? if it keeps all internet connections its fine | 22:23 |
monich | I would expect 2g to 3g switch to occur without loss of connection | 22:24 |
Mister_Magister | okay | 22:24 |
monich | even lte although I'm not 100% sure about lte | 22:24 |
monich | lte is a different radio | 22:25 |
Mister_Magister | if it looses conection and notifies me about that thats good | 22:31 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!