File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ struct PluginEntry: Identifiable {
1616 let pluginDescription : String
1717 let capabilities : [ PluginCapability ]
1818 var isEnabled : Bool
19+
20+ let databaseTypeId : String ?
21+ let additionalTypeIds : [ String ]
22+ let pluginIconName : String
23+ let defaultPort : Int ?
1924}
2025
2126enum PluginSource {
@@ -24,26 +29,6 @@ enum PluginSource {
2429}
2530
2631extension PluginEntry {
27- var driverPlugin : ( any DriverPlugin . Type ) ? {
28- bundle. principalClass as? any DriverPlugin . Type
29- }
30-
31- var iconName : String {
32- driverPlugin? . iconName ?? " puzzlepiece "
33- }
34-
35- var databaseTypeId : String ? {
36- driverPlugin? . databaseTypeId
37- }
38-
39- var additionalTypeIds : [ String ] {
40- driverPlugin? . additionalDatabaseTypeIds ?? [ ]
41- }
42-
43- var defaultPort : Int ? {
44- driverPlugin? . defaultPort
45- }
46-
4732 var exportPlugin : ( any ExportFormatPlugin . Type ) ? {
4833 bundle. principalClass as? any ExportFormatPlugin . Type
4934 }
Original file line number Diff line number Diff line change @@ -828,8 +828,7 @@ struct ConnectionFormView: View { // swiftlint:disable:this type_body_length
828828 }
829829
830830 private var filePathPrompt : String {
831- let extensions = PluginManager . shared. driverPlugin ( for: type)
832- . map { Swift . type ( of: $0) . fileExtensions } ?? [ ]
831+ let extensions = PluginManager . shared. fileExtensions ( for: type)
833832 let ext = ( extensions. first ?? " db " )
834833 . trimmingCharacters ( in: CharacterSet ( charactersIn: " . " ) )
835834 guard !ext. isEmpty else { return " /path/to/database.db " }
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ struct InstalledPluginsView: View {
146146 @ViewBuilder
147147 private func pluginRow( _ plugin: PluginEntry ) -> some View {
148148 HStack ( spacing: 8 ) {
149- PluginIconView ( name: plugin. iconName )
149+ PluginIconView ( name: plugin. pluginIconName )
150150 . font ( . title3)
151151 . frame ( width: 24 , height: 24 )
152152 . foregroundStyle ( plugin. isEnabled ? . secondary : . tertiary)
You can’t perform that action at this time.
0 commit comments