mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kdirshare: hide the server label when directory is not shared
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9947a16c2c
commit
8559352bde
1 changed files with 7 additions and 2 deletions
|
@ -66,7 +66,7 @@ KDirSharePlugin::KDirSharePlugin(QObject *parent, const QList<QVariant> &args)
|
|||
m_ui.sharebox->setChecked(kdirsharereply.value());
|
||||
m_ui.portgroup->setEnabled(kdirsharereply.value());
|
||||
m_ui.authgroup->setEnabled(kdirsharereply.value());
|
||||
m_ui.serverlabel->setVisible(true);
|
||||
m_ui.serverlabel->setVisible(kdirsharereply.value());
|
||||
}
|
||||
|
||||
QDBusReply<quint16> kdirsharereply2 = m_kdirshareiface.call("getPortMin", m_url);
|
||||
|
@ -225,11 +225,16 @@ void KDirSharePlugin::slotPasswordEdited(const QString &value)
|
|||
void KDirSharePlugin::updateServerLabel()
|
||||
{
|
||||
QDBusReply<QString> kdirsharereply = m_kdirshareiface.call("getAddress", m_url);
|
||||
QString kdirshareaddress;
|
||||
if (!kdirsharereply.isValid()) {
|
||||
kWarning() << "Invalid kdirshare module reply for getAddress()";
|
||||
m_ui.serverlabel->setText(QString());
|
||||
} else {
|
||||
const QString kdirshareaddress = kdirsharereply.value();
|
||||
kdirshareaddress = kdirsharereply.value();
|
||||
}
|
||||
if (kdirshareaddress.isEmpty()) {
|
||||
m_ui.serverlabel->setText(QString());
|
||||
} else {
|
||||
m_ui.serverlabel->setText(i18n("<html>The directory can be accessed at <a href=\"%1\">%1</a>.</html>", kdirshareaddress));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue