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

NepomukDaemons

folderconnection.cpp

Go to the documentation of this file.
00001 /*
00002    Copyright (c) 2008 Sebastian Trueg <trueg@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include "folderconnection.h"
00020 #include "folder.h"
00021 
00022 #include <QtCore/QStringList>
00023 
00024 #include <KDebug>
00025 
00026 Nepomuk::Search::FolderConnection::FolderConnection( Folder* folder )
00027     : QObject( folder ),
00028       m_folder( folder )
00029 {
00030     connect( m_folder, SIGNAL( newEntries( QList<Nepomuk::Search::Result> ) ),
00031              this, SIGNAL( newEntries( QList<Nepomuk::Search::Result> ) ) );
00032     connect( m_folder, SIGNAL( entriesRemoved( QList<QUrl> ) ),
00033              this, SLOT( slotEntriesRemoved( QList<QUrl> ) ) );
00034     connect( m_folder, SIGNAL( finishedListing() ),
00035              this, SIGNAL( finishedListing() ) );
00036 
00037     m_folder->addConnection( this );
00038 }
00039 
00040 
00041 Nepomuk::Search::FolderConnection::~FolderConnection()
00042 {
00043     m_folder->removeConnection( this );
00044 }
00045 
00046 
00047 void Nepomuk::Search::FolderConnection::list()
00048 {
00049     kDebug();
00050     if ( !m_folder->entries().isEmpty() ) {
00051         emit newEntries( m_folder->entries() );
00052     }
00053     if ( m_folder->initialListingDone() ) {
00054         emit finishedListing();
00055     }
00056     else {
00057         // make sure the search has actually been started
00058         m_folder->update();
00059     }
00060 }
00061 
00062 
00063 void Nepomuk::Search::FolderConnection::slotEntriesRemoved( QList<QUrl> entries )
00064 {
00065     QStringList uris;
00066     for ( int i = 0; i < entries.count(); ++i ) {
00067         uris.append( entries[i].toString() );
00068     }
00069     emit entriesRemoved( uris );
00070 }
00071 
00072 
00073 void Nepomuk::Search::FolderConnection::close()
00074 {
00075     kDebug();
00076     deleteLater();
00077 }
00078 
00079 #include "folderconnection.moc"

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