1 /***************************************************************************
2 * Copyright (C) 2008 by Sebastian Trueg <trueg@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef _NEPOMUK_MASS_UPDATE_JOB_H_
21 #define _NEPOMUK_MASS_UPDATE_JOB_H_
26 #include <QtCore/QList>
27 #include <QtCore/QPair>
28 #include <QtCore/QTimer>
30 #include <nepomuk/resource.h>
31 #include <nepomuk/variant.h>
35 class MassUpdateJob
: public KJob
40 MassUpdateJob( QObject
* parent
= 0 );
44 * Set a list of files to change
45 * This has the same effect as using setResources
46 * with a list of manually created resources.
48 void setFiles( const KUrl::List
& urls
);
51 * Set a list of resources to change.
53 void setResources( const QList
<Nepomuk::Resource
>& );
56 * Set the properties to change in the mass update.
58 void setProperties( const QList
<QPair
<QUrl
,Nepomuk::Variant
> >& props
);
61 * Actually start the job.
65 static MassUpdateJob
* tagResources( const QList
<Nepomuk::Resource
>&, const QList
<Nepomuk::Tag
>& tags
);
66 static MassUpdateJob
* commentResources( const QList
<Nepomuk::Resource
>&, const QString
& comment
);
67 static MassUpdateJob
* rateResources( const QList
<Nepomuk::Resource
>&, int rating
);
78 QList
<Nepomuk::Resource
> m_resources
;
79 QList
<QPair
<QUrl
,Nepomuk::Variant
> > m_properties
;
81 QTimer m_processTimer
;