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.
54 lines
1.4 KiB
54 lines
1.4 KiB
15 years ago
|
#include "testmanager.h"
|
||
|
#include "testmanager.moc"
|
||
|
|
||
|
#include "pluginmanager.h"
|
||
|
#include "plugin.h"
|
||
|
|
||
|
#include <kplugininfo.h>
|
||
|
#include <kcmdlineargs.h>
|
||
|
#include <kapplication.h>
|
||
|
#include <kdebug.h>
|
||
|
|
||
|
using namespace Komposer;
|
||
|
|
||
14 years ago
|
TestManager::TestManager( TQObject *parent )
|
||
|
: TQObject( parent )
|
||
15 years ago
|
{
|
||
|
m_manager = new PluginManager( this );
|
||
15 years ago
|
connect( m_manager, TQT_SIGNAL(pluginLoaded(Plugin*)),
|
||
|
TQT_SLOT(slotPluginLoaded(Plugin*)) );
|
||
|
connect( m_manager, TQT_SIGNAL(allPluginsLoaded()),
|
||
|
TQT_SLOT(slotAllPluginsLoaded()) );
|
||
15 years ago
|
m_manager->loadAllPlugins();
|
||
|
|
||
15 years ago
|
TQValueList<KPluginInfo*> plugins = m_manager->availablePlugins();
|
||
15 years ago
|
kdDebug()<<"Number of available plugins is "<< plugins.count() <<endl;
|
||
15 years ago
|
for ( TQValueList<KPluginInfo*>::iterator it = plugins.begin(); it != plugins.end(); ++it ) {
|
||
15 years ago
|
KPluginInfo *i = ( *it );
|
||
|
kdDebug()<<"\tAvailable plugin "<< i->name()
|
||
|
<<", comment = "<< i->comment() <<endl;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void TestManager::slotAllPluginsLoaded()
|
||
|
{
|
||
|
kdDebug()<<"Done"<<endl;
|
||
|
m_manager->shutdown();
|
||
14 years ago
|
tqApp->exit();
|
||
15 years ago
|
}
|
||
|
|
||
|
void TestManager::slotPluginLoaded( Plugin *plugin )
|
||
|
{
|
||
|
kdDebug()<<"A plugin "<< m_manager->pluginName( plugin ) << " has been loaded"<<endl;
|
||
|
}
|
||
|
|
||
|
int main( int argc, char **argv )
|
||
|
{
|
||
|
KCmdLineArgs::init( argc, argv, "test", "test", "test", "0.1" );
|
||
|
KApplication app;
|
||
|
|
||
|
TestManager manager( &app );
|
||
|
|
||
|
return app.exec();
|
||
|
}
|