[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkde-runtime/gsoc2011/nepomuk/writeback=5D_nepomuk/s?=
From: Smit Shah <who828 () gmail ! com>
Date: 2011-06-02 17:43:26
Message-ID: 20110602174326.F0C41A60A9 () git ! kde ! org
[Download RAW message or body]
Git commit c9cd09479fdc75a34fb1e08c88f0f262d5f652a7 by Smit Shah.
Committed on 02/06/2011 at 18:50.
Pushed by smitshah into branch 'gsoc2011/nepomuk/writeback'.
Fixed my CMakelists, and now it compares metadata with inside nepomuk
M +3 -1 nepomuk/services/writeback/CMakeLists.txt
M +20 -10 nepomuk/services/writeback/mywritebackplugin.cpp
http://commits.kde.org/kde-runtime/c9cd09479fdc75a34fb1e08c88f0f262d5f652a7
diff --git a/nepomuk/services/writeback/CMakeLists.txt \
b/nepomuk/services/writeback/CMakeLists.txt index bb07c0d..bc97e8a 100644
--- a/nepomuk/services/writeback/CMakeLists.txt
+++ b/nepomuk/services/writeback/CMakeLists.txt
@@ -18,7 +18,9 @@ include_directories(
set( SRCS
mywritebackplugin.cpp
-writebackplugin.cpp)
+writebackplugin.cpp
+writebackservice.cpp
+)
kde4_add_plugin(nepomukwritebackservice ${SRCS})
diff --git a/nepomuk/services/writeback/mywritebackplugin.cpp \
b/nepomuk/services/writeback/mywritebackplugin.cpp index 6d172d9..3c2b38f 100644
--- a/nepomuk/services/writeback/mywritebackplugin.cpp
+++ b/nepomuk/services/writeback/mywritebackplugin.cpp
@@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include<QString>
+
+#include<QStringList>
#include <QFile>
#include <QUrl>
@@ -26,8 +27,12 @@ along with this program. If not, see \
<http://www.gnu.org/licenses/>. #include<taglib/tag.h>
#include<taglib/tstring.h>
-#include<mywritebackplugin.h>
+#include<Nepomuk/Resource>
+#include <Nepomuk/Vocabulary/NIE>
+#include <Nepomuk/Variant>
+#include<mywritebackplugin.h>
+using namespace Nepomuk::Vocabulary;
Nepomuk::MyWritebackPlugin::MyWritebackPlugin(QObject* parent): \
WritebackPlugin(parent)
{
@@ -42,18 +47,23 @@ Nepomuk::MyWritebackPlugin::~MyWritebackPlugin()
void Nepomuk::MyWritebackPlugin::doWriteback(const QUrl& url)
{
-
- // creating a reference of the file
+ Nepomuk::Resource resource(url);
+if(resource.exists())
+ {
+ // creatin Nepomuk::Resource resource(KUrl(url));
TagLib::FileRef f(QFile::encodeName( url.toLocalFile()).data());
// just an example
- f.tag()->setAlbum("Life");
- f.tag()->setTitle("Joy");
- f.tag()->setArtist("Who");
- f.tag()->setComment("this is the best song,ever !");
+ QString m_album = (resource.property(NIE::title())).toString();
+ if(Q4StringToTString(m_album) == f.tag()->album())
+{
+ f.tag()->setAlbum(Q4StringToTString(m_album));
+ // f.tag()->setTitle("Joy");
+ //f.tag()->setArtist("Who");
+ //f.tag()->setComment("this is the best song,ever !");
f.save();
emitFinished();
}
-
-
+}
+}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic