Changeset View
Changeset View
Standalone View
Standalone View
rdp/rdpview.cpp
Show All 28 Lines | |||||
29 | #include "krdc_debug.h" | 29 | #include "krdc_debug.h" | ||
30 | 30 | | |||
31 | #include <KMessageBox> | 31 | #include <KMessageBox> | ||
32 | #include <KPasswordDialog> | 32 | #include <KPasswordDialog> | ||
33 | #include <KShell> | 33 | #include <KShell> | ||
34 | #include <KWindowSystem> | 34 | #include <KWindowSystem> | ||
35 | 35 | | |||
36 | #include <QWindow> | 36 | #include <QWindow> | ||
37 | #include <QDir> | ||||
37 | #include <QEvent> | 38 | #include <QEvent> | ||
38 | #include <QInputDialog> | 39 | #include <QInputDialog> | ||
39 | 40 | | |||
40 | RdpView::RdpView(QWidget *parent, | 41 | RdpView::RdpView(QWidget *parent, | ||
41 | const QUrl &url, | 42 | const QUrl &url, | ||
42 | KConfigGroup configGroup, | 43 | KConfigGroup configGroup, | ||
43 | const QString &user, const QString &password) | 44 | const QString &user, const QString &password) | ||
44 | : RemoteView(parent), | 45 | : RemoteView(parent), | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
108 | { | 109 | { | ||
109 | return m_quitFlag; | 110 | return m_quitFlag; | ||
110 | } | 111 | } | ||
111 | 112 | | |||
112 | bool RdpView::start() | 113 | bool RdpView::start() | ||
113 | { | 114 | { | ||
114 | m_containerWidget->show(); | 115 | m_containerWidget->show(); | ||
115 | 116 | | |||
117 | const QString shareMediaPath = m_hostPreferences->shareMedia(); | ||||
118 | if (!shareMediaPath.isEmpty()) { | ||||
119 | if (!QDir().exists(shareMediaPath)) { | ||||
volkov: Can a directory be not readable? | |||||
I just double checked and it doesn't matter if the directory is readable or not (at least for my particular verison of xfreerdp) aacid: I just double checked and it doesn't matter if the directory is readable or not (at least for… | |||||
Hmmm, QDir().exists(shareMediaPath) only checks for the existence of shareMediaPath, it doesn't check that it's a directory. volkov: Hmmm, `QDir().exists(shareMediaPath)` only checks for the existence of `shareMediaPath`, it… | |||||
true, i totally failed at reading the docu Though it's funny since it actually "works" (i.e. not fails to start that was my original problem) if you give it a file path too, but let's stick with dirs aacid: true, i totally failed at reading the docu
Though it's funny since it actually "works" (i.e. | |||||
120 | QMessageBox::critical(this, i18n("Media Folder doesn't exist"), i18n("Folder %1 does not exist.\nPlease set an existing folder to share or empty the \"Share Media\" option if you don't want to share any folder.", shareMediaPath)); | ||||
Since this is a new string, please use the correct HIG style:
Also a small nit: "Folder %1 does not exist." -> "The folder %1 does not exist." pino: Since this is a new string, please use the correct HIG style:
- no contractions, so "don't" ->… | |||||
121 | return false; | ||||
122 | } | ||||
123 | } | ||||
124 | | ||||
116 | if (m_url.userName().isEmpty()) { | 125 | if (m_url.userName().isEmpty()) { | ||
117 | QString userName; | 126 | QString userName; | ||
118 | bool ok = false; | 127 | bool ok = false; | ||
119 | 128 | | |||
120 | userName = QInputDialog::getText(this, i18n("Enter Username"), | 129 | userName = QInputDialog::getText(this, i18n("Enter Username"), | ||
121 | i18n("Please enter the username you would like to use for login."), | 130 | i18n("Please enter the username you would like to use for login."), | ||
122 | QLineEdit::Normal, Settings::defaultRdpUserName(), &ok); | 131 | QLineEdit::Normal, Settings::defaultRdpUserName(), &ok); | ||
123 | 132 | | |||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 183 | if (versionOutput.contains(QLatin1String(" 1.0"))) { | |||
202 | case 0: | 211 | case 0: | ||
203 | arguments << QStringLiteral("--plugin") << QStringLiteral("rdpsnd"); | 212 | arguments << QStringLiteral("--plugin") << QStringLiteral("rdpsnd"); | ||
204 | break; | 213 | break; | ||
205 | case 2: | 214 | case 2: | ||
206 | default: | 215 | default: | ||
207 | break; | 216 | break; | ||
208 | } | 217 | } | ||
209 | 218 | | |||
210 | if (!m_hostPreferences->shareMedia().isEmpty()) { | 219 | if (!shareMediaPath.isEmpty()) { | ||
211 | QStringList shareMedia; | 220 | QStringList shareMedia; | ||
212 | shareMedia << QStringLiteral("--plugin") << QStringLiteral("rdpdr") | 221 | shareMedia << QStringLiteral("--plugin") << QStringLiteral("rdpdr") | ||
213 | << QStringLiteral("--data") << QStringLiteral("disk:media:") | 222 | << QStringLiteral("--data") << QStringLiteral("disk:media:") | ||
214 | + m_hostPreferences->shareMedia() << QStringLiteral("--"); | 223 | + shareMediaPath << QStringLiteral("--"); | ||
215 | arguments += shareMedia; | 224 | arguments += shareMedia; | ||
216 | } | 225 | } | ||
217 | 226 | | |||
218 | QString performance; | 227 | QString performance; | ||
219 | switch (m_hostPreferences->performance()) { | 228 | switch (m_hostPreferences->performance()) { | ||
220 | case 0: | 229 | case 0: | ||
221 | performance = QLatin1Char('m'); | 230 | performance = QLatin1Char('m'); | ||
222 | break; | 231 | break; | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 302 | case 0: | |||
295 | break; | 304 | break; | ||
296 | case 1: | 305 | case 1: | ||
297 | arguments << QStringLiteral("/sound:sys:pulse"); | 306 | arguments << QStringLiteral("/sound:sys:pulse"); | ||
298 | break; | 307 | break; | ||
299 | default: | 308 | default: | ||
300 | break; | 309 | break; | ||
301 | } | 310 | } | ||
302 | 311 | | |||
303 | if (!m_hostPreferences->shareMedia().isEmpty()) { | 312 | if (!shareMediaPath.isEmpty()) { | ||
304 | QStringList shareMedia; | 313 | QStringList shareMedia; | ||
305 | shareMedia << QStringLiteral("/drive:media,") + m_hostPreferences->shareMedia(); | 314 | shareMedia << QStringLiteral("/drive:media,") + shareMediaPath; | ||
306 | arguments += shareMedia; | 315 | arguments += shareMedia; | ||
307 | } | 316 | } | ||
308 | 317 | | |||
309 | QString performance; | 318 | QString performance; | ||
310 | switch (m_hostPreferences->performance()) { | 319 | switch (m_hostPreferences->performance()) { | ||
311 | case 0: | 320 | case 0: | ||
312 | performance = QStringLiteral("modem"); | 321 | performance = QStringLiteral("modem"); | ||
313 | break; | 322 | break; | ||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |
Can a directory be not readable?