TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getalltest.cpp 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include <kservice.h>
  2. #include <kmimetype.h>
  3. #include <kservicetype.h>
  4. #include <tdeapplication.h>
  5. #include <kdebug.h>
  6. int main(int argc, char *argv[])
  7. {
  8. TDEApplication k(argc,argv,"getalltest",false/*nostyle*/,false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption
  9. //for (int i = 0 ; i < 2 ; ++i ) { // test twice to see if they got deleted
  10. kdDebug() << "All services" << endl;
  11. KService::List services = KService::allServices();
  12. kdDebug() << "got " << services.count() << " services" << endl;
  13. TQValueListIterator<KService::Ptr> s = services.begin();
  14. for ( ; s != services.end() ; ++s )
  15. {
  16. kdDebug() << (*s)->name() << " " << (*s)->desktopEntryPath() << endl;
  17. }
  18. //}
  19. kdDebug() << "All mimeTypes" << endl;
  20. KMimeType::List mimeTypes = KMimeType::allMimeTypes();
  21. kdDebug() << "got " << mimeTypes.count() << " mimeTypes" << endl;
  22. TQValueListIterator<KMimeType::Ptr> m = mimeTypes.begin();
  23. for ( ; m != mimeTypes.end() ; ++m )
  24. {
  25. kdDebug() << (*m)->name() << endl;
  26. }
  27. kdDebug() << "All service types" << endl;
  28. KServiceType::List list = KServiceType::allServiceTypes();
  29. kdDebug() << "got " << list.count() << " service types" << endl;
  30. TQValueListIterator<KServiceType::Ptr> st = list.begin();
  31. for ( ; st != list.end() ; ++st )
  32. {
  33. kdDebug() << (*st)->name() << endl;
  34. }
  35. kdDebug() << "done" << endl;
  36. return 0;
  37. }