]>
cloud.milkyroute.net Git - dolphin.git/blob - src/settings/applyviewpropsjob.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz19@gmail.com> *
4 * The code is based on kdelibs/kio/kio/directorysizejob.* *
5 * (C) 2006 by David Faure <faure@kde.org> *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
21 ***************************************************************************/
23 #ifndef APPLYVIEWPROPSJOB_H
24 #define APPLYVIEWPROPSJOB_H
32 * @brief Applies view properties recursively to directories.
36 * KJob* job = new ApplyViewPropsJob(dir, viewProps);
37 * connect(job, SIGNAL(result(KJob*)),
38 * this, SLOT(slotResult(KJob*)));
41 * To be able to show a progress of the operation, the following steps
43 * - Use a DirectorySizeJob to count the number of directories.
44 * - Use a timer to show the current count of directories by invoking
45 * DirectorySizeJob::totalSubdirs() until the result signal is emitted.
46 * - Use the ApplyViewPropsJob.
47 * - Use a timer to show the progress by invoking ApplyViwePropsJob::progress().
48 * In combination with the total directory count it is possible to show a
51 class ApplyViewPropsJob
: public KIO::Job
57 * @param dir Directory where the view properties should be applied to
58 * (including sub directories).
59 * @param viewProps View properties for the directory \a dir including its
62 ApplyViewPropsJob(const QUrl
& dir
, const ViewProperties
& viewProps
);
63 ~ApplyViewPropsJob() override
;
67 void slotResult(KJob
* job
) override
;
68 void slotEntries(KIO::Job
*, const KIO::UDSEntryList
&);
71 ViewProperties
* m_viewProps
;
77 inline int ApplyViewPropsJob::progress() const