Changeset 4879 for branches/erijo-dev
- Timestamp:
- 04/01/07 04:09:14 (20 months ago)
- Location:
- branches/erijo-dev/licq
- Files:
-
- 3 modified
-
licq/interface/plugininformation.h (modified) (2 diffs)
-
src/plugin/pluginrepository.cpp (modified) (3 diffs)
-
src/plugin/pluginrepository.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/erijo-dev/licq/licq/interface/plugininformation.h
r4868 r4879 21 21 #define LICQ_TPLUGININFORMATION_H 22 22 23 #include <boost/shared_ptr.hpp> 23 24 #include <string> 24 25 #include <vector> … … 26 27 namespace Licq 27 28 { 29 30 class TPluginInformation; 31 typedef boost::shared_ptr<const TPluginInformation> TPluginInformationPtr; 28 32 29 33 enum TPluginType -
branches/erijo-dev/licq/src/plugin/pluginrepository.cpp
r4873 r4879 65 65 entry->Factory = *factory; 66 66 entry->Index = index; 67 entry->Information = (*factory)->getPluginInformation(index); 67 entry->Information 68 .reset(new TPluginInformation((*factory)->getPluginInformation(index))); 69 70 if (entry->Information->Name.empty()) 71 { 72 Log->warning("Skipping plugin with no name"); 73 delete entry; 74 continue; 75 } 68 76 69 77 // Check for duplicate plugins 70 TPluginCache::iterator cache = PluginCache.find(entry->Information .Name);78 TPluginCache::iterator cache = PluginCache.find(entry->Information->Name); 71 79 if (cache != PluginCache.end()) 72 80 { 73 81 // Keep the one with the highest IntVersion, or if equal, the first loaded. 74 if (entry->Information.IntVersion <= cache->second->Information.IntVersion) 82 if (entry->Information->IntVersion 83 <= cache->second->Information->IntVersion) 75 84 { 76 85 delete entry; … … 92 101 93 102 // Cache plugin 94 PluginCache[entry->Information .Name] = entry;103 PluginCache[entry->Information->Name] = entry; 95 104 } 96 105 } … … 103 112 104 113 void Licq::TPluginRepository:: 105 getAvailablePlugins(std::list<TPluginInformation >* pluginInformation)114 getAvailablePlugins(std::list<TPluginInformationPtr>* pluginInformation) 106 115 { 107 116 for (TPluginCache::const_iterator cache = PluginCache.begin(); -
branches/erijo-dev/licq/src/plugin/pluginrepository.h
r4869 r4879 53 53 boost::weak_ptr<IPluginFactory> Factory; 54 54 unsigned int Index; 55 TPluginInformation Information;55 TPluginInformationPtr Information; 56 56 }; 57 57 … … 70 70 void unloadUnusedPlugins(); 71 71 72 void getAvailablePlugins(std::list<TPluginInformation >* pluginInformation);72 void getAvailablePlugins(std::list<TPluginInformationPtr>* pluginInformation); 73 73 74 74 IPlugin* createPlugin(const std::string& name);
