From 9b4eef061fa5345deef4be4f7e370b07d55c10a3 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 18 Jan 2013 18:04:52 +0100 Subject: [PATCH] Initial commit for scriptable collection. Just a stub. --- src/libtomahawk/CMakeLists.txt | 1 + src/libtomahawk/Collection.h | 3 ++ .../resolvers/ScriptCollection.cpp | 38 ++++++++++++++ src/libtomahawk/resolvers/ScriptCollection.h | 52 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 src/libtomahawk/resolvers/ScriptCollection.cpp create mode 100644 src/libtomahawk/resolvers/ScriptCollection.h diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index cc8d666ee..c3ac2c64c 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -89,6 +89,7 @@ set( libGuiSources ExternalResolverGui.cpp resolvers/ScriptResolver.cpp resolvers/QtScriptResolver.cpp + resolvers/ScriptCollection.cpp utils/ImageRegistry.cpp utils/WidgetDragFilter.cpp diff --git a/src/libtomahawk/Collection.h b/src/libtomahawk/Collection.h index f5121f70e..a5d202c7f 100644 --- a/src/libtomahawk/Collection.h +++ b/src/libtomahawk/Collection.h @@ -90,6 +90,9 @@ signals: void changed(); public slots: + //TODO: should be made private and the dbcmd friended + // and can probably be moved into database collection + // it's a slot so the dynamic hookup will work virtual void addTracks( const QList& newitems ) = 0; virtual void removeTracks( const QDir& dir ) = 0; diff --git a/src/libtomahawk/resolvers/ScriptCollection.cpp b/src/libtomahawk/resolvers/ScriptCollection.cpp new file mode 100644 index 000000000..b30ea41b8 --- /dev/null +++ b/src/libtomahawk/resolvers/ScriptCollection.cpp @@ -0,0 +1,38 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2013, Teo Mrnjavac + * + * Tomahawk 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. + * + * Tomahawk 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 Tomahawk. If not, see . + */ + + +#include "ScriptCollection.h" + +using namespace Tomahawk; + + +ScriptCollection::ScriptCollection( const source_ptr& source, + const QString& name, + QtScriptResolver* resolver, + QObject* parent ) + : Collection( source, name, parent ) +{ + +} + + +ScriptCollection::~ScriptCollection() +{ + +} diff --git a/src/libtomahawk/resolvers/ScriptCollection.h b/src/libtomahawk/resolvers/ScriptCollection.h new file mode 100644 index 000000000..a2f6d64c5 --- /dev/null +++ b/src/libtomahawk/resolvers/ScriptCollection.h @@ -0,0 +1,52 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2013, Teo Mrnjavac + * + * Tomahawk 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. + * + * Tomahawk 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 Tomahawk. If not, see . + */ + + +#ifndef SCRIPTCOLLECTION_H +#define SCRIPTCOLLECTION_H + +#include "resolvers/QtScriptResolver.h" +#include "Collection.h" + +#include "Typedefs.h" +#include "DllMacro.h" + + +namespace Tomahawk +{ + +class DLLEXPORT ScriptCollection : public Collection +{ + Q_OBJECT + +public: + explicit ScriptCollection( const source_ptr& source, + const QString& name, + QtScriptResolver* resolver, + QObject* parent = 0 ); + virtual ~ScriptCollection(); + +signals: + +public slots: + +}; + +} //ns + +#endif // SCRIPTCOLLECTION_H