extragear/multimedia/amarok/src/collection/nepomukcollection

Big O illogical1 at gmail.com
Sun Jun 8 16:54:14 CEST 2008


On Jun 7, 2008, at 6:04 PM, Daniel Winter wrote:

> SVN commit 818147 by danielw:
>
> Only create collection if Nepomuk is running.
>
> Added Nepomuk libs and includes to CMakeLists.txt
>
> M  +11 -2     CMakeLists.txt
> M  +14 -4     NepomukCollection.cpp
>
>
> --- trunk/extragear/multimedia/amarok/src/collection/ 
> nepomukcollection/CMakeLists.txt #818146:818147
> @@ -1,3 +1,8 @@
> +# not sure if that is good idea. but as Nepomuk is part of kdelibs  
> i think

It's a part of kdelibs but not required. So this should be optional.

>
> +# require it shouldn't be a problem
> +
> +find_package(Nepomuk REQUIRED)
> +
> include_directories( ../..
>         ../../plugin
>    ../../meta
> @@ -4,7 +9,8 @@
>    ../../collection
>    ${CMAKE_CURRENT_BINARY_DIR}/../..
>    ${KDE4_INCLUDE_DIR}
> -   ${QT_INCLUDES} )
> +   ${QT_INCLUDES}
> +   ${NEPOMUK_INCLUDES})
>
>
> ########### next target ###############
> @@ -16,7 +22,10 @@
>
> kde4_add_plugin(amarok_collection-nepomukcollection WITH_PREFIX $ 
> {amarok_collection-nepomukcollection_PART_SRCS})
>
> -target_link_libraries(amarok_collection-nepomukcollection amaroklib  
> ${KDE4_THREADWEAVER_LIBRARIES})
> +target_link_libraries(amarok_collection-nepomukcollection
> +    amaroklib
> +    ${KDE4_THREADWEAVER_LIBRARIES}
> +    ${NEPOMUK_LIBRARIES})
>
> if(APPLE)
> 	SET_TARGET_PROPERTIES(amarok_collection-nepomukcollection  
> PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
> --- trunk/extragear/multimedia/amarok/src/collection/ 
> nepomukcollection/NepomukCollection.cpp #818146:818147
> @@ -16,10 +16,15 @@
>    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA   
> 02110-1301, USA
> */
>
> +#define DEBUG_PREFIX "NepomukCollection"
> +
> #include "NepomukCollection.h"
> #include "NepomukQueryMaker.h"
>
> +#include "Debug.h"
> +
> #include <klocale.h>
> +#include <Nepomuk/ResourceManager>
>
>
> AMAROK_EXPORT_PLUGIN( NepomukCollectionFactory )
> @@ -29,16 +34,21 @@
> void
> NepomukCollectionFactory::init()
> {
> -	// TODO: Check if Nepomuk is running
> -	Collection* collection = new NepomukCollection();
> -	emit newCollection( collection );
> +    if ( Nepomuk::ResourceManager::instance()->init() == 0 )
> +    {
> +        Collection* collection = new NepomukCollection();
> +        emit newCollection( collection );
> +    }
> +    else
> +        warning() << "Nepomuk is not running, can not init Nepomuk  
> Collection" << endl;
> +
> }
>
> // NepomukCollection
>
> NepomukCollection::NepomukCollection()
> {
> -
> +	
> }
>
> NepomukCollection::~NepomukCollection()



More information about the Amarok-devel mailing list