Skip to content

Commit

Permalink
Allow "Experimental" status also for c++ plugins. Mark Globe plugin e…
Browse files Browse the repository at this point in the history
…xperimental.
  • Loading branch information
borysiasty committed Jun 5, 2013
1 parent 6bbc149 commit 3ce742d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ void QgsPluginManager::getCppPluginDescriptions()
category_t *pCat = ( category_t * ) cast_to_fptr( myLib->resolve( "category" ) );
version_t *pVersion = ( version_t * ) cast_to_fptr( myLib->resolve( "version" ) );
icon_t* pIcon = ( icon_t * ) cast_to_fptr( myLib->resolve( "icon" ) );
experimental_t *pExperimental = ( experimental_t * ) cast_to_fptr( myLib->resolve( "experimental" ) );

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

delete myLib;
Expand Down
7 changes: 7 additions & 0 deletions src/plugins/globe/globe_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static const QString sDescription = QObject::tr( "Overlay data on a 3D globe" );
static const QString sCategory = QObject::tr( "Plugins" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sExperimental = QString( "true" );


//constructor
Expand Down Expand Up @@ -1198,6 +1199,12 @@ QGISEXTERN QString version()
return sPluginVersion;
}

// Return the experimental status for the plugin
QGISEXTERN QString experimental()
{
return sExperimental;
}

// Delete ourself
QGISEXTERN void unload( QgisPlugin * thePluginPointer )
{
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/qgisplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,7 @@ typedef QString version_t();
//! Typedef for getting the plugin icon file name without instantiating the plugin
typedef QString icon_t();

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

#endif //qgisplugin_h

0 comments on commit 3ce742d

Please sign in to comment.