@@ -106,41 +106,44 @@ sharedLibExtension = "*.so*";
106
106
107
107
} else
108
108
{
109
- std::cout << " dlopen suceeded" << std::endl;
109
+ std::cout << " dlopen suceeded for " << lib. toLocal8Bit (). data () << std::endl;
110
110
dlclose (handle);
111
111
}
112
112
#endif // #ifndef WIN32 && Q_OS_MACX
113
113
#endif // #ifdef TESTLIB
114
114
115
115
116
- std::cout << " Examining " << txtPluginDir-> text (). toLocal8Bit (). data () << " / " << pluginDir[i] .toLocal8Bit ().data () << std::endl;
117
- QLibrary *myLib = new QLibrary (txtPluginDir-> text () + " / " + pluginDir[i] );
116
+ std::cout << " Examining " << lib .toLocal8Bit ().data () << std::endl;
117
+ QLibrary *myLib = new QLibrary (lib );
118
118
bool loaded = myLib->load ();
119
119
if (loaded)
120
120
{
121
121
std::cout << " Loaded " << myLib->library ().toLocal8Bit ().data () << std::endl;
122
- name_t *pName = (name_t *) myLib->resolve (" name" );
123
- description_t *pDesc = (description_t *) myLib->resolve (" description" );
124
- version_t *pVersion = (version_t *) myLib->resolve (" version" );
122
+ // Don't bother with libraries that are providers
123
+ if (!myLib->resolve (" isProvider" ))
124
+ {
125
+ name_t *pName = (name_t *) myLib->resolve (" name" );
126
+ description_t *pDesc = (description_t *) myLib->resolve (" description" );
127
+ version_t *pVersion = (version_t *) myLib->resolve (" version" );
125
128
#ifdef QGISDEBUG
126
- // show the values (or lack of) for each function
127
- if (pName){
128
- std::cout << " Plugin name: " << pName ().toLocal8Bit ().data () << std::endl;
129
- }else {
130
- std::cout << " Plugin name not returned when queried\n " ;
131
- }
132
- if (pDesc){
133
- std::cout << " Plugin description: " << pDesc ().toLocal8Bit ().data () << std::endl;
134
- }else {
135
- std::cout << " Plugin description not returned when queried\n " ;
136
- }
137
- if (pVersion){
138
- std::cout << " Plugin version: " << pVersion ().toLocal8Bit ().data () << std::endl;
139
- }else {
140
- std::cout << " Plugin version not returned when queried\n " ;
141
- }
129
+ // show the values (or lack of) for each function
130
+ if (pName){
131
+ std::cout << " Plugin name: " << pName ().toLocal8Bit ().data () << std::endl;
132
+ }else {
133
+ std::cout << " Plugin name not returned when queried\n " ;
134
+ }
135
+ if (pDesc){
136
+ std::cout << " Plugin description: " << pDesc ().toLocal8Bit ().data () << std::endl;
137
+ }else {
138
+ std::cout << " Plugin description not returned when queried\n " ;
139
+ }
140
+ if (pVersion){
141
+ std::cout << " Plugin version: " << pVersion ().toLocal8Bit ().data () << std::endl;
142
+ }else {
143
+ std::cout << " Plugin version not returned when queried\n " ;
144
+ }
142
145
#endif
143
- if (pName && pDesc && pVersion)
146
+ if (pName && pDesc && pVersion)
144
147
{
145
148
Q3CheckListItem *pl = new Q3CheckListItem (lstPlugins, pName (), Q3CheckListItem::CheckBox); // , pDesc(), pluginDir[i])
146
149
pl->setText (1 , pVersion ());
@@ -158,24 +161,27 @@ sharedLibExtension = "*.so*";
158
161
#endif
159
162
QString libName = pRegistry->library (pName ());
160
163
if (libName.length () > 0 )
161
- {
164
+ {
162
165
#ifdef QGISDEBUG
163
- std::cout << " Found library name in the registry" << std::endl;
166
+ std::cout << " Found library name in the registry" << std::endl;
164
167
#endif
165
- if (libName == myLib->library ())
166
- {
167
- // set the checkbox
168
- pl->setOn (true );
169
- }
168
+ if (libName == myLib->library ())
169
+ {
170
+ // set the checkbox
171
+ pl->setOn (true );
170
172
}
171
- } else
173
+ }
174
+ }
175
+ else
172
176
{
173
177
std::cout << " Failed to get name, description, or type for " << myLib->library ().toLocal8Bit ().data () << std::endl;
174
178
}
175
- } else
176
- {
177
- std::cout << " Failed to load " << myLib->library ().toLocal8Bit ().data () << std::endl;
179
+ }
178
180
}
181
+ else
182
+ {
183
+ std::cout << " Failed to load " << myLib->library ().toLocal8Bit ().data () << std::endl;
184
+ }
179
185
}
180
186
}
181
187
}
0 commit comments