Message: previous - next
Month: January 2016

iteration over ABC ressources

From: deloptes <deloptes@...>
Date: Sun, 31 Jan 2016 16:29:55 +0100
Hi all,

could you please help a bit.

I try to iterate over resources in address book, but fail so far.

using namespace TDEABC;

AddressBook* kab = TDEABC::StdAddressBook::self(false); 

TQPtrList<Resource> lit = kab->resources();
TQPtrListIterator<Resource> it( lit );
Resource *res;
while ( (res = it.current()) != 0 ) {
    debug() << "SUB RES ID  :" << res->identifier() << "\n";

but I get In function ‘int main(int, char**)’: error: invalid use of incomplete type ‘class
     debug() << "SUB RES ID  :" << res->identifier() << "\n";
In file included from /opt/trinity/include/tdeabc/addressbook.h:29:0,
                 from /opt/trinity/include/tdeabc/stdaddressbook.h:24,
/opt/trinity/include/tdeabc/addressee.h:45:7: error: forward declaration
of ‘class TDEABC::Resource’
 class Resource;
In file included from /usr/include/tqt3/ntqstrlist.h:46:0,
                 from /usr/include/tqt3/ntqstringlist.h:47,
                 from /usr/include/tqt3/ntqcolor.h:46,
                 from /usr/include/tqt3/ntqpalette.h:46,
                 from /usr/include/tqt3/ntqwidget.h:48,
                 from /usr/include/tqt3/ntqdesktopwidget.h:43,
                 from /usr/include/tqt3/ntqapplication.h:45,
                 from /usr/include/tqt/tqapplication.h:33,
                 from /opt/trinity/include/tdeapplication.h:40,
/usr/include/tqt3/ntqptrlist.h: In instantiation of ‘void
TQPtrList<type>::deleteItem(TQPtrCollection::Item) [with type =
TDEABC::Resource; TQPtrCollection::Item = void*]’:   required from here
/usr/include/tqt3/ntqptrlist.h:153:21: warning: possible problem detected in
invocation of delete operator: [-Wdelete-incomplete]
     if ( del_item ) delete (type *)d;