Anyone?

I made a simple example to reproduce the segfault,
reffering to the doc:
http://www.pyside.org/docs/pyside-mobility/QtMobility/Organizer/QOrganizerCollectionId.html


#!/usr/bin/env python
#-*- coding: utf-8 -*-

import sys
from PySide import QtCore
from QtMobility.Organizer import *

class QtMobilityTest(QtCore.QObject):
    def __init__(self):
        QtCore.QObject.__init__(self)
        self.defaultManager = QOrganizerManager()
        self.collections = self.defaultManager.collections()
     
        print len(self.collections)

        for collection in self.collections:
            print type(collection), collection.id()
            print collection.id().toString()
        sys.exit(0)

if __name__ == "__main__":
    app = QtCore.QCoreApplication([])
    test = QtMobilityTest()
    app.exec_()

run this on N950 gives output:
6
<type 'QtMobility.Organizer.QtMobility.QOrganizerCollection'>
<QtMobility.Organizer.QtMobility.QOrganizerCollectionId object at
0x3c2eaf08>
Segmentation fault

I'm not able to fill a bugreport because there is no section Organizer
component at http://bugs.pyside.org und PySide Mobility?!? Is it
supported at all?

It's very annoying, any help appreciated!
Boris Pohler



Am Freitag, den 18.11.2011, 07:18 +0100 schrieb Boris Pohler:
> Hi,
> I use qtmobility.organizer to get the events out of the calendar on
> harmattan (N9/N950) for my application. 
> This works quite nice so far, I get all the events.
> 
> Here is working example:
> #!/usr/bin/env python
> #-*- coding: utf-8 -*-
> 
> # just for testing with qtmobiliy-organizer
> 
> import sys
> from QtMobility.Organizer import *
> from PySide import QtCore
> from PySide.QtCore import QDateTime, QDate, QTime
> 
> 
> class QtMobilityTest(QtCore.QObject):
>     def __init__(self):
>         QtCore.QObject.__init__(self)
>         self.defaultManager = QOrganizerManager()
>         self.collections = self.defaultManager.collections()
>         print len(self.collections)
>         self.selected_collections = []
>         for collection in self.collections:
>             print collection.metaData()['Color'],
> collection.metaData()['Name'], collection.id()
>             self.selected_collections.append(collection.id())
>           
>         now = QDateTime.currentDateTime()
>         days_ahead = 50
>         self.items =
> self.defaultManager.items(now,now.addDays(days_ahead))
>         for item in self.items:
>             if item.type() == 'Todo':
>                 todo = QOrganizerTodo(item)
>                 print (todo.dueDateTime().toString("dd.MM.yyyy
> hh:mm:ss"),
>                        todo.displayLabel()) 
>             if item.type() == 'EventOccurrence':
>                 occurrence = QOrganizerEventOccurrence(item)
>                 print (occurrence.startDateTime().toString("dd.MM.yyyy
> hh:mm:ss"),
>                        occurrence.endDateTime().toString("dd.MM.yyyy
> hh:mm:ss"), 
>                        occurrence.displayLabel(), 
>                        occurrence.location()) 
>             if item.type() == 'Event':
>                 event = QOrganizerEvent(item)
>                 print event.collectionId()
>                 print (event.startDateTime().toString("dd.MM.yyyy
> hh:mm:ss"), 
>                        event.endDateTime().toString("dd.MM.yyyy
> hh:mm:ss"),
>                        event.displayLabel(),
>                        event.location(),
>                        event.id())
>         sys.exit(0)
> 
> if __name__ == "__main__":
>     app = QtCore.QCoreApplication([])
>     test = QtMobilityTest()
>     app.exec_()
> [/CODE]
> 
> But in my application the user should be able to choose which calendar
> are be displayed, so I need to know to which calendar the event belong.
> 
> My first try was to compare the collectionIds of the collections given
> by the manager with the collectionIds of the events I got, but the
> program stops with a segmentation fault.
> 
> Any ideas what went wrong or any other suggestions how to do it?
> 
> 
> 
> _______________________________________________
> PySide mailing list
> [email protected]
> http://lists.pyside.org/listinfo/pyside


_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to