From kde-commits Wed Nov 30 23:04:40 2011 From: Christian Mollekopf Date: Wed, 30 Nov 2011 23:04:40 +0000 To: kde-commits Subject: [kdepim-runtime] agents/nepomukfeeder: akonadinepomukfeeder_indexer Message-Id: <20111130230440.81481A60A6 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132269437702287 Git commit 49d971abffac39a4dcccae51d1c38cadc5ffb846 by Christian Mollekopf. Committed on 30/11/2011 at 03:23. Pushed by cmollekopf into branch 'master'. akonadinepomukfeeder_indexer helper utility M +1 -1 agents/nepomukfeeder/CMakeLists.txt A +36 -0 agents/nepomukfeeder/test/akonadinepomukfeeder_indexer.cpp = [License: GPL (v3+)] http://commits.kde.org/kdepim-runtime/49d971abffac39a4dcccae51d1c38cadc5ffb= 846 diff --git a/agents/nepomukfeeder/CMakeLists.txt b/agents/nepomukfeeder/CMa= keLists.txt index 903ba66..82ea7c9 100644 --- a/agents/nepomukfeeder/CMakeLists.txt +++ b/agents/nepomukfeeder/CMakeLists.txt @@ -15,7 +15,7 @@ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EX= CEPTIONS} -fPIC" ) = add_subdirectory( plugin ) add_subdirectory( plugins ) - +add_subdirectory( test ) = kde4_add_executable(akonadi_nepomuk_feeder nepomukfeederagent.cpp pluginlo= ader.cpp feederqueue.cpp nepomukhelpers.cpp) = diff --git a/agents/nepomukfeeder/test/akonadinepomukfeeder_indexer.cpp b/a= gents/nepomukfeeder/test/akonadinepomukfeeder_indexer.cpp new file mode 100644 index 0000000..ba28175 --- /dev/null +++ b/agents/nepomukfeeder/test/akonadinepomukfeeder_indexer.cpp @@ -0,0 +1,36 @@ +/* + Copyright (C) 2011 Christian Mollekopf + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include +#include +#include + +int main(int argc, char *argv[]) + { + QCoreApplication app(argc, argv); + if (app.arguments().size() !=3D 2) { + return -1; + } + ItemQueue queue(1, 1, &app); + Akonadi::Item::Id id =3D app.arguments().at(1).toInt(); + kDebug() << "indexing item: " << id; + queue.addItem(Akonadi::Item(id)); + queue.processItem(); + QObject::connect( &queue, SIGNAL(finished()), &app, SLOT(quit())); + return app.exec(); + } \ No newline at end of file