[Uml-devel] KDE/kdesdk

David Faure faure at kde.org
Wed Mar 21 09:41:20 UTC 2007


SVN commit 644914 by dfaure:

Use standard mimetype names.
KBabel, if it is to stay, probably needs some fixes to be able to open .pot files (text/x-gettext-translation-template) in addition to .po files (text/x-gettext-translation).


 M  +1 -1      kate/app/katemwmodonhddialog.cpp  
 M  +1 -1      kbabel/addons/kfile-plugins/kfile_po.cpp  
 M  +2 -2      kbabel/common/catalog.cpp  
 M  +1 -1      kbabel/common/kbmailer.cpp  
 M  +2 -2      kbabel/filters/gettext/gettextexport.cpp  
 M  +3 -3      kbabel/filters/gettext/gettextimport.cpp  
 M  +1 -1      kbabel/kbabel/kbabelview2.cpp  
 M  +1 -1      kfile-plugins/diff/kfile_diff.cpp  
 M  +2 -2      kompare/kompare_shell.cpp  
 M  +1 -1      kompare/libdiff2/komparemodellist.cpp  
 M  +3 -3      umbrello/umbrello/umldoc.cpp  
 M  +8 -8      umbrello/umbrello/umlviewimageexportermodel.cpp  


--- trunk/KDE/kdesdk/kate/app/katemwmodonhddialog.cpp #644913:644914
@@ -300,7 +300,7 @@
     return;
   }
 
-  KRun::runUrl( m_tmpfile->fileName(), "text/x-diff", this, true );
+  KRun::runUrl( m_tmpfile->fileName(), "text/x-patch", this, true );
   delete m_tmpfile;
   m_tmpfile = 0;
 }
--- trunk/KDE/kdesdk/kbabel/addons/kfile-plugins/kfile_po.cpp #644913:644914
@@ -44,7 +44,7 @@
                      const QStringList& args)
   : KFilePlugin(parent, args)
 {
-  KFileMimeTypeInfo* info = addMimeTypeInfo("application/x-gettext");
+  KFileMimeTypeInfo* info = addMimeTypeInfo("text/x-gettext-translation");
 
   KFileMimeTypeInfo::GroupInfo* group =
     addGroupInfo(info, "CatalogInfo", i18n("Catalog Information"));
--- trunk/KDE/kdesdk/kbabel/common/catalog.cpp #644913:644914
@@ -898,7 +898,7 @@
        if( !ptr )
        {
     	    kDebug(KBABEL) << "No plugin for this type, will try PO" << endl;
-    	    offers =  KServiceTypeTrader::self()->query("KBabelFilter", "('application/x-gettext' in [X-KDE-Import])");
+    	    offers =  KServiceTypeTrader::self()->query("KBabelFilter", "('text/x-gettext-translation' in [X-KDE-Import])");
     	    ptr = offers.first();
     	    if( !ptr )
 	    {
@@ -1100,7 +1100,7 @@
 
 Msgfmt::Status Catalog::checkSyntax(QString& output, bool clearErrors)
 {
-   if( !d->_mimeTypes.contains( "application/x-gettext" ) )
+   if( !d->_mimeTypes.contains( "text/x-gettext-translation" ) )
 	return Msgfmt::Unsupported;
 
    KTemporaryFile tempFile; // for use when we have a non-local file
--- trunk/KDE/kdesdk/kbabel/common/kbmailer.cpp #644913:644914
@@ -154,7 +154,7 @@
   QString mimetype;
   if (bzipCompression) {
     archiveName += ".tar.bz2";
-    mimetype = "application/x-bzip2";
+    mimetype = "application/x-bzip";
   } else {
     archiveName += ".tar.gz";
     mimetype = "application/x-gzip";
--- trunk/KDE/kdesdk/kbabel/filters/gettext/gettextexport.cpp #644913:644914
@@ -64,8 +64,8 @@
    if( catalog->importPluginID() != "GNU gettext") 
       return UNSUPPORTED_TYPE;
 
-   // we support on the application/x-gettext MIME type
-   if( mimetype != "application/x-gettext") 
+   // we support on the text/x-gettext-translation MIME type
+   if( mimetype != "text/x-gettext-translation") 
       return UNSUPPORTED_TYPE;
 
    QFile file(localFile);
--- trunk/KDE/kdesdk/kbabel/filters/gettext/gettextimport.cpp #644913:644914
@@ -46,8 +46,8 @@
 #include <QList>
 #include <QTextStream>
 #include <QEventLoop>
+#include <QApplication>
 
-#include <kapplication.h>
 #include <kdebug.h>
 #include <kgenericfactory.h>
 #include <klocale.h>
@@ -176,7 +176,7 @@
    	
    while( !stream.atEnd() )
    {
-      kapp->processEvents(QEventLoop::AllEvents, 10);
+      qApp->processEvents(QEventLoop::AllEvents, 10);
       if( isStopped() )
       {
          return STOPPED;
@@ -273,7 +273,7 @@
    else
       setFileCodec(0);
    
-   setMimeTypes( "application/x-gettext" );
+   setMimeTypes( "text/x-gettext-translation" );
 
    if ( recoveredErrorInHeader )
    {
--- trunk/KDE/kdesdk/kbabel/kbabel/kbabelview2.cpp #644913:644914
@@ -728,7 +728,7 @@
     if(url.isEmpty())
     {
         url = KFileDialog::getOpenUrl(_project->settings()->diffBaseDir(), 
-"application/x-gettext", this, i18n("Select File to Diff With"));
+"text/x-gettext-translation", this, i18n("Select File to Diff With"));
     }
 
     if(url.isEmpty())
--- trunk/KDE/kdesdk/kfile-plugins/diff/kfile_diff.cpp #644913:644914
@@ -52,7 +52,7 @@
 {
 	kDebug(7034) << "diff plugin" << endl;
 
-	KFileMimeTypeInfo* info = addMimeTypeInfo( "text/x-diff" );
+	KFileMimeTypeInfo* info = addMimeTypeInfo( "text/x-patch" );
 
 	KFileMimeTypeInfo::GroupInfo* group;
 	group = addGroupInfo( info, "General", i18n( "General" ) );
--- trunk/KDE/kdesdk/kompare/kompare_shell.cpp #644913:644914
@@ -65,7 +65,7 @@
 	setupActions();
 	setupStatusBar();
 
-	KService::List offers = KMimeTypeTrader::self()->query( "text/x-diff",
+	KService::List offers = KMimeTypeTrader::self()->query( "text/x-patch",
                                                             "Kompare/ViewPart",
                                                              QString::null );
 #ifdef NDEBUG
@@ -366,7 +366,7 @@
 void KompareShell::slotFileOpen()
 {
 	// FIXME: use different filedialog which gets encoding
-	KUrl url = KFileDialog::getOpenUrl( KUrl(), "text/x-diff", this );
+	KUrl url = KFileDialog::getOpenUrl( KUrl(), "text/x-patch", this );
 	if( !url.isEmpty() ) {
 		KompareShell* shell = new KompareShell();
 		KGlobal::ref();
--- trunk/KDE/kdesdk/kompare/libdiff2/komparemodellist.cpp #644913:644914
@@ -106,7 +106,7 @@
 
 bool KompareModelList::isDiff( const QString& mimeType ) const
 {
-	if ( mimeType == "text/x-diff" )
+	if ( mimeType == "text/x-patch" )
 		return true;
 	else
 		return false;
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp #644913:644914
@@ -374,7 +374,7 @@
     {
         mimetype = "application/x-gzip";
     } else if (filetype.find(QRegExp("\\.tar.bz2$")) != -1) {
-        mimetype = "application/x-bzip2";
+        mimetype = "application/x-bzip";
     }
 
     if (mimetype.isEmpty() == false)
@@ -544,14 +544,14 @@
             {
                 archive = new KTar(d.path(), "application/x-gzip");
             } else {
-                archive = new KTar(d.path(), "application/x-bzip2");
+                archive = new KTar(d.path(), "application/x-bzip");
             }
         } else {
             if (fileFormat == "tgz") // check tgz or bzip2
             {
                 archive = new KTar(tmp_tgz_file.fileName(), "application/x-gzip");
             } else {
-                archive = new KTar(tmp_tgz_file.fileName(), "application/x-bzip2");
+                archive = new KTar(tmp_tgz_file.fileName(), "application/x-bzip");
             }
         }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/umlviewimageexportermodel.cpp #644913:644914
@@ -73,28 +73,28 @@
 
 QString UMLViewImageExporterModel::imageTypeToMimeType(const QString& imageType) {
     const QString imgType = imageType.lower();
-    if (QString("bmp") == imgType) return "image/x-bmp";
+    if (QString("bmp") == imgType) return "image/bmp";
     if (QString("jpeg") == imgType) return "image/jpeg";
     if (QString("pbm") == imgType) return "image/x-portable-bitmap";
-    if (QString("pgm") == imgType) return "image/x-portable-greymap";
+    if (QString("pgm") == imgType) return "image/x-portable-graymap";
     if (QString("png") == imgType) return "image/png";
     if (QString("ppm") == imgType) return "image/x-portable-pixmap";
-    if (QString("xbm") == imgType) return "image/x-xbm";
-    if (QString("xpm") == imgType) return "image/x-xpm";
+    if (QString("xbm") == imgType) return "image/x-xbitmap";
+    if (QString("xpm") == imgType) return "image/x-xpixmap";
     if (QString("eps") == imgType) return "image/x-eps";
     if (QString("svg") == imgType) return "image/svg+xml";
     return QString();
 }
 
 QString UMLViewImageExporterModel::mimeTypeToImageType(const QString& mimeType) {
-    if (QString("image/x-bmp") == mimeType) return "bmp";
+    if (QString("image/bmp") == mimeType) return "bmp";
     if (QString("image/jpeg") == mimeType) return "jpeg";
     if (QString("image/x-portable-bitmap") == mimeType) return "pbm";
-    if (QString("image/x-portable-greymap") == mimeType) return "pgm";
+    if (QString("image/x-portable-graymap") == mimeType) return "pgm";
     if (QString("image/png") == mimeType) return "png";
     if (QString("image/x-portable-pixmap") == mimeType) return "ppm";
-    if (QString("image/x-xbm") == mimeType) return "xbm";
-    if (QString("image/x-xpm") == mimeType) return "xpm";
+    if (QString("image/x-xbitmap") == mimeType) return "xbm";
+    if (QString("image/x-xpixmap") == mimeType) return "xpm";
     if (QString("image/x-eps") == mimeType) return "eps";
     if (QString("image/svg+xml") == mimeType) return "svg";
     return QString();




More information about the umbrello-devel mailing list