tdemimelist.cpp
00001 #include <ktrader.h> 00002 #include <kservice.h> 00003 #include <kmimetype.h> 00004 #include <assert.h> 00005 #include <kstandarddirs.h> 00006 #include <kservicegroup.h> 00007 #include <kimageio.h> 00008 #include <kuserprofile.h> 00009 #include <kprotocolinfo.h> 00010 00011 #include <tdeapplication.h> 00012 00013 #include <stdio.h> 00014 00015 int main(int argc, char *argv[]) 00016 { 00017 TDEApplication k(argc,argv,"blurb",false); 00018 00019 KMimeType::List mtl = KMimeType::allMimeTypes( ); 00020 assert( mtl.count() ); 00021 tqDebug( "Found %d mime types.", mtl.count() ); 00022 TQValueListIterator<KMimeType::Ptr> it(mtl.begin()); 00023 KServiceTypeProfile::OfferList ol; 00024 00025 for (; it != mtl.end(); ++it) 00026 { 00027 { 00028 // Application 00029 printf( "APP:%s:", (*it)->name().latin1() ); 00030 ol = KServiceTypeProfile::offers((*it)->name(), "Application"); 00031 TQValueListIterator<KServiceOffer> it2(ol.begin()); 00032 for (; it2 != ol.end(); ++it2) { 00033 if ((*it2).allowAsDefault()) 00034 printf( " %s", (*it2).service()->desktopEntryPath().ascii() ); 00035 00036 } 00037 printf( "\n" ); 00038 } 00039 00040 { 00041 // Embedded 00042 printf( "PART:%s:", (*it)->name().latin1() ); 00043 ol = KServiceTypeProfile::offers((*it)->name(), "KParts/ReadOnlyPart"); 00044 TQValueListIterator<KServiceOffer> it2(ol.begin()); 00045 for (; it2 != ol.end(); ++it2) { 00046 if ((*it2).allowAsDefault()) 00047 printf( " %s", (*it2).service()->desktopEntryPath().ascii() ); 00048 00049 } 00050 printf( "\n" ); 00051 } 00052 } 00053 } 00054