[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/koffice/1.5/koffice/lib/kofficecore
From:       David Faure <faure () kde ! org>
Date:       2006-06-16 17:15:27
Message-ID: 1150478127.513008.12922.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 552122 by dfaure:

Tell developers when they forget to install service types.


 M  +9 -1      KoDocument.cpp  


--- branches/koffice/1.5/koffice/lib/kofficecore/KoDocument.cpp #552121:552122
@@ -2170,7 +2170,15 @@
     KService::Ptr service = const_cast<KoDocument *>(this)->nativeService();
     if ( !service )
         return QCString();
-    return service->property( "X-KDE-NativeMimeType" ).toString().latin1();
+    QCString nativeMimeType = service->property( "X-KDE-NativeMimeType" ).toString().latin1();
+    if ( nativeMimeType.isEmpty() ) {
+        // shouldn't happen, let's find out why it happened
+        if ( !service->serviceTypes().contains( "KOfficePart" ) )
+            kdWarning(30003) << "Wrong desktop file, KOfficePart isn't mentionned" << endl;
+        else if ( !KServiceType::serviceType( "KOfficePart" ) )
+            kdWarning(30003) << "The KOfficePart service type isn't installed!" << endl;
+    }
+    return nativeMimeType;
 }
 
 QCString KoDocument::nativeOasisMimeType() const
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic