Hi boys and girls,
I'm going crazy because I have NO idea why the hell my app is not doing what I want.
I want to allow the user to write a selected date in the N9 calendar and so I use QOrganizer, here is my (wip) code to do this:
This code works and write the date in my calendar.Code:#-*- coding: utf-8 -*- import sys from PySide import QtCore from QtMobility.Organizer import * class Save(QtCore.QObject): def __init__(self): QtCore.QObject.__init__(self) print "-------------------------------------" start = "23.02.2012" end = "23.02.2012" name = u"my birthday" self.saveItem(start, end, name) def saveItem(self, start, end, name): startTime = QtCore.QDateTime.fromString(start,'dd.MM.yyyy') endTime = QtCore.QDateTime.fromString(end,'dd.MM.yyyy') organizer = QOrganizerManager() event = QOrganizerEvent() event.setDisplayLabel(str(name)) event.setStartDateTime(startTime) event.setEndDateTime(endTime) event.setAllDay(True) organizer.saveItem(event) print "safed" sys.exit(0) if __name__ == "__main__": app = QtCore.QCoreApplication([]) test = Save() app.exec_()
BUT:
If I'm importing/or using exactly the same code of saveItem function, it is NOT working. But I don't understand WHY THE HELL NOT! In console it's running and tells me that it writes the event to calendar, but it don't shows up.
My only clue is the following error message, but I get this message by running the above code also.
Is there somebody with an idea what's wrong here? I could, also post you the whole main application code, but there is nothing special. With print I also checked, that the function got the right types (str/unicode).Code:QTrackerResult: QSparqlError(9, "Rejected send message, 3 matched rules; type="method_call", sender=":1.224" (uid=29999 pid=4268 comm="python freiertag.py ") interface="org.freedesktop.Tracker1.Resources" member="SparqlUpdateBlank" error name="(unset)" requested_reply=0 destination="org.freedesktop.Tracker1" (uid=29999 pid=1317 comm="/usr/lib/tracker/tracker-store "))", 1) "INSERT { <urn:x-ical:3defc125-8ff3-48df-8a75-10fde672a0ac> a ncal:Event, nie:DataObject; ncal:uid <3defc125-8ff3-48df-8a75-10fde672a0ac>; ncal:dtstart [ a ncal:NcalDateTime; ncal:dateTime '2011-03-03T00:00:00+01:00'; ncal:ncalTimezone <urn:x-ical:timezone:Europe/Berlin> ]; ncal:dtend [ a ncal:NcalDateTime; ncal:dateTime '2011-03-03T00:00:00+01:00'; ncal:ncalTimezone <urn:x-ical:timezone:Europe/Berlin> ]; ncal:transp ncal:opaqueTransparency; ncal:summary 'Weiberfastnacht'; ncal:class ncal:publicClassification; ncal:priority 0; ncal:dtstamp '2012-02-24T21:57:31Z'; ncal:created '2012-02-24T21:57:31Z'; nie:contentCreated '2012-02-24T21:57:31Z'; ncal:lastModified '2012-02-24T21:57:31Z'; ncal:sequence 0; ncal:url <urn:x-ical:3defc125-8ff3-48df-8a75-10fde672a0ac>; nie:isLogicalPartOf <urn:x-ical:3ba5540f-da66-40cb-9026-8bf1adacc952> . <urn:x-ical:3ba5540f-da66-40cb-9026-8bf1adacc952> a ncal:Calendar } "
Thank you very very much in advance!
AlphaX2



Reply With Quote


