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);
TDEABC::StdAddressBook::setAutomaticSave(false);
TQPtrList<Resource> lit = kab->resources();
TQPtrListIterator<Resource> it( lit );
Resource *res;
while ( (res = it.current()) != 0 ) {
++it;
debug() << "SUB RES ID :" << res->identifier() <<
"\n";
}
but I get
std-test.cc: In function ‘int main(int, char**)’:
std-test.cc:72:38: error: invalid use of incomplete type ‘class
TDEABC::Resource’
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,
from std-test.cc:7:
/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,
from std-test.cc:3:
/usr/include/tqt3/ntqptrlist.h: In instantiation of ‘void
TQPtrList<type>::deleteItem(TQPtrCollection::Item) [with type =
TDEABC::Resource; TQPtrCollection::Item = void*]’:
std-test.cc:92:1: 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;
^
Show replies by date
deloptes wrote:
but I get
std-test.cc: In function ‘int main(int, char**)’:
std-test.cc:72:38: error: invalid use of incomplete type ‘class
TDEABC::Resource’
debug() << "SUB RES ID :" << res->identifier() <<
"\n";
^
I had to #include <tdeabc/resource.h>
So simple ... :D
regards