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
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