Re: [SailfishDevel] Contacts db issue

2015-10-26 Thread Matthew Vogt
Hi Tone.
Yes, it sounds like you have a corrupted contacts database.  Any idea how that 
might have happened?

In any case, you can try to recreate the database to fix the issue.  You need 
to do something along the lines of the following (but please sanity-check these 
instructions before running them, I'm typing them into email, not having tested 
them on device!):

You will need to have a privileged user session:
$ devel-su -p

Then stop everything that might be writing to the contacts database:
$ systemctl --user stop lipstick
$ systemctl --user stop msyncd
$ systemctl --user stop contactsd
$ systemctl --user stop as-daemon

Change to the directory where the database resides:
$ cd ~/.local/share/system/privileged/Contacts

Check that DB is actually corrupted; this will say 'ok' if there are no 
problems, or report a bunch of error messages:
$ sqlite3 qtcontacts-sqlite/contacts.db "pragma integrity_check;"

If there are problems, continue:

Make a backup copy of the broken DB just in case we lose something:
$ mkdir bkp
$ cp -R qtcontacts-sqlite bkp/

Dump the DB contents:
$ mkdir temp
$ sqlite3 qtcontacts-sqlite/contacts.db .dump > temp/dump.sql

Record the current schema version of the DB, which is reported by the following 
command (it is probably 15 or 16 or something similar):
$ sqlite3 qtcontacts-sqlite/contacts.db "pragma user_version;"

Recreate the database from the dump:
$ mkdir new-db
$ sqlite3 new-db/contacts.db < temp/dump.sql

Set the schema version in the new database, where VER is the number reported 
above:
$ sqlite3 new-db/contacts.db "pragma user_version = ;"

Move the new database to be the device database:
$ mv qtcontacts-sqlite old-db
$ mv new-db qtcontacts-sqlite

Then reboot, and the device will restart using the new version of the DB.

You can then remove the bkp, temp and old-db directories, assuming things went 
well.  If things did not go well, you can restore the old-db directory to the 
'qtcontacts-sqlite' location (after stopping everything as we did earlier) and 
contact me directly.

Thanks,
Matt


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Tone Kastlunger [users.giulie...@gmail.com]
Sent: Tuesday, October 27, 2015 5:47 AM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Contacts db issue

Hey;
looking through the logs (for something else) on my Jolla I happened to find the
following error; it appears to be realated to the contacts db. Any way to fix 
it?


 "Failed to prepare query for joined details:
  database disk image is malformed Unable to fetch 
row
  Query:
  SELECT 
Details.detailId,Details.contactId,Details.detail,Details.detailUri,Details.linkedDetailUris,Details.contexts,Details.accessConstraints,Details.provenance,COALESCE(Details.modifiable,
 0),COALESCE(Details.nonexportable, 
0),Addresses.*,Anniversaries.*,Avatars.*,Birthdays.*,EmailAddresses.*,Families.*,GeoLocations.*,Guids.*,Hobbies.*,Nicknames.*,Notes.*,OnlineAccounts.*,Organizations.*,PhoneNumbers.*,Presences.*,Ringtones.*,Tags.*,Urls.*,OriginMetadata.*,GlobalPresences.*,ExtendedDetails.*
 FROM temp.RegenerateAggregate CROSS JOIN Details ON Details.contactId = 
temp.RegenerateAggregate.contactId LEFT JOIN Addresses ON Addresses.detailId = 
Details.detailId LEFT JOIN Anniversaries ON Anniversaries.detailId = 
Details.detailId LEFT JOIN Avatars ON Avatars.detailId = Details.detailId LEFT 
JOIN Birthdays ON Birthdays.detailId = Details.detailId LEFT JOIN 
EmailAddresses ON EmailAddresses.detailId = Details.detailId LEFT JOIN Families 
ON Families.detailId = Details.detailId LEFT JOIN GeoLocations ON 
GeoLocations.detailId = Details.detailId LEFT JOIN Guids ON Guids.detailId = 
Details.detailId LEFT JOIN Hobbies ON Hobbies.detailId = Details.detailId LEFT 
JOIN Nicknames ON Nicknames.detailId = Details.detailId LEFT JOIN Notes ON 
Notes.detailId = Details.detailId LEFT JOIN OnlineAccounts ON 
OnlineAccounts.detailId = Details.detailId LEFT JOIN Organizations ON 
Organizations.detailId = Details.detailId LEFT JOIN PhoneNumbers ON 
PhoneNumbers.detailId = Details.detailId LEFT JOIN Presences ON 
Presences.detailId = Details.detailId LEFT JOIN Ringtones ON Ringtones.detailId 
= Details.detailId LEFT JOIN Tags ON Tags.detailId = Details.detailId LEFT JOIN 
Urls ON Urls.detailId = Details.detailId LEFT JOIN OriginMetadata ON 
OriginMetadata.detailId = Details.detailId LEFT JOIN GlobalPresences ON 
GlobalPresences.detailId = Details.detailId LEFT JOIN ExtendedDetails ON 
ExtendedDetails.detailI
Oct 26 21:38:30 Jolla [1156]: [W] ContactWriter::regenerateAggregates:3652 - 
"Failed to read constituent contacts for aggregate 8487 during regenerate"



___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] Contacts db issue

2015-10-26 Thread Tone Kastlunger
Hey;
looking through the logs (for something else) on my Jolla I happened to
find the
following error; it appears to be realated to the contacts db. Any way to
fix it?


 "Failed to prepare query for joined details:
  database disk image is malformed Unable to
fetch row
  Query:
  SELECT
Details.detailId,Details.contactId,Details.detail,Details.detailUri,Details.linkedDetailUris,Details.contexts,Details.accessConstraints,Details.provenance,COALESCE(Details.modifiable,
0),COALESCE(Details.nonexportable,
0),Addresses.*,Anniversaries.*,Avatars.*,Birthdays.*,EmailAddresses.*,Families.*,GeoLocations.*,Guids.*,Hobbies.*,Nicknames.*,Notes.*,OnlineAccounts.*,Organizations.*,PhoneNumbers.*,Presences.*,Ringtones.*,Tags.*,Urls.*,OriginMetadata.*,GlobalPresences.*,ExtendedDetails.*
FROM temp.RegenerateAggregate CROSS JOIN Details ON Details.contactId =
temp.RegenerateAggregate.contactId LEFT JOIN Addresses ON
Addresses.detailId = Details.detailId LEFT JOIN Anniversaries ON
Anniversaries.detailId = Details.detailId LEFT JOIN Avatars ON
Avatars.detailId = Details.detailId LEFT JOIN Birthdays ON
Birthdays.detailId = Details.detailId LEFT JOIN EmailAddresses ON
EmailAddresses.detailId = Details.detailId LEFT JOIN Families ON
Families.detailId = Details.detailId LEFT JOIN GeoLocations ON
GeoLocations.detailId = Details.detailId LEFT JOIN Guids ON Guids.detailId
= Details.detailId LEFT JOIN Hobbies ON Hobbies.detailId = Details.detailId
LEFT JOIN Nicknames ON Nicknames.detailId = Details.detailId LEFT JOIN
Notes ON Notes.detailId = Details.detailId LEFT JOIN OnlineAccounts ON
OnlineAccounts.detailId = Details.detailId LEFT JOIN Organizations ON
Organizations.detailId = Details.detailId LEFT JOIN PhoneNumbers ON
PhoneNumbers.detailId = Details.detailId LEFT JOIN Presences ON
Presences.detailId = Details.detailId LEFT JOIN Ringtones ON
Ringtones.detailId = Details.detailId LEFT JOIN Tags ON Tags.detailId =
Details.detailId LEFT JOIN Urls ON Urls.detailId = Details.detailId LEFT
JOIN OriginMetadata ON OriginMetadata.detailId = Details.detailId LEFT JOIN
GlobalPresences ON GlobalPresences.detailId = Details.detailId LEFT JOIN
ExtendedDetails ON ExtendedDetails.detailI
Oct 26 21:38:30 Jolla [1156]: [W] ContactWriter::regenerateAggregates:3652
- "Failed to read constituent contacts for aggregate 8487 during regenerate"
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] UX issues

2015-10-26 Thread Peter Kovacs
HI francois,

My expectation is:
1 level - List of things
-Tab short switches into 2 level detail
- tab long deletes object.
- menu generates new item( empty level detail)
2 level detail of object
-tab property opens editor for that property
(
new page if property is complex
on screen if property is simple
)
- Swipe left accept change
-Swipe right decline changes

Have fun
Peter

François K.  schrieb am Mo., 26. Okt. 2015 15:58:

> Thank you Petr for you advices. I'll definitely give it a try.
>
> If others have other ideas/advices/points of view, please share them !
>
> Cheers,
>
> --
> François
> ___
> 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

Re: [SailfishDevel] UX issues

2015-10-26 Thread François K .
Thank you Petr for you advices. I'll definitely give it a try.

If others have other ideas/advices/points of view, please share them !

Cheers,

-- 
François
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Drawing ShaderEffect to Canvas

2015-10-26 Thread Kimmo Lindholm
> Yeah grabToImage() is pretty costly due to the pixel readback. What you want
> is to draw your ShaderEffect into a texture and then draw that texture 
> directly
> onto the canvas without going through the pixel readback / CPU memory code
> path that  grabToImage would imply. Not sure how exactly we would swing that
> with the current Canvas design (at least if we take threaded/non-threaded and
> Image codepaths into account), but feel free to open a suggestion for that on
> bugreports.qt.io. Something might happen :)

Will do. Thanks.

-kimmo
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] Drawing ShaderEffect to Canvas

2015-10-26 Thread Gunnar Sletta

> On 26 Oct 2015, at 10:52, Kimmo Lindholm  wrote:
> 
> I think I found a way to do this.
>  
> I draw the painting tool to a separate preview canvas, and use this as a 
> alpha-mask input for the shader. Then combine this with processed drawing 
> canvas contents and view the shader output in realtime.
> When user accepts the result, the whole thing is grabbed as an image and 
> drawn on top of the main drawing canvas.
>  
> PoC with simple shader that swaps RGB --> BRG channels on user selected 
> area:https://twitter.com/LiKimmo/status/65855935622144/photo/1
>  
> shader code: gl_FragColor = texture2D(source, qt_TexCoord0).brga * 
> texture2D(mask, qt_TexCoord0).a;
> where source is whole drawing canvas, mask is preview canvas where the actual 
> drawing happens – hidden during this process.

Nice one :)

>  
> grapToImage is still slow, but that delay is suffered only when applying the 
> results. Maybe this is place for a Qt feature request, Item::toCanvasImageData

Yeah grabToImage() is pretty costly due to the pixel readback. What you want is 
to draw your ShaderEffect into a texture and then draw that texture directly 
onto the canvas without going through the pixel readback / CPU memory code path 
that  grabToImage would imply. Not sure how exactly we would swing that with 
the current Canvas design (at least if we take threaded/non-threaded and Image 
codepaths into account), but feel free to open a suggestion for that on 
bugreports.qt.io. Something might happen :)

>  
> -kimmo
>  
> From: devel-boun...@lists.sailfishos.org 
> [mailto:devel-boun...@lists.sailfishos.org] On Behalf Of Kimmo Lindholm
> Sent: 26. lokakuuta 2015 8:55
> To: devel@lists.sailfishos.org
> Subject: [SailfishDevel] Drawing ShaderEffect to Canvas
>  
> Hi,
>  
> This relates to my Paint app. Doing tools to modify image, blur, invert, 
> colorchannel swap etc. from area under your finger, like realtime brush.
>  
> Doing the bitmanipulation with javascript in canvas-onPaint works but even 
> simple things like invert are utterly slow.
>  
> Then I decided to give ShaderEffect a try. I can successfully get image data 
> under mouse from Canvas;
>  
> ShaderEffectSource {
> sourceItem: myCanvas
> sourceRect: Qt.rect(x,y,w,h)
> …
>  
> The shader outputs the selected part of canvas nicely on screen with 
> fragmentShader applied. Looks great.
>  
> Now I would like to draw the shader output to my 2nd canvas, which is later 
> drawn on top of the actual canvas if accepted by user.
>  
> But putImageData(myShader,x,y) does not draw on canvas, and does not give any 
> error. (other trials complain that ImageDataObject is invalid)
>  
> I managed to do this by calling myCanvas.grabToImage(…) and 
> drawImage(result.url) but this is again as slow as the Javascript 
> implementation.
> Nothing that I can use on realtime-editing. This could be used after masking 
> an area where to apply the shader.
>  
> If someone has any ideas?
>  
> -kimmo
>  
> ___
> 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

Re: [SailfishDevel] Drawing ShaderEffect to Canvas

2015-10-26 Thread Kimmo Lindholm
I think I found a way to do this.

I draw the painting tool to a separate preview canvas, and use this as a 
alpha-mask input for the shader. Then combine this with processed drawing 
canvas contents and view the shader output in realtime.
When user accepts the result, the whole thing is grabbed as an image and drawn 
on top of the main drawing canvas.

PoC with simple shader that swaps RGB --> BRG channels on user selected area: 
https://twitter.com/LiKimmo/status/65855935622144/photo/1

shader code: gl_FragColor = texture2D(source, qt_TexCoord0).brga * 
texture2D(mask, qt_TexCoord0).a;
where source is whole drawing canvas, mask is preview canvas where the actual 
drawing happens - hidden during this process.

grapToImage is still slow, but that delay is suffered only when applying the 
results. Maybe this is place for a Qt feature request, Item::toCanvasImageData

-kimmo

From: devel-boun...@lists.sailfishos.org 
[mailto:devel-boun...@lists.sailfishos.org] On Behalf Of Kimmo Lindholm
Sent: 26. lokakuuta 2015 8:55
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Drawing ShaderEffect to Canvas

Hi,

This relates to my Paint app. Doing tools to modify image, blur, invert, 
colorchannel swap etc. from area under your finger, like realtime brush.

Doing the bitmanipulation with javascript in canvas-onPaint works but even 
simple things like invert are utterly slow.

Then I decided to give ShaderEffect a try. I can successfully get image data 
under mouse from Canvas;

ShaderEffectSource {
sourceItem: myCanvas
sourceRect: Qt.rect(x,y,w,h)
...

The shader outputs the selected part of canvas nicely on screen with 
fragmentShader applied. Looks great.

Now I would like to draw the shader output to my 2nd canvas, which is later 
drawn on top of the actual canvas if accepted by user.

But putImageData(myShader,x,y) does not draw on canvas, and does not give any 
error. (other trials complain that ImageDataObject is invalid)

I managed to do this by calling myCanvas.grabToImage(...) and 
drawImage(result.url) but this is again as slow as the Javascript 
implementation.
Nothing that I can use on realtime-editing. This could be used after masking an 
area where to apply the shader.

If someone has any ideas?

-kimmo

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org