mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 02:50:07 -05:00
fixed LinksCloud Plugin
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4282 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f6001770b1
commit
3c93d21b34
55
plugins/LinksCloud/LinksCloudPlugin.cpp
Normal file
55
plugins/LinksCloud/LinksCloudPlugin.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
#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"
|
||||
|
||||
LinksCloudPlugin::LinksCloudPlugin()
|
||||
{
|
||||
mRanking = NULL ;
|
||||
mainpage = NULL ;
|
||||
mIcon = new QIcon(IMAGE_LINKS) ;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
return mIcon ;
|
||||
}
|
||||
|
||||
std::string LinksCloudPlugin::getShortPluginDescription() const
|
||||
{
|
||||
return "This plugin provides a set of cached links, and a voting system to promote them." ;
|
||||
}
|
||||
|
||||
|
27
plugins/LinksCloud/LinksCloudPlugin.h
Normal file
27
plugins/LinksCloud/LinksCloudPlugin.h
Normal file
@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <retroshare/rsplugin.h>
|
||||
#include <gui/mainpage.h>
|
||||
#include "p3ranking.h"
|
||||
|
||||
class LinksCloudPlugin: public RsPlugin
|
||||
{
|
||||
public:
|
||||
LinksCloudPlugin() ;
|
||||
virtual ~LinksCloudPlugin() {}
|
||||
|
||||
virtual RsCacheService *rs_cache_service() const ;
|
||||
virtual MainPage *qt_page() const ;
|
||||
virtual QIcon *qt_icon() const ;
|
||||
virtual uint16_t rs_service_id() const { return RS_SERVICE_TYPE_RANK ; }
|
||||
|
||||
virtual std::string configurationFileName() const { return std::string() ; }
|
||||
|
||||
virtual std::string getShortPluginDescription() const ;
|
||||
virtual std::string getPluginName() const { return "LinksCloud" ; }
|
||||
private:
|
||||
mutable p3Ranking *mRanking ;
|
||||
mutable MainPage *mainpage ;
|
||||
mutable QIcon *mIcon ;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user