CVS commit by staniek: - magic data is now defined for application/x-sqliteX, not for application/x-kexiproject-sqliteX (X == 2 or 3) - file-based drivers can now define a list of supported mimetypes, not just one mime type (added all known mimetypes thee, including Knoda's mimes, for compatibility) M +2 -2 data/kexi.magic 1.4.2.1 M +13 -3 kexidb/drivermanager.cpp 1.32.2.1 M +3 -0 kexidb/kexidb_driver.desktop 1.27.2.1 M +1 -1 kexidb/drivers/sqlite/kexidb_sqlite3driver.desktop 1.13.2.1 M +1 -1 kexidb/drivers/sqlite2/kexidb_sqlite2driver.desktop 1.13.2.1 --- koffice/kexi/kexidb/drivermanager.cpp #1.32:1.32.2.1 @@ -2,5 +2,5 @@ Daniel Molkentin Joseph Wenninger - Copyright (C) 2003-2004 Jaroslaw Staniek + Copyright (C) 2003-2005 Jaroslaw Staniek This program is free software; you can redistribute it and/or @@ -141,8 +141,18 @@ bool DriverManagerInternal::lookupDriver } - QString mime = ptr->property("X-Kexi-FileDBDriverMime").toString().lower(); QString drvType = ptr->property("X-Kexi-DriverType").toString().lower(); if (drvType=="file") { - if (!mime.isEmpty()) { + //new property: a list of supported mime types + QStringList mimes( ptr->property("X-Kexi-FileDBDriverMimeList").toStringList() ); + //single mime is obsolete, but we're handling it: + { + QString mime( ptr->property("X-Kexi-FileDBDriverMime").toString().lower() ); + if (!mime.isEmpty()) + mimes.append( mime ); + } + + //store association of this driver with all listed mime types + for (QStringList::ConstIterator mime_it = mimes.constBegin(); mime_it!=mimes.constEnd(); ++mime_it) { + QString mime( (*mime_it).lower() ); if (!m_services_by_mimetype.contains(mime)) { m_services_by_mimetype.insert(mime, ptr); --- koffice/kexi/kexidb/kexidb_driver.desktop #1.27:1.27.2.1 @@ -45,4 +45,7 @@ Type=QString +[PropertyDef::X-Kexi-FileDBDriverMimeList] +Type=QStringList + [PropertyDef::X-Kexi-DriverName] Type=QString --- koffice/kexi/kexidb/drivers/sqlite/kexidb_sqlite3driver.desktop #1.13:1.13.2.1 @@ -39,4 +39,4 @@ X-Kexi-DriverName=SQLite3 X-Kexi-DriverType=File -X-Kexi-FileDBDriverMime=application/x-kexiproject-sqlite3 +X-Kexi-FileDBDriverMimeList=application/x-kexiproject-sqlite3,application/x-kexiproject-sqlite3,application/x-hk_classes-sqlite3 X-Kexi-KexiDBVersion=1.5 --- koffice/kexi/kexidb/drivers/sqlite2/kexidb_sqlite2driver.desktop #1.13:1.13.2.1 @@ -39,4 +39,4 @@ X-Kexi-DriverName=SQLite2 X-Kexi-DriverType=File -X-Kexi-FileDBDriverMime=application/x-kexiproject-sqlite2 +X-Kexi-FileDBDriverMimeList=application/x-kexiproject-sqlite2,application/x-kexiproject-sqlite2,application/x-kexiproject-sqlite,application/x-hk_classes-sqlite2 X-Kexi-KexiDBVersion=1.5 --- koffice/kexi/data/kexi.magic #1.4:1.4.2.1 @@ -1,2 +1,2 @@ -0 string **\ This\ file\ contains\ an\ SQLite application/x-kexiproject-sqlite2 -0 string SQLite\ format\ 3 application/x-kexiproject-sqlite3 +0 string **\ This\ file\ contains\ an\ SQLite application/x-sqlite2 +0 string SQLite\ format\ 3 application/x-sqlite3