I found some posts in the asGPS thread on the update info functionality of asGPS. Jeff was interested in it also, but I think it was dropped in the priority list. Here is how it works:
I implemented a small service to include in a plugin. You can get it in the PluginTools package with
Code: Select all
git clone http://schrell.de/PluginTools.gitIn YourPlugin.h:
Code: Select all
#include "WebInfos.h"
public slots:
/** Web infos are ready to use.
* The web page we asked for the update infos is loaded, values can be obtained.
*/
void webInfosReady();
private:
WebInfos *m_webInfos; /**< instance for gettings version infos from the web */
Code: Select all
#include "WebInfos.h"
bool YourPlugin::finish()
{
.....
if (m_config->checkForUpdates()) {
m_webInfos = new WebInfos("org.example.youPluginIdentifier", "8"); // 8 is the current SDK version
connect(m_webInfos,
SIGNAL(ready()),
SLOT(webInfosReady()));
m_webInfos->fetch();
}
...
}
void YourPlugin::webInfosReady() {
if (m_webInfos->isWebNewer()) {
QString text = QString(tr("There is a newer version of %1 available. "
"It is version %2. You are running %3. "
"You can download it under the following url: <a href='%4'>%4</a>"))
.arg(m_webInfos->name(), m_webInfos->version(), TARGET_VERSION_STRING, m_webInfos->link());
QMessageBox::information(NULL, m_webInfos->name(), text);
}
delete m_webInfos;
m_webInfos = NULL;
}
Code: Select all
QT += network
It would be best if Jeff could provide this service on the Corel site. It would be no problem to insert freshly uploaded/updated plugins in the database automatically, its just a call to an html link.
If a plugin is prepared in this way and if it is configured to look for updates, it fetches the WebInfos in its init part. It is asynchronously informed of the current version. With the method isWebNewer() it can test if there is a never version and inform the user.
If the other devs support asPluginManager, it would be a good idea to include it there. So the plugins would only gibe their ToolData to asPluginManager and it can display a list of all fresh plugins available on the Corel site. The forler variant would display several message boxes, the latter can display the full list at once.
Andreas
