Diffstat (limited to 'noncore/apps/opie-console/metafactory.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/metafactory.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp index 4501ec2..02a9f9b 100644 --- a/noncore/apps/opie-console/metafactory.cpp +++ b/noncore/apps/opie-console/metafactory.cpp | |||
@@ -21,24 +21,30 @@ void MetaFactory::addTerminalWidgetFactory( const QCString& name, | |||
21 | void MetaFactory::addIOLayerFactory( const QCString& name, | 21 | void MetaFactory::addIOLayerFactory( const QCString& name, |
22 | const QString& str, | 22 | const QString& str, |
23 | iolayer lay) { | 23 | iolayer lay) { |
24 | m_strings.insert( str, name ); | 24 | m_strings.insert( str, name ); |
25 | m_layerFact.insert( str, lay ); | 25 | m_layerFact.insert( str, lay ); |
26 | } | 26 | } |
27 | void MetaFactory::addFileTransferLayer( const QCString& name, | 27 | void MetaFactory::addFileTransferLayer( const QCString& name, |
28 | const QString& str, | 28 | const QString& str, |
29 | filelayer lay) { | 29 | filelayer lay) { |
30 | m_strings.insert(str, name ); | 30 | m_strings.insert(str, name ); |
31 | m_fileFact.insert( str, lay ); | 31 | m_fileFact.insert( str, lay ); |
32 | } | 32 | } |
33 | void MetaFactory::addEmulationLayer( const QCString& name, | ||
34 | const QString& str, | ||
35 | emulationLayer em) { | ||
36 | m_strings.insert(str, name ); | ||
37 | m_emu.insert( str, em ); | ||
38 | } | ||
33 | QStringList MetaFactory::ioLayers()const { | 39 | QStringList MetaFactory::ioLayers()const { |
34 | QStringList list; | 40 | QStringList list; |
35 | QMap<QString, iolayer>::ConstIterator it; | 41 | QMap<QString, iolayer>::ConstIterator it; |
36 | for (it = m_layerFact.begin(); it != m_layerFact.end(); ++it ) { | 42 | for (it = m_layerFact.begin(); it != m_layerFact.end(); ++it ) { |
37 | list << it.key(); | 43 | list << it.key(); |
38 | } | 44 | } |
39 | return list; | 45 | return list; |
40 | } | 46 | } |
41 | QStringList MetaFactory::connectionWidgets()const { | 47 | QStringList MetaFactory::connectionWidgets()const { |
42 | QStringList list; | 48 | QStringList list; |
43 | QMap<QString, configWidget>::ConstIterator it; | 49 | QMap<QString, configWidget>::ConstIterator it; |
44 | for ( it = m_conFact.begin(); it != m_conFact.end(); ++it ) { | 50 | for ( it = m_conFact.begin(); it != m_conFact.end(); ++it ) { |
@@ -53,24 +59,32 @@ QStringList MetaFactory::terminalWidgets()const { | |||
53 | list << it.key(); | 59 | list << it.key(); |
54 | } | 60 | } |
55 | return list; | 61 | return list; |
56 | } | 62 | } |
57 | QStringList MetaFactory::fileTransferLayers()const { | 63 | QStringList MetaFactory::fileTransferLayers()const { |
58 | QStringList list; | 64 | QStringList list; |
59 | QMap<QString, filelayer>::ConstIterator it; | 65 | QMap<QString, filelayer>::ConstIterator it; |
60 | for ( it = m_fileFact.begin(); it != m_fileFact.end(); ++it ) { | 66 | for ( it = m_fileFact.begin(); it != m_fileFact.end(); ++it ) { |
61 | list << it.key(); | 67 | list << it.key(); |
62 | } | 68 | } |
63 | return list; | 69 | return list; |
64 | } | 70 | } |
71 | QStringList MetaFactory::emulationLayers()const { | ||
72 | QStringList list; | ||
73 | QMap<QString, emulationLayer>::ConstIterator it; | ||
74 | for ( it = m_emu.begin(); it != m_emu.end(); ++it ) { | ||
75 | list << it.key(); | ||
76 | } | ||
77 | return list; | ||
78 | } | ||
65 | 79 | ||
66 | IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { | 80 | IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { |
67 | IOLayer* lay = 0l; | 81 | IOLayer* lay = 0l; |
68 | 82 | ||
69 | QMap<QString, iolayer>::Iterator it; | 83 | QMap<QString, iolayer>::Iterator it; |
70 | it = m_layerFact.find( str ); | 84 | it = m_layerFact.find( str ); |
71 | if ( it != m_layerFact.end() ) { | 85 | if ( it != m_layerFact.end() ) { |
72 | lay = (*(it.data()))(prof); | 86 | lay = (*(it.data()))(prof); |
73 | /* | 87 | /* |
74 | iolayer laye = it.data(); | 88 | iolayer laye = it.data(); |
75 | lay = (*laye )(conf);*/ | 89 | lay = (*laye )(conf);*/ |
76 | } | 90 | } |
@@ -92,23 +106,34 @@ ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget | |||
92 | if (str.isEmpty() ) | 106 | if (str.isEmpty() ) |
93 | return 0l; | 107 | return 0l; |
94 | ProfileDialogWidget* wid = 0l; | 108 | ProfileDialogWidget* wid = 0l; |
95 | qWarning("new terminalPlugin %s %l", str.latin1(), parent ); | 109 | qWarning("new terminalPlugin %s %l", str.latin1(), parent ); |
96 | 110 | ||
97 | QMap<QString, configWidget>::Iterator it; | 111 | QMap<QString, configWidget>::Iterator it; |
98 | it = m_termFact.find( str ); | 112 | it = m_termFact.find( str ); |
99 | if ( it != m_termFact.end() ) { | 113 | if ( it != m_termFact.end() ) { |
100 | wid = (*(it.data() ) )(str,parent); | 114 | wid = (*(it.data() ) )(str,parent); |
101 | } | 115 | } |
102 | return wid; | 116 | return wid; |
103 | } | 117 | } |
118 | EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, Widget* wid) { | ||
119 | EmulationLayer* lay = 0l; | ||
120 | |||
121 | QMap<QString, emulationLayer>::Iterator it; | ||
122 | it = m_emu.find( str ); | ||
123 | if ( it != m_emu.end() ) { | ||
124 | lay = (*(it.data() ) )(wid); | ||
125 | } | ||
126 | |||
127 | return lay; | ||
128 | } | ||
104 | QCString MetaFactory::internal( const QString& str )const { | 129 | QCString MetaFactory::internal( const QString& str )const { |
105 | return m_strings[str]; | 130 | return m_strings[str]; |
106 | } | 131 | } |
107 | QString MetaFactory::external( const QCString& str )const { | 132 | QString MetaFactory::external( const QCString& str )const { |
108 | QMap<QString, QCString>::ConstIterator it; | 133 | QMap<QString, QCString>::ConstIterator it; |
109 | for ( it = m_strings.begin(); it != m_strings.end(); ++it ) { | 134 | for ( it = m_strings.begin(); it != m_strings.end(); ++it ) { |
110 | if ( it.data() == str ) | 135 | if ( it.data() == str ) |
111 | return it.key(); | 136 | return it.key(); |
112 | } | 137 | } |
113 | return QString::null; | 138 | return QString::null; |
114 | } | 139 | } |