You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.6 KiB
56 lines
1.6 KiB
15 years ago
|
%{CPP_TEMPLATE}
|
||
|
|
||
|
#include <config.h>
|
||
12 years ago
|
#include "tdefile_%{APPNAMELC}.h"
|
||
15 years ago
|
|
||
|
#include <kgenericfactory.h>
|
||
12 years ago
|
//#include <tdeio/global.h>
|
||
15 years ago
|
|
||
14 years ago
|
//#include <tqfileinfo.h>
|
||
|
//#include <tqdir.h>
|
||
15 years ago
|
|
||
|
typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}Factory;
|
||
|
|
||
12 years ago
|
K_EXPORT_COMPONENT_FACTORY(tdefile_%{APPNAME}, %{APPNAME}Factory( "tdefile_%{APPNAMELC}" ))
|
||
15 years ago
|
|
||
13 years ago
|
%{APPNAME}Plugin::%{APPNAME}Plugin(TQObject *parent, const char *name,
|
||
14 years ago
|
const TQStringList &args)
|
||
13 years ago
|
: KFilePlugin(parent, name, args)
|
||
15 years ago
|
{
|
||
|
//add the mimetype here - example:
|
||
|
//KFileMimeTypeInfo* info = addMimeTypeInfo( "text/html" );
|
||
|
KFileMimeTypeInfo* info = addMimeTypeInfo( "text/html" );
|
||
|
|
||
|
// our new group
|
||
|
KFileMimeTypeInfo::GroupInfo* group = 0L;
|
||
|
group = addGroupInfo(info, "%{APPNAME}Info", i18n("%{APPNAME} Information"));
|
||
|
|
||
|
KFileMimeTypeInfo::ItemInfo* item;
|
||
|
|
||
|
// our new items in the group
|
||
14 years ago
|
item = addItemInfo(group, "Items", i18n("Items"), TQVariant::Int);
|
||
|
item = addItemInfo(group, "Size", i18n("Size"), TQVariant::Int);
|
||
15 years ago
|
setUnit(item, KFileMimeTypeInfo::KiloBytes);
|
||
|
|
||
|
// strings are possible, too:
|
||
14 years ago
|
//addItemInfo(group, "Text", i18n("Document Type"), TQVariant::String);
|
||
15 years ago
|
}
|
||
|
|
||
|
bool %{APPNAME}Plugin::readInfo( KFileMetaInfo& info, uint /*what*/)
|
||
|
{
|
||
|
KFileMetaInfoGroup group = appendGroup(info, "%{APPNAME}Info");
|
||
|
|
||
|
// add your "calculations" here
|
||
|
// if something goes wrong, "return false;"
|
||
|
|
||
|
|
||
|
// and finally display it!
|
||
|
appendItem(group, "Items", 100);
|
||
|
appendItem(group, "Size", int(5000/1024));
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
12 years ago
|
#include "tdefile_%{APPNAMELC}.moc"
|
||
15 years ago
|
|