Skip to content

Commit 3ce742d

Browse files
committed
Allow "Experimental" status also for c++ plugins. Mark Globe plugin experimental.
1 parent 6bbc149 commit 3ce742d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/app/pluginmanager/qgspluginmanager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ void QgsPluginManager::getCppPluginDescriptions()
310310
category_t *pCat = ( category_t * ) cast_to_fptr( myLib->resolve( "category" ) );
311311
version_t *pVersion = ( version_t * ) cast_to_fptr( myLib->resolve( "version" ) );
312312
icon_t* pIcon = ( icon_t * ) cast_to_fptr( myLib->resolve( "icon" ) );
313+
experimental_t *pExperimental = ( experimental_t * ) cast_to_fptr( myLib->resolve( "experimental" ) );
313314

314315
// show the values (or lack of) for each function
315316
if ( pName )
@@ -370,6 +371,7 @@ void QgsPluginManager::getCppPluginDescriptions()
370371
metadata["pythonic"] = "false";
371372
metadata["installed"] = "true";
372373
metadata["readonly"] = "true";
374+
metadata["experimental"] = ( pExperimental ? pExperimental() : QString() );
373375
mPlugins.insert( baseName, metadata );
374376

375377
delete myLib;

src/plugins/globe/globe_plugin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static const QString sDescription = QObject::tr( "Overlay data on a 3D globe" );
7171
static const QString sCategory = QObject::tr( "Plugins" );
7272
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
7373
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
74+
static const QString sExperimental = QString( "true" );
7475

7576

7677
//constructor
@@ -1198,6 +1199,12 @@ QGISEXTERN QString version()
11981199
return sPluginVersion;
11991200
}
12001201

1202+
// Return the experimental status for the plugin
1203+
QGISEXTERN QString experimental()
1204+
{
1205+
return sExperimental;
1206+
}
1207+
12011208
// Delete ourself
12021209
QGISEXTERN void unload( QgisPlugin * thePluginPointer )
12031210
{

src/plugins/qgisplugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,7 @@ typedef QString version_t();
201201
//! Typedef for getting the plugin icon file name without instantiating the plugin
202202
typedef QString icon_t();
203203

204+
//! Typedef for getting the experimental status without instantiating the plugin
205+
typedef QString experimental_t();
204206

205207
#endif //qgisplugin_h

0 commit comments

Comments
 (0)