Cleanup signals and slots in SftpPlugin
This commit is contained in:
parent
1ef9d7e2a0
commit
45615f8acf
4 changed files with 11 additions and 18 deletions
|
@ -24,8 +24,6 @@ Mounter::Mounter(SftpPlugin *sftp)
|
|||
, m_mountPoint(sftp->mountPoint())
|
||||
, m_started(false)
|
||||
{
|
||||
connect(m_sftp, &SftpPlugin::packetReceived, this, &Mounter::onPackageReceived);
|
||||
|
||||
connect(&m_connectTimer, &QTimer::timeout, this, &Mounter::onMountTimeout);
|
||||
|
||||
connect(this, &Mounter::mounted, &m_connectTimer, &QTimer::stop);
|
||||
|
@ -58,7 +56,7 @@ bool Mounter::wait()
|
|||
return loop.exec();
|
||||
}
|
||||
|
||||
void Mounter::onPackageReceived(const NetworkPacket &np)
|
||||
void Mounter::onPacketReceived(const NetworkPacket &np)
|
||||
{
|
||||
if (np.get<bool>(QStringLiteral("stop"), false)) {
|
||||
qCDebug(KDECONNECT_PLUGIN_SFTP) << "SFTP server stopped";
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
{
|
||||
return m_started;
|
||||
}
|
||||
void onPacketReceived(const NetworkPacket &np);
|
||||
|
||||
Q_SIGNALS:
|
||||
void mounted();
|
||||
|
@ -32,7 +33,6 @@ Q_SIGNALS:
|
|||
void failed(const QString &message);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPackageReceived(const NetworkPacket &np);
|
||||
void onStarted();
|
||||
void onError(QProcess::ProcessError error);
|
||||
void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
|
|
|
@ -130,7 +130,7 @@ void SftpPlugin::receivePacket(const NetworkPacket &np)
|
|||
return;
|
||||
}
|
||||
|
||||
Q_EMIT packetReceived(np);
|
||||
d->m_mounter->onPacketReceived(np);
|
||||
|
||||
remoteDirectories.clear();
|
||||
if (np.has(QStringLiteral("multiPaths"))) {
|
||||
|
|
|
@ -26,32 +26,24 @@ public:
|
|||
return QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/sftp");
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void packetReceived(const NetworkPacket &np);
|
||||
Q_SCRIPTABLE void mounted();
|
||||
Q_SCRIPTABLE void unmounted();
|
||||
|
||||
public Q_SLOTS:
|
||||
Q_SCRIPTABLE bool startBrowsing();
|
||||
Q_SCRIPTABLE void mount();
|
||||
Q_SCRIPTABLE void unmount();
|
||||
Q_SCRIPTABLE bool mountAndWait();
|
||||
Q_SCRIPTABLE bool isMounted() const;
|
||||
Q_SCRIPTABLE QString getMountError();
|
||||
|
||||
Q_SCRIPTABLE bool startBrowsing();
|
||||
Q_SCRIPTABLE QString mountPoint();
|
||||
Q_SCRIPTABLE QVariantMap getDirectories(); // Actually a QMap<String, String>, but QDBus prefers this
|
||||
|
||||
Q_SIGNALS:
|
||||
Q_SCRIPTABLE void mounted();
|
||||
Q_SCRIPTABLE void unmounted();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onMounted();
|
||||
void onUnmounted();
|
||||
void onFailed(const QString &message);
|
||||
|
||||
private:
|
||||
void knotify(int type, const QString &text, const QPixmap &icon) const;
|
||||
void addToDolphin();
|
||||
void removeFromDolphin();
|
||||
|
||||
private:
|
||||
struct Pimpl;
|
||||
QScopedPointer<Pimpl> d;
|
||||
|
@ -59,4 +51,7 @@ private:
|
|||
|
||||
QVariantMap remoteDirectories; // Actually a QMap<String, String>, but QDBus prefers this
|
||||
QString mountError;
|
||||
|
||||
void addToDolphin();
|
||||
void removeFromDolphin();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue