2011-06-17 15:57:13 -04:00
|
|
|
#include <retroshare/rsplugin.h>
|
|
|
|
|
|
|
|
#include "LinksCloudPlugin.h"
|
|
|
|
#include "LinksDialog.h"
|
|
|
|
|
|
|
|
static void *inited = new LinksCloudPlugin() ;
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
void *RETROSHARE_PLUGIN_provide()
|
|
|
|
{
|
|
|
|
static LinksCloudPlugin *p = new LinksCloudPlugin() ;
|
|
|
|
|
|
|
|
return (void*)p ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#define IMAGE_LINKS ":/images/irkick.png"
|
|
|
|
|
2011-07-05 16:29:07 -04:00
|
|
|
void LinksCloudPlugin::getPluginVersion(int& major,int& minor,int& svn_rev) const
|
|
|
|
{
|
|
|
|
major = 5 ;
|
|
|
|
minor = 1 ;
|
|
|
|
svn_rev = 4350 ;
|
|
|
|
}
|
|
|
|
|
2011-06-17 15:57:13 -04:00
|
|
|
LinksCloudPlugin::LinksCloudPlugin()
|
|
|
|
{
|
|
|
|
mRanking = NULL ;
|
|
|
|
mainpage = NULL ;
|
2011-06-29 18:57:35 -04:00
|
|
|
mIcon = NULL ;
|
2011-06-17 15:57:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
MainPage *LinksCloudPlugin::qt_page() const
|
|
|
|
{
|
|
|
|
if(mainpage == NULL)
|
|
|
|
mainpage = new LinksDialog ;
|
|
|
|
|
|
|
|
return mainpage ;
|
|
|
|
}
|
|
|
|
|
|
|
|
RsCacheService *LinksCloudPlugin::rs_cache_service() const
|
|
|
|
{
|
|
|
|
if(mRanking == NULL)
|
|
|
|
{
|
|
|
|
mRanking = new p3Ranking ; // , 3600 * 24 * 30 * 6); // 6 Months
|
|
|
|
rsRanks = mRanking ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mRanking ;
|
|
|
|
}
|
|
|
|
|
|
|
|
QIcon *LinksCloudPlugin::qt_icon() const
|
|
|
|
{
|
2011-06-29 18:57:35 -04:00
|
|
|
if(mIcon == NULL)
|
2011-07-05 16:42:28 -04:00
|
|
|
{
|
|
|
|
Q_INIT_RESOURCE(linksCloud_images) ;
|
|
|
|
|
2011-06-29 18:57:35 -04:00
|
|
|
mIcon = new QIcon(IMAGE_LINKS) ;
|
2011-07-05 16:42:28 -04:00
|
|
|
}
|
2011-06-29 18:57:35 -04:00
|
|
|
|
2011-06-17 15:57:13 -04:00
|
|
|
return mIcon ;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string LinksCloudPlugin::getShortPluginDescription() const
|
|
|
|
{
|
|
|
|
return "This plugin provides a set of cached links, and a voting system to promote them." ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|