added version function to return version without instantiating the plugin object

git-svn-id: http://svn.osgeo.org/qgis/trunk@805 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2004-02-12 05:46:44 +00:00
parent f0394a75d9
commit 5e588e1aac
3 changed files with 15 additions and 1 deletions

View File

@ -42,7 +42,7 @@
// xpm for creating the toolbar icon
#include "icon_buffer.xpm"
static const char *pluginVersion = "0.1";
/**
* Constructor for the plugin. The plugin is passed a pointer to the main app
* and an interface object that provides access to exposed functions in QGIS.
@ -446,6 +446,12 @@ extern "C" int type()
return QgisPlugin::UI;
}
// Return the version number for the plugin
extern "C" QString version()
{
return pluginVersion;
}
// Delete ourself
extern "C" void unload(QgisPlugin * p)
{

View File

@ -71,4 +71,6 @@ typedef QString name_t();
typedef QString description_t();
//! Typedef for getting the plugin type without instantiating the plugin
typedef int type_t();
//! Typedef for getting the plugin version without instantiating the plugin
typedef QString version_t();
#endif //qgisplugin_h

View File

@ -36,6 +36,7 @@
// xpm for creating the toolbar icon
#include "icon_spit.xpm"
static const char *pluginVersion = "0.1";
/**
* Constructor for the plugin. The plugin is passed a pointer to the main app
* and an interface object that provides access to exposed functions in QGIS.
@ -153,6 +154,11 @@ extern "C" int type()
return QgisPlugin::UI;
}
// Return the version
extern "C" QString version()
{
return pluginVersion;
}
// Delete ourself
extern "C" void unload(QgisPlugin * p)
{