diff --git a/rdp/rdpview.cpp b/rdp/rdpview.cpp --- a/rdp/rdpview.cpp +++ b/rdp/rdpview.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -113,6 +114,14 @@ { m_containerWidget->show(); + const QString shareMediaPath = m_hostPreferences->shareMedia(); + if (!shareMediaPath.isEmpty()) { + if (!QDir(shareMediaPath).exists()) { + QMessageBox::critical(this, i18n("Media Folder does not Exist"), i18n("The folder %1 does not exist.\nPlease set an existing folder to share or empty the \"Share Media\" option if you do not want to share any folder.", shareMediaPath)); + return false; + } + } + if (m_url.userName().isEmpty()) { QString userName; bool ok = false; @@ -207,11 +216,11 @@ break; } - if (!m_hostPreferences->shareMedia().isEmpty()) { + if (!shareMediaPath.isEmpty()) { QStringList shareMedia; shareMedia << QStringLiteral("--plugin") << QStringLiteral("rdpdr") << QStringLiteral("--data") << QStringLiteral("disk:media:") - + m_hostPreferences->shareMedia() << QStringLiteral("--"); + + shareMediaPath << QStringLiteral("--"); arguments += shareMedia; } @@ -300,9 +309,9 @@ break; } - if (!m_hostPreferences->shareMedia().isEmpty()) { + if (!shareMediaPath.isEmpty()) { QStringList shareMedia; - shareMedia << QStringLiteral("/drive:media,") + m_hostPreferences->shareMedia(); + shareMedia << QStringLiteral("/drive:media,") + shareMediaPath; arguments += shareMedia; }