Re: calendar-backend API: CCalendar's entries empty
Hi Nicolai, thanks for the valuable hint. The problem, as it turned out, was a classical PEBCAK (*). In Qt Developer, I used user "developer" to deploy on my N900. Therefore, this user's calendar was queried, returning zero entries ;) So switching to "user" solved the problem. However, thanks for your answer! Best, Filip --- (*) Problem Exists Between Chair And Keyboard ;) On Fri, 2010-11-05 at 17:22 +0100, Nicolai Hess wrote: > > > 2010/11/5 Filip-M. Brinkmann > Hi all, > > I'd like to code a small Todo-list widget, which shows all due > to-dos on > the desktop. > I started today, but I cannot access the to-dos because the > CCalendar > instances don't return any entries. > I have 2 Calendars on my N900 and I get two calendar instances > back, > which is fine. They return the correct names and attributes, > but are > otherwise unresponsive. ;) > so, for instance the following code returns 0 as to-do count: > > ... > > QString output; > int count=0; > int error; > > CMulticalendar* mcal = CMulticalendar::MCInstance(); > vector cals = mcal->getListCalFromMc(); > for(std::vector::iterator it = cals.begin(); it != > cals.end(); ++it){ > // here, I get those 2 calendars correctly > > // next line sums up to 0 all the time > count += > (dynamic_cast(*it))->getTodos(error).size(); > > // next line shows the calendar names > cerr << (dynamic_cast(*it))->getCalendarName(); > } > > output= QString("Found %1 todos.").arg(count); > // count is 0 here, although I have like 20 todos in one > calendar > return output; > > -- > Same behaviour shows on getEvents() and so on... > > Since documentation is...ehm... not very complete: > does anyone know what happens there? > > cheers, > > filip > > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > > > For debugging purpose you can create an empty file: > /home/user/.calendar/log > (reboot may necessary) > > This file indicates the calendar-backend to log ALL sql and results > as syslog messages. > Now you can see which sql and parameters are called for example to > retrive all todos with > "getTodos()" > > Btw pay attention, that methods like this one: > (dynamic_cast(*it))->getTodos(error).size(); > > create a vector with dynamically allocated objects, and you have > to free them. > > regards > nicolai > > > > > > > signature.asc Description: This is a digitally signed message part ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend API: CCalendar's entries empty
2010/11/5 Filip-M. Brinkmann > Hi all, > > I'd like to code a small Todo-list widget, which shows all due to-dos on > the desktop. > I started today, but I cannot access the to-dos because the CCalendar > instances don't return any entries. > I have 2 Calendars on my N900 and I get two calendar instances back, > which is fine. They return the correct names and attributes, but are > otherwise unresponsive. ;) > so, for instance the following code returns 0 as to-do count: > > ... > > QString output; > int count=0; > int error; > > CMulticalendar* mcal = CMulticalendar::MCInstance(); > vector cals = mcal->getListCalFromMc(); > for(std::vector::iterator it = cals.begin(); it != cals.end(); > ++it){ > // here, I get those 2 calendars correctly > > // next line sums up to 0 all the time > count += (dynamic_cast(*it))->getTodos(error).size(); > > // next line shows the calendar names > cerr << (dynamic_cast(*it))->getCalendarName(); > } > > output= QString("Found %1 todos.").arg(count); > // count is 0 here, although I have like 20 todos in one calendar > return output; > > -- > Same behaviour shows on getEvents() and so on... > > Since documentation is...ehm... not very complete: > does anyone know what happens there? > > cheers, > > filip > > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > For debugging purpose you can create an empty file: /home/user/.calendar/log (reboot may necessary) This file indicates the calendar-backend to log ALL sql and results as syslog messages. Now you can see which sql and parameters are called for example to retrive all todos with "getTodos()" Btw pay attention, that methods like this one: (dynamic_cast(*it))->getTodos(error).size(); create a vector with dynamically allocated objects, and you have to free them. regards nicolai ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
calendar-backend API: CCalendar's entries empty
Hi all, I'd like to code a small Todo-list widget, which shows all due to-dos on the desktop. I started today, but I cannot access the to-dos because the CCalendar instances don't return any entries. I have 2 Calendars on my N900 and I get two calendar instances back, which is fine. They return the correct names and attributes, but are otherwise unresponsive. ;) so, for instance the following code returns 0 as to-do count: ... QString output; int count=0; int error; CMulticalendar* mcal = CMulticalendar::MCInstance(); vector cals = mcal->getListCalFromMc(); for(std::vector::iterator it = cals.begin(); it != cals.end(); ++it){ // here, I get those 2 calendars correctly // next line sums up to 0 all the time count += (dynamic_cast(*it))->getTodos(error).size(); // next line shows the calendar names cerr << (dynamic_cast(*it))->getCalendarName(); } output= QString("Found %1 todos.").arg(count); // count is 0 here, although I have like 20 todos in one calendar return output; -- Same behaviour shows on getEvents() and so on... Since documentation is...ehm... not very complete: does anyone know what happens there? cheers, filip ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
calendar backend, CMulticalendar and importIcsFileData
Hello. I am trying to understand how the calendar api works: http://maemo.org/api_refs/5.0/beta/calendar-backend/ I have several ical calendar exported from zimbra that i wish to import in a calendar on the n900. I manage to make something that seems to work (see attachement), but i realise i have a problem with at least one entry. In the zimbra ical output, the event starts the 17 of december at 10am GMY and ends at 11 am GMT. DTSTART;TZID="(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon / Lond on":20091217T10 DTEND;TZID="(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon / London ":20091217T11 I am based in France (GMT+1). If i look in this event once imported in the calendar, it is schedule for the 17 december, from 10am to 11 am instead of 11am to 12am. The events that were set on GMT+1 (as the following, wich is supposed to take place an hour before the previous one) are correctly set once imported. DTSTART;TZID="(GMT+01.00) Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna":20091217T10 DTEND;TZID="(GMT+01.00) Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna":20091217T11 Am i doing something wrong (like forgetting some option about timezone settings), or is this a bug i should open on bugzilla.maemo.org ? Aside from this, has anybody idea what is the difference between CMulticalendar::importIcsFileData and CMulticalendar::importIcsFileDataProgressive ? #include #include #include #include int get_target_cal_id(CMulticalendar *multical, std::string calname){ CCalendar *curcal; std::vector calvec = multical->getListCalFromMc (); int out=0; for ( size_t j = 0, size = calvec.size(); j < size; ++j ) { curcal=calvec[j]; if (curcal->getCalendarName () == calname){ out=curcal->getCalendarId (); } } multical->releaseListCalendars(calvec); return out; } int create_cal(CMulticalendar *multical,std::string calname){ cout <<"Creating calendar "<addCalendar( calname, COLOUR_RED, 0, 1, (CalendarType) 0, "whot", "whot", perror ); if(newcal==NULL) { cout << "Problem creating a new calendar: "<getCalendarId(); } int import_ical(CMulticalendar *multical,std::string filename,int cal_id) { cout <<"importing "<importIcsFileData( filename, cal_id, eventid, iDuplicateCountTask, iDuplicateCountEvent, iDuplicateCountJournal, perror ); cout<<"perror="<deleteCalendar(target_id,perror)) { cout<< "Problem deleting calendar error code="<< perror << "\n"; exit(1); } cout << "Deleting existing calendar "<getCalendarById(target_id,perror); if(perror!=CALENDAR_OPERATION_SUCCESSFUL){ cout <<"Error getting calendar by id. error="<___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
Hum ... and a python one ? 2009/6/13 Sebastian 'CrashandDie' Lauwers : > It is very easy to write C++ code that is usable by C compilers. > Considering there is apparently a notable demand for a C interface, > pushing for an enhancement request early in the project may be an > interesting thing to do. The code change is relatively minimal if > architectured correctly and would be beneficial to quite a few people > apparently. > > I'm not teaching any experienced coder anything new here, and I don't > mean to preach to the choir, but for future reference: > > #ifdef __cplusplus > extern "C" > #endif > int foobar(int i); > > http://developers.sun.com/solaris/articles/mixing.html#cpp_from_c > > > On 11/06/2009, Hubert Figuiere wrote: >> On 06/11/2009 05:01 PM, Jamie Bennett wrote: >>> Forgive my ignorance but is it 10x longer to compile or 10x increment >>> in speed? Compilation speed is a matter of grabbing two coffee's >>> instead of one, run time speed is a matter of giving up completely. >> >> C code compiled by g++ isn't slower or faster. It should be the same. >> (I'm talking runtime speed here) >> Just because there seems to be another myth being entertained. >> >> Hub >> ___ >> maemo-developers mailing list >> maemo-developers@maemo.org >> https://lists.maemo.org/mailman/listinfo/maemo-developers >> > > -- > Sent from my mobile device > > question = ( to ) ? be : ! be; > -- Wm. Shakespeare > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > > -- Benoît HERVIER - http://khertan.net/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
It is very easy to write C++ code that is usable by C compilers. Considering there is apparently a notable demand for a C interface, pushing for an enhancement request early in the project may be an interesting thing to do. The code change is relatively minimal if architectured correctly and would be beneficial to quite a few people apparently. I'm not teaching any experienced coder anything new here, and I don't mean to preach to the choir, but for future reference: #ifdef __cplusplus extern "C" #endif int foobar(int i); http://developers.sun.com/solaris/articles/mixing.html#cpp_from_c On 11/06/2009, Hubert Figuiere wrote: > On 06/11/2009 05:01 PM, Jamie Bennett wrote: >> Forgive my ignorance but is it 10x longer to compile or 10x increment >> in speed? Compilation speed is a matter of grabbing two coffee's >> instead of one, run time speed is a matter of giving up completely. > > C code compiled by g++ isn't slower or faster. It should be the same. > (I'm talking runtime speed here) > Just because there seems to be another myth being entertained. > > Hub > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > -- Sent from my mobile device question = ( to ) ? be : ! be; -- Wm. Shakespeare ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
On 06/11/2009 05:01 PM, Jamie Bennett wrote: > Forgive my ignorance but is it 10x longer to compile or 10x increment > in speed? Compilation speed is a matter of grabbing two coffee's > instead of one, run time speed is a matter of giving up completely. C code compiled by g++ isn't slower or faster. It should be the same. (I'm talking runtime speed here) Just because there seems to be another myth being entertained. Hub ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
heh Jamie, its 10x (might be slight exag) longer to compile. i normally make code changes and compile the 2 or 3 modules I've been working on. its quick and simple. with c++ even the simplest files are slow. its like waiting for visual studio to run, an age. and my method of on device compilation is FASTER for normal day to day coding than scratchbox and copy and execute :) its got obvious serious drawbacks tho lol gary On Thu, Jun 11, 2009 at 10:01 PM, Jamie Bennett wrote: > > On 11 Jun 2009, at 21:08, gary liquid wrote: > >> Hubert, >> >> Compiling my pure C in a C++ compiler is indeed possible. >> However, it takes 10x longer on my tablet to compile even simple >> programs using a c++ compiler. >> >> I don't mind if the libs aren't available, it was just a nicety for me >> - there will be other libraries that are usable as required I am sure. > > Forgive my ignorance but is it 10x longer to compile or 10x increment in > speed? Compilation speed is a matter of grabbing two coffee's instead of > one, run time speed is a matter of giving up completely. (oh and compiling > on the tablet is so 1980's ;) ) > >> Gary > > Regards, > Jamie. > -- > http://www.linuxuk.org > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
On 11 Jun 2009, at 21:08, gary liquid wrote: > Hubert, > > Compiling my pure C in a C++ compiler is indeed possible. > However, it takes 10x longer on my tablet to compile even simple > programs using a c++ compiler. > > I don't mind if the libs aren't available, it was just a nicety for me > - there will be other libraries that are usable as required I am sure. Forgive my ignorance but is it 10x longer to compile or 10x increment in speed? Compilation speed is a matter of grabbing two coffee's instead of one, run time speed is a matter of giving up completely. (oh and compiling on the tablet is so 1980's ;) ) > Gary Regards, Jamie. -- http://www.linuxuk.org ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
Hubert, Compiling my pure C in a C++ compiler is indeed possible. However, it takes 10x longer on my tablet to compile even simple programs using a c++ compiler. I don't mind if the libs aren't available, it was just a nicety for me - there will be other libraries that are usable as required I am sure. Gary On Thu, Jun 11, 2009 at 5:15 PM, Hubert Figuiere wrote: > On 06/10/2009 07:32 AM, Sampo Savola wrote: >> There seems to be only C++ interface for this. > > >> How should this be used in C application, >> is there going to be C interface also? > > You can mix C and C++ easily. You can recompile your C code with a C++ > compiler[1]. > > > Hub > > [1] possibly with a few changes that will keep the code compilable with > a C compiler. This was part of the C++ design. > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
On 11 Jun 2009, at 17:15, Hubert Figuiere wrote: > On 06/10/2009 07:32 AM, Sampo Savola wrote: >> There seems to be only C++ interface for this. >> >> How should this be used in C application, >> is there going to be C interface also? > > You can mix C and C++ easily. You can recompile your C code with a C++ > compiler[1]. Anyway, C is a just a C++ revolutionists realization of a programming language. Some day they will come back and say, what was I thinking. Hey I should print that on a t-shirt. > Hub Regards, Jamie. -- http://www.linuxuk.org ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
On 06/10/2009 07:32 AM, Sampo Savola wrote: > There seems to be only C++ interface for this. > > How should this be used in C application, > is there going to be C interface also? You can mix C and C++ easily. You can recompile your C code with a C++ compiler[1]. Hub [1] possibly with a few changes that will keep the code compilable with a C compiler. This was part of the C++ design. ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
Hello! I asked the guys responsible for calendar area.. seems that having a C API is not very likely. Adding Ilias in CC who is the owner of this area. -Soumya On Wed, 2009-06-10 at 13:36 +0200, ext gary liquid wrote: > Sampo, > > I would also be interested in a C api to the same calendar backend. > Obviously my calendar is very simplistic and sketch based, but it > would be of obvious benefit to allow system calendar entries to be > visible there :) > > > Gary > > > > On Wed, Jun 10, 2009 at 12:32 PM, Sampo Savola wrote: > > Hey > > > > With Fremantle beta sdk there comes this, calendar-backend : > > http://maemo.org/api_refs/5.0/beta/calendar-backend/ > > > > There seems to be only C++ interface for this. > > > > How should this be used in C application, > > is there going to be C interface also? > > > > //Sampo > > > > ___ > > maemo-developers mailing list > > maemo-developers@maemo.org > > https://lists.maemo.org/mailman/listinfo/maemo-developers > > > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: calendar-backend
Sampo, I would also be interested in a C api to the same calendar backend. Obviously my calendar is very simplistic and sketch based, but it would be of obvious benefit to allow system calendar entries to be visible there :) Gary On Wed, Jun 10, 2009 at 12:32 PM, Sampo Savola wrote: > Hey > > With Fremantle beta sdk there comes this, calendar-backend : > http://maemo.org/api_refs/5.0/beta/calendar-backend/ > > There seems to be only C++ interface for this. > > How should this be used in C application, > is there going to be C interface also? > > //Sampo > > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
calendar-backend
Hey With Fremantle beta sdk there comes this, calendar-backend : http://maemo.org/api_refs/5.0/beta/calendar-backend/ There seems to be only C++ interface for this. How should this be used in C application, is there going to be C interface also? //Sampo ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers