KIO

kdirnotify.cpp
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2000-2012 David Faure <faure@kde.org>
4 SPDX-FileCopyrightText: 2006 Thiago Macieira <thiago@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include "kdirnotify.h"
10#include <QUrl>
11
12/*
13 * Implementation of interface class OrgKdeKDirNotifyInterface
14 */
15
16OrgKdeKDirNotifyInterface::OrgKdeKDirNotifyInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
17 : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
18{
19}
20
21OrgKdeKDirNotifyInterface::~OrgKdeKDirNotifyInterface()
22{
23}
24
25static void emitSignal(const QString &signalName, const QVariantList &args)
26{
27 QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/"), QLatin1String(org::kde::KDirNotify::staticInterfaceName()), signalName);
28 message.setArguments(args);
30}
31
32void OrgKdeKDirNotifyInterface::emitFileRenamed(const QUrl &src, const QUrl &dst)
33{
34 emitSignal(QStringLiteral("FileRenamed"), QVariantList{src.toString(), dst.toString()});
35 emitSignal(QStringLiteral("FileRenamedWithLocalPath"), QVariantList{src.toString(), dst.toString(), QString()});
36}
37
38void OrgKdeKDirNotifyInterface::emitFileRenamedWithLocalPath(const QUrl &src, const QUrl &dst, const QString &dstPath)
39{
40 emitSignal(QStringLiteral("FileRenamed"), QVariantList{src.toString(), dst.toString()});
41 emitSignal(QStringLiteral("FileRenamedWithLocalPath"), QVariantList{src.toString(), dst.toString(), dstPath});
42}
43
44void OrgKdeKDirNotifyInterface::emitFileMoved(const QUrl &src, const QUrl &dst)
45{
46 emitSignal(QStringLiteral("FileMoved"), QVariantList{src.toString(), dst.toString()});
47}
48
49void OrgKdeKDirNotifyInterface::emitFilesAdded(const QUrl &directory)
50{
51 emitSignal(QStringLiteral("FilesAdded"), QVariantList{QVariant(directory.toString())});
52}
53
54void OrgKdeKDirNotifyInterface::emitFilesChanged(const QList<QUrl> &fileList)
55{
56 emitSignal(QStringLiteral("FilesChanged"), QVariantList{QVariant(QUrl::toStringList(fileList))});
57}
58
59void OrgKdeKDirNotifyInterface::emitFilesRemoved(const QList<QUrl> &fileList)
60{
61 emitSignal(QStringLiteral("FilesRemoved"), QVariantList{QVariant(QUrl::toStringList(fileList))});
62}
63
64void OrgKdeKDirNotifyInterface::emitEnteredDirectory(const QUrl &url)
65{
66 emitSignal(QStringLiteral("enteredDirectory"), QVariantList{QVariant(url.toString())});
67}
68
69void OrgKdeKDirNotifyInterface::emitLeftDirectory(const QUrl &url)
70{
71 emitSignal(QStringLiteral("leftDirectory"), QVariantList{QVariant(url.toString())});
72}
73
74#include "moc_kdirnotify.cpp"
QString path(const QString &relativePath)
bool send(const QDBusMessage &message) const const
QDBusConnection sessionBus()
QDBusMessage createSignal(const QString &path, const QString &interface, const QString &name)
void setArguments(const QList< QVariant > &arguments)
QString toString(FormattingOptions options) const const
QStringList toStringList(const QList< QUrl > &urls, FormattingOptions options)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:04:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.