summaryrefslogtreecommitdiffstats
path: root/kmrml/kmrml/kcontrol/indextest.cpp
blob: 161ca7981cf6ac04769b18796274588a9bb7cdb4 (plain)
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
#include "indexer.h"
#include <kmrml_config.h>
#include "indextest.moc"

#include <kapplication.h>
#include <kconfig.h>
#include <kglobal.h>

using namespace KMrmlConfig;

IndexTest::IndexTest()
{
    KMrml::Config *config = new KMrml::Config( KGlobal::config() );
    Indexer *indexer = new Indexer( *config, this );
    connect( indexer, SIGNAL( finished( bool )), SLOT( slotFinished( bool )));
    connect( indexer, SIGNAL( progress( int, const QString& )),
             SLOT( slotProgress( int, const QString& )));

    indexer->startIndexing( "/home/gis/testcoll" );
}

IndexTest::~IndexTest()
{

}

void IndexTest::slotFinished( bool success )
{
    qDebug("##### FINISHED: %i", success );
}

void IndexTest::slotProgress( int percent, const QString& message )
{
    qDebug("--- progress: %i: %s", percent, message.latin1());
}

int main( int argc, char **argv )
{
    KApplication app( argc, argv, "indextest" );
    IndexTest *test = new IndexTest();

    return app.exec();
}