• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

NepomukDaemons

strigiserviceadaptor.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE Project
00002    Copyright (c) 2008 Sebastian Trueg <trueg@kde.org>
00003 
00004    Based on code generated by dbusxml2cpp version 0.6
00005    dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved.
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License version 2 as published by the Free Software Foundation.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #include "strigiserviceadaptor.h"
00023 #include "strigiservice.h"
00024 #include "indexscheduler.h"
00025 
00026 #include <QtCore/QUrl>
00027 #include <QtCore/QDateTime>
00028 #include <QtCore/QFile>
00029 #include <QtCore/QDataStream>
00030 
00031 #include <KDebug>
00032 
00033 
00034 Nepomuk::StrigiServiceAdaptor::StrigiServiceAdaptor( IndexScheduler* scheduler, StrigiService* parent )
00035     : QDBusAbstractAdaptor(parent),
00036       m_indexScheduler( scheduler )
00037 {
00038     connect( m_indexScheduler, SIGNAL( indexingStarted() ),
00039              this, SIGNAL( indexingStarted() ) );
00040     connect( m_indexScheduler, SIGNAL( indexingStopped() ),
00041              this, SIGNAL( indexingStopped() ) );
00042     connect( m_indexScheduler, SIGNAL( indexingFolder(QString) ),
00043              this, SIGNAL( indexingFolder(QString) ) );
00044 }
00045 
00046 
00047 Nepomuk::StrigiServiceAdaptor::~StrigiServiceAdaptor()
00048 {
00049 }
00050 
00051 
00052 bool Nepomuk::StrigiServiceAdaptor::isIndexing()
00053 {
00054     // handle method call org.kde.nepomuk.Strigi.isIndexing
00055     return m_indexScheduler->isIndexing();
00056 }
00057 
00058 
00059 bool Nepomuk::StrigiServiceAdaptor::isSuspended()
00060 {
00061     // handle method call org.kde.nepomuk.Strigi.isSuspended
00062     return m_indexScheduler->isSuspended();
00063 }
00064 
00065 
00066 QString Nepomuk::StrigiServiceAdaptor::currentFolder()
00067 {
00068     return m_indexScheduler->currentFolder();
00069 }
00070 
00071 
00072 void Nepomuk::StrigiServiceAdaptor::resume()
00073 {
00074     // handle method call org.kde.nepomuk.Strigi.resume
00075     m_indexScheduler->resume();
00076 }
00077 
00078 
00079 void Nepomuk::StrigiServiceAdaptor::suspend()
00080 {
00081     // handle method call org.kde.nepomuk.Strigi.suspend
00082     m_indexScheduler->suspend();
00083 }
00084 
00085 
00086 void Nepomuk::StrigiServiceAdaptor::updateFolder( const QString& path )
00087 {
00088     m_indexScheduler->updateDir( path );
00089 }
00090 
00091 
00092 void Nepomuk::StrigiServiceAdaptor::updateAllFolders()
00093 {
00094     m_indexScheduler->updateAll();
00095 }
00096 
00097 
00098 void Nepomuk::StrigiServiceAdaptor::analyzeResource( const QString& uri, uint mTime, const QByteArray& data )
00099 {
00100     QDataStream stream( data );
00101     m_indexScheduler->analyzeResource( QUrl::fromEncoded( uri.toAscii() ), QDateTime::fromTime_t( mTime ), stream );
00102 }
00103 
00104 
00105 void Nepomuk::StrigiServiceAdaptor::analyzeResourceFromTempFileAndDeleteTempFile( const QString& uri, uint mTime, const QString& tmpFile )
00106 {
00107     QFile file( tmpFile );
00108     if ( file.open( QIODevice::ReadOnly ) ) {
00109         QDataStream stream( &file );
00110         m_indexScheduler->analyzeResource( QUrl::fromEncoded( uri.toAscii() ), QDateTime::fromTime_t( mTime ), stream );
00111         file.remove();
00112     }
00113     else {
00114         kDebug() << "Failed to open" << tmpFile;
00115     }
00116 }

NepomukDaemons

Skip menu "NepomukDaemons"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal