generic: drop support for webdav protocol

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-02-16 15:51:32 +02:00
parent e1736b0918
commit 17cf6caa0e
7 changed files with 68 additions and 179 deletions

View file

@ -55,14 +55,6 @@ static const char* const SimpleServiceMimetype[] =
"nfs",
"afpovertcp",
"smb",
"webdav",
"webdavs",
"svn",
"rsync",
"pop3",
"imap",
"ssh",
"telnet",

View file

@ -97,36 +97,6 @@ Notes:
<generic-icon name="folder-remote"/>
<comment>SMB server</comment>
</mime-type>
<mime-type type="inode/vnd.kde.service.webdav">
<sub-class-of type="inode/directory"/>
<generic-icon name="folder-remote"/>
<comment>WebDav server</comment>
</mime-type>
<mime-type type="inode/vnd.kde.service.webdavs">
<sub-class-of type="inode/directory"/>
<generic-icon name="folder-remote"/>
<comment>WebDav secure server</comment>
</mime-type>
<mime-type type="inode/vnd.kde.service.svn">
<sub-class-of type="inode/directory"/>
<generic-icon name="folder-sync"/>
<comment>Subversion server</comment>
</mime-type>
<mime-type type="inode/vnd.kde.service.rsync">
<generic-icon name="folder-sync"/>
<comment>RSync server</comment>
</mime-type>
<!-- email -->
<mime-type type="inode/vnd.kde.service.pop3">
<generic-icon name="email"/>
<comment>POP3 server</comment>
</mime-type>
<mime-type type="inode/vnd.kde.service.imap">
<generic-icon name="email"/>
<comment>IMAP server</comment>
</mime-type>
<!-- shell services -->
<mime-type type="inode/vnd.kde.service.ssh">

View file

@ -61,15 +61,6 @@ static const DNSSDServiceDatum DNSSDServiceData[] =
{ "_nfs._tcp", "nfs", "folder-remote", true, "nfs", "path", 0, 0, 0 },
{ "_afpovertcp._tcp", "afpovertcp", "folder-remote", true, "afp", "path", 0, 0, 0 },
{ "_smb._tcp", "smb", "folder-remote", true, "smb", "path", 0, "u", "p" },
{ "_webdav._tcp", "webdav", "folder-remote", true, "webdav", "path", 0, "u", "p" },
{ "_webdavs._tcp", "webdavs", "folder-remote", true, "webdavs", "path", 0, "u", "p" },
{ "_svn._tcp", "svn", "folder-sync", true, 0, 0, 0, 0, 0 },
{ "_rsync._tcp", "rsync", "folder-sync", true, 0, 0, 0, 0, 0 },
// email
{ "_imap._tcp", "imap", "email", false, 0, 0, 0, 0, 0 },
{ "_pop3._tcp", "pop3", "email", false, "pop3", 0, 0, 0, 0 },
// shell services
{ "_ssh._tcp", "ssh", "terminal", false, "ssh", 0, 0, "u", "p" },

View file

@ -42,7 +42,6 @@ KNetAttach::KNetAttach( QWidget* parent )
{
setupUi( this );
_webfolder->setEnabled(KProtocolInfo::isKnownProtocol("webdav"));
_ftp->setEnabled(KProtocolInfo::isKnownProtocol("ftp"));
_smb->setEnabled(KProtocolInfo::isKnownProtocol("smb"));
_sftp->setEnabled(KProtocolInfo::isKnownProtocol("sftp"));
@ -52,7 +51,6 @@ KNetAttach::KNetAttach( QWidget* parent )
connect(_user, SIGNAL(textChanged(QString)), this, SLOT(updateParametersPageStatus()));
connect(_host, SIGNAL(textChanged(QString)), this, SLOT(updateParametersPageStatus()));
connect(_path, SIGNAL(textChanged(QString)), this, SLOT(updateParametersPageStatus()));
connect(_useEncryption, SIGNAL(toggled(bool)), this, SLOT(updatePort(bool)));
connect(_createIcon, SIGNAL(toggled(bool)), this, SLOT(updateFinishButtonText(bool)));
connect( this, SIGNAL(helpRequested()), this, SLOT(slotHelpClicked()) );
connect( this, SIGNAL(currentIdChanged(int)), this, SLOT(slotPageChanged(int)) );
@ -65,9 +63,6 @@ KNetAttach::KNetAttach( QWidget* parent )
QStringList idx = recent.readEntry("Index",QStringList());
if (idx.isEmpty()) {
_recent->setEnabled(false);
if (_recent->isChecked()) {
_webfolder->setChecked(true);
}
} else {
_recent->setEnabled(true);
_recentConnectionName->addItems(idx);
@ -92,9 +87,7 @@ void KNetAttach::setInformationText(const QString &type)
{
QString text;
if (type=="WebFolder") {
text = i18n("Enter a name for this <i>WebFolder</i> as well as a server address, port and folder path to use and press the <b>Save & Connect</b> button.");
} else if (type=="SFTP") {
if (type=="SFTP") {
text = i18n("Enter a name for this <i>SSH File Transfer Protocol</i> as well as a server address, port and folder path to use and press the <b>Save & Connect</b> button.");
} else if (type=="FTP") {
text = i18n("Enter a name for this <i>File Transfer Protocol connection</i> as well as a server address and folder path to use and press the <b>Save & Connect</b> button.");
@ -120,11 +113,7 @@ bool KNetAttach::validateCurrentPage()
_host->setFocus();
_connectionName->setFocus();
if (_webfolder->isChecked()) {
setInformationText("WebFolder");
updateForProtocol("WebFolder");
_port->setValue(80);
} else if (_sftp->isChecked()) {
if (_sftp->isChecked()) {
setInformationText("SFTP");
updateForProtocol("SFTP");
_port->setValue(22);
@ -148,9 +137,6 @@ bool KNetAttach::validateCurrentPage()
QStringList idx = group.readEntry("Index",QStringList());
if (idx.isEmpty()) {
_recent->setEnabled(false);
if (_recent->isChecked()) {
_webfolder->setChecked(true);
}
} else {
_recent->setEnabled(true);
_recentConnectionName->addItems(idx);
@ -180,14 +166,7 @@ bool KNetAttach::validateCurrentPage()
button(BackButton)->setEnabled(false);
button(FinishButton)->setEnabled(false);
KUrl url;
if (_type == "WebFolder") {
if (_useEncryption->isChecked()) {
url.setProtocol("webdavs");
} else {
url.setProtocol("webdav");
}
url.setPort(_port->value());
} else if (_type == "SFTP") {
if (_type == "SFTP") {
url.setProtocol("sftp");
url.setPort(_port->value());
} else if (_type == "FTP") {
@ -260,7 +239,7 @@ bool KNetAttach::validateCurrentPage()
}
recent = KConfigGroup(&_recent,name);
recent.writeEntry("URL", url.prettyUrl());
if (_type == "WebFolder" || _type == "SFTP" || _type == "FTP") {
if ( _type == "SFTP" || _type == "FTP") {
recent.writeEntry("Port", _port->value());
}
recent.writeEntry("Type", _type);
@ -270,19 +249,6 @@ bool KNetAttach::validateCurrentPage()
return true;
}
void KNetAttach::updatePort(bool encryption)
{
if (_webfolder->isChecked()) {
if (encryption) {
_port->setValue(443);
} else {
_port->setValue(80);
}
}
}
bool KNetAttach::doConnectionTest(const KUrl& url)
{
KIO::UDSEntry entry;
@ -293,20 +259,10 @@ bool KNetAttach::doConnectionTest(const KUrl& url)
return false;
}
bool KNetAttach::updateForProtocol(const QString& protocol)
{
_type = protocol;
if (protocol == "WebFolder") {
_useEncryption->show();
_portText->show();
_port->show();
_userText->show();
_user->show();
_encodingText->hide();
_encoding->hide();
} else if (protocol == "SFTP") {
_useEncryption->hide();
if (protocol == "SFTP") {
_portText->show();
_port->show();
_userText->show();
@ -314,7 +270,6 @@ bool KNetAttach::updateForProtocol(const QString& protocol)
_encodingText->hide();
_encoding->hide();
} else if (protocol == "FTP") {
_useEncryption->hide();
_portText->show();
_port->show();
_userText->show();
@ -322,7 +277,6 @@ bool KNetAttach::updateForProtocol(const QString& protocol)
_encodingText->show();
_encoding->show();
} else if (protocol == "SMB") {
_useEncryption->hide();
_portText->hide();
_port->hide();
_userText->hide();
@ -336,7 +290,6 @@ bool KNetAttach::updateForProtocol(const QString& protocol)
return true;
}
void KNetAttach::updateFinishButtonText(bool save)
{
if (save) {

View file

@ -41,7 +41,6 @@ private:
private slots:
void updateParametersPageStatus();
bool validateCurrentPage();
void updatePort( bool encryption );
void updateFinishButtonText( bool save );
void slotHelpClicked();
void slotPageChanged( int );

View file

@ -59,34 +59,14 @@
<property name="margin">
<number>0</number>
</property>
<item row="4" column="0">
<item row="3" column="0">
<widget class="QRadioButton" name="_recent">
<property name="text">
<string>&amp;Recent connection:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QRadioButton" name="_webfolder">
<property name="text">
<string>&amp;WebFolder (webdav)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QRadioButton" name="_sftp">
<property name="text">
<string>&amp;SSH File Transfer Protocol (sftp)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="3" column="1">
<widget class="KComboBox" name="_recentConnectionName">
<property name="enabled">
<bool>false</bool>
@ -105,17 +85,30 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QRadioButton" name="_sftp">
<property name="text">
<string>&amp;SSH File Transfer Protocol (sftp)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QRadioButton" name="_smb">
<property name="text">
<string>&amp;Microsoft® Windows® network drive (smb)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QRadioButton" name="_ftp">
<property name="text">
<string>&amp;File Transfer Protocol (ftp)</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QRadioButton" name="_smb">
<property name="text">
<string>&amp;Microsoft® Windows® network drive (smb)</string>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
@ -145,6 +138,19 @@
<string>Network Folder Information</string>
</property>
<layout class="QGridLayout" name="gridLayout1">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="_informationText">
<property name="text">
<string>Enter a name for this &lt;i&gt;%1&lt;/i&gt; as well as the server address, port and folder path to use and press the Next button.</string>
</property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="textLabel4_2">
<property name="text">
@ -161,19 +167,6 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="_informationText">
<property name="text">
<string>Enter a name for this &lt;i&gt;%1&lt;/i&gt; as well as the server address, port and folder path to use and press the Next button.</string>
</property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="_userText">
<property name="text">
@ -190,6 +183,9 @@
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="KLineEdit" name="_connectionName"/>
</item>
<item row="1" column="2">
<spacer name="spacer20_2">
<property name="orientation">
@ -206,8 +202,15 @@
</property>
</spacer>
</item>
<item row="2" column="1" colspan="2">
<widget class="KLineEdit" name="_connectionName"/>
<item row="3" column="1" colspan="2">
<widget class="KLineEdit" name="_user">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel1">
@ -225,8 +228,8 @@
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="KLineEdit" name="_user">
<item row="4" column="1" colspan="2">
<widget class="KLineEdit" name="_host">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>10</horstretch>
@ -251,13 +254,19 @@
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="KLineEdit" name="_host">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="6" column="0">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>&amp;Folder:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>_path</cstring>
</property>
</widget>
</item>
@ -280,22 +289,6 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>&amp;Folder:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>_path</cstring>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="KLineEdit" name="_path"/>
</item>
@ -328,14 +321,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="_useEncryption">
<property name="text">
<string>&amp;Use encryption</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
<item row="9" column="0" colspan="3">
<spacer name="spacer5">
<property name="orientation">
<enum>Qt::Vertical</enum>

View file

@ -43,9 +43,7 @@ FixHostUriFilter::FixHostUriFilter(QObject *parent, const QVariantList & /*args*
static bool isHttpUrl(const QString& scheme)
{
return (scheme.compare(QL1S("http"), Qt::CaseInsensitive) == 0 ||
scheme.compare(QL1S("https"), Qt::CaseInsensitive) == 0 ||
scheme.compare(QL1S("webdav"), Qt::CaseInsensitive) == 0 ||
scheme.compare(QL1S("webdavs"), Qt::CaseInsensitive) == 0);
scheme.compare(QL1S("https"), Qt::CaseInsensitive) == 0);
}
static bool hasCandidateHostName(const QString& host)