summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/factory.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index 5fbfa68..4843ce0 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -109,64 +109,77 @@ Factory::Factory( const QString& resourceFamily) :
109 info = new PluginInfo; 109 info = new PluginInfo;
110 info->library = libname; 110 info->library = libname;
111 info->nameLabel = i18n( "opie" ); 111 info->nameLabel = i18n( "opie" );
112 info->descriptionLabel = i18n( "Opie PIM Addressbook." ); 112 info->descriptionLabel = i18n( "Opie PIM Addressbook." );
113 mTypeMap.insert( "opie", info ); 113 mTypeMap.insert( "opie", info );
114 } 114 }
115 */ 115 */
116 //US add qtopia plugin only, if the library exists. 116 //US add qtopia plugin only, if the library exists.
117 QString libname = "microkabc_qtopia"; 117 QString libname = "microkabc_qtopia";
118 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 118 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
119 if ( !path.isEmpty() ) 119 if ( !path.isEmpty() )
120 { 120 {
121 info = new PluginInfo; 121 info = new PluginInfo;
122 info->library = libname; 122 info->library = libname;
123 info->nameLabel = i18n( "qtopia" ); 123 info->nameLabel = i18n( "qtopia" );
124 info->descriptionLabel = i18n( "Qtopia PIM Addressbook." ); 124 info->descriptionLabel = i18n( "Qtopia PIM Addressbook." );
125 mTypeMap.insert( "qtopia", info ); 125 mTypeMap.insert( "qtopia", info );
126 } 126 }
127 127
128 //US add sharp plugin only, if the library exists. 128 //US add sharp plugin only, if the library exists.
129 libname = "microkabc_sharpdtm"; 129 libname = "microkabc_sharpdtm";
130 path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 130 path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
131 if ( !path.isEmpty() ) 131 if ( !path.isEmpty() )
132 { 132 {
133 info = new PluginInfo; 133 info = new PluginInfo;
134 info->library = libname; 134 info->library = libname;
135 info->nameLabel = i18n( "sharp" ); 135 info->nameLabel = i18n( "sharp" );
136 info->descriptionLabel = i18n( "Sharp DTM Addressbook." ); 136 info->descriptionLabel = i18n( "Sharp DTM Addressbook." );
137 mTypeMap.insert( "sharp", info ); 137 mTypeMap.insert( "sharp", info );
138 } 138 }
139 139
140 140
141 //LR add ol plugin only, if the library exists.
142 libname = "microkabc_olaccess";
143 path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
144 if ( !path.isEmpty() )
145 {
146 info = new PluginInfo;
147 info->library = libname;
148 info->nameLabel = i18n( "sharp" );
149 info->descriptionLabel = i18n( "Outlook Addressbook." );
150 mTypeMap.insert( "olaccess", info );
151 }
152
153
141} 154}
142 155
143Factory::~Factory() 156Factory::~Factory()
144{ 157{
145} 158}
146 159
147QStringList Factory::typeNames() const 160QStringList Factory::typeNames() const
148{ 161{
149//US method QMap::keys() not available yet. SO collect the data manually 162//US method QMap::keys() not available yet. SO collect the data manually
150//US return mTypeMap.keys(); 163//US return mTypeMap.keys();
151 164
152 QStringList result; 165 QStringList result;
153 166
154 QMap<QString, PluginInfo*>::ConstIterator it; 167 QMap<QString, PluginInfo*>::ConstIterator it;
155 for( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) { 168 for( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) {
156 result << it.key().latin1(); 169 result << it.key().latin1();
157// qDebug("Factory::typeNames() : %s ", it.key().latin1()); 170// qDebug("Factory::typeNames() : %s ", it.key().latin1());
158 171
159 } 172 }
160 return result; 173 return result;
161} 174}
162 175
163ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent ) 176ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent )
164{ 177{
165 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 178 if ( type.isEmpty() || !mTypeMap.contains( type ) )
166 return 0; 179 return 0;
167 180
168//US KService::Ptr ptr = mTypeMap[ type ]; 181//US KService::Ptr ptr = mTypeMap[ type ];
169//US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); 182//US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() );
170 PluginInfo* pi = mTypeMap[ type ]; 183 PluginInfo* pi = mTypeMap[ type ];
171 KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); 184 KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() );
172 if ( !factory ) { 185 if ( !factory ) {