Hi Mathieu,
2009/6/5 Mathieu Dupuy <mdu...@mandriva.com>:
> It seems like documentation is really obsolete ; for example, I'm unable to
> find documentation reference on Nepomuk::File (which seems to does not exist
> anymore), or Nepomuk::Resource has no function getProperty.
Yes. There are some outdated tutorials there. See the API docu on
http://api.kde.org that is up to date.
> I didn't find either how to compile program with Nepomuk ; i added -lnepomuk
> in compilation command line but nowhere it was written it was the manner to
> do it.
Well, that's because most KDE devs will use cmake for building. That
way you don't have to add things to the commandl line on your own. You
can use cmake to either create normal unix makefiles or for example
just open the CMakeList.txt in Qt Creator which then opens your
project and you can build it from there.
I have attached an simple CMakeList.txt for your program.
> Am I crazy, am I doing things wrong, or am I just not understanding what has
> to be done ?
Well, it just seems you are new to KDE development and that the
documentation on the nepomuke side of things is not really good. But
well it mostly aims for users who are already know basics of kde
development. See http://techbase.kde.org for general infos about that.
And take a look at other nepomuk using projects in playground of the
svn and how they build things with cmake (form the web avaible over
http://websvn.kde.org)
> Though I succeeded doing a little program that just add a tag to a file, and
> the only thing happening is the program having an assert.
The problem here is, you have to initialize the Nepomuk ResourceManager with:
Nepomuk::ResourceManager::instance()->init();
I added a fixed version of your main.cpp to this mail. It works (tags
the file) but it will bring you some warnings at runtime. Thats
because you have no qt eventloop and the like.
DanielW
project(nepotest)
find_package(KDE4 REQUIRED)
find_package(Nepomuk REQUIRED)
include (KDE4Defaults)
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES})
set(nepotest_SRCS
main.cpp
)
kde4_add_executable(nepotest ${nepotest_SRCS})
target_link_libraries(nepotest ${NEPOMUK_LIBRARIES})
install(TARGETS nepotest DESTINATION ${BIN_INSTALL_DIR} )
#include <KDE/Nepomuk/Resource>
#include <KDE/Nepomuk/ResourceManager>
#include <KDE/Nepomuk/Tag>
//#include <KDE/Nepomuk/File>
#include <QString>
int main()
{
Nepomuk::ResourceManager::instance()->init();
Nepomuk::Resource R("file:///home/danielw");
Nepomuk::Tag T("batterie");
//R.addAnnotation("description de la pearl 2002c");
//R.getProperty();
R.addTag(T);
}
_______________________________________________
nepomuk-kde mailing list
nepomuk-kde@semanticdesktop.org
http://lists.semanticdesktop.org/mailman/listinfo/nepomuk-kde