1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
#include <sstream>
#include <iostream>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qlabel.h>
#include <QMainWindow>
#include <qmessagebox.h>
#include <qpoint.h>
#include <QAbstractItemView>
#include <QVBoxLayout>
//#include <ept/configuration/apt.h>
//#include <ept/cache/popcon/tagmap.h>
#include <helpers.h>
#include <exception.h>
// NPlugin
#include <packagenotfoundexception.h>
#include <iprovider.h>
#include "popconplugin.h"
using namespace std;
namespace NPlugin
{
const QString PopconPlugin::PLUGIN_NAME = "PopconPlugin";
/////////////////////////////////////////////////////
// Constructors/ Destructors
/////////////////////////////////////////////////////
PopconPlugin::PopconPlugin(const PopconPluginContainer& container) :
_container(container)
{
_pProvider = 0;
}
PopconPlugin::~PopconPlugin()
{
}
/////////////////////////////////////////////////////
// Plugin Interface
/////////////////////////////////////////////////////
void PopconPlugin::init(IProvider* pProvider)
{
_pProvider = pProvider;
}
QString PopconPlugin::title() const
{
return QString("Popcon Plugin");
}
QString PopconPlugin::briefDescription() const
{
return QString("Makes popcon data available and uses it for score calucation");
}
QString PopconPlugin::description() const
{
return QString("This plugin makes the popcon information available."
"Popcon scores are used to calculate the scores for a package and "
"displayed in the package details.");
}
/////////////////////////////////////////////////////
// Search Plugin Interface
/////////////////////////////////////////////////////
map<string, float> PopconPlugin::getScore(const set<string>& packages) const
{
qDebug("PopconPlugin::getScore not implemented");
return map<string,float>();
}
bool PopconPlugin::offersScore() const
{
return false;
}
/////////////////////////////////////////////////////
// Information Plugin Interface
/////////////////////////////////////////////////////
QString PopconPlugin::informationText(const string& package)
{
{ // add the tags of the package to the description
// float score = _container.popcon().scoreByName(package);
QString detailsString = "<b>Score:</b> " ;
// + QString::number(score);
return detailsString+"<br>";
}
}
/////////////////////////////////////////////////////
// Helper Methods
/////////////////////////////////////////////////////
} // namespace NPlugin
#undef emit
/*
#include <ept/cache/apt/packages.tcc>
#include <ept/cache/popcon/vocabulary.tcc>
#include <ept/cache/tag.tcc>
#include <tagcoll/coll/base.tcc>
*/
|