generic: remove code for features that Katie does not support

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-02-24 15:05:36 +02:00
parent 9e4be0165d
commit 7fb94a61fd
4 changed files with 3 additions and 194 deletions

View file

@ -288,14 +288,6 @@ KCmdLineArgsStatic::KCmdLineArgsStatic () {
qt_options.add("testability", ki18n("load the testability framework"));
#ifdef Q_WS_X11
qt_options.add("visual TrueColor", ki18n("forces the application to use a TrueColor visual on\nan 8-bit display"));
// TODO: maybe issue a warning that the options have no effect instead of making them unavailable
#ifndef QT_NO_IM
qt_options.add("im <XIM server>", ki18n("set XIM server"));
#endif
#ifndef QT_NO_XIM
qt_options.add("inputstyle <inputstyle>", ki18n("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"));
qt_options.add("noxim", ki18n("disable XIM"));
#endif
#endif // Q_WS_X11
qt_options.add("reverse", ki18n("mirrors the whole layout of widgets"));
qt_options.add("stylesheet <file.qss>", ki18n("applies the Qt stylesheet to the application widgets"));

View file

@ -198,22 +198,6 @@ bool KWidgetItemDelegateEventListener::eventFilter(QObject *watched, QEvent *eve
QApplication::sendEvent(viewport, &evt);
}
break;
#ifndef QT_NO_TABLET
case QEvent::TabletMove:
case QEvent::TabletPress:
case QEvent::TabletRelease:
case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity: {
QTabletEvent *tabletEvent = static_cast<QTabletEvent*>(event);
QTabletEvent evt(event->type(), viewport->mapFromGlobal(tabletEvent->globalPos()),
tabletEvent->globalPos(), tabletEvent->hiResGlobalPos(), tabletEvent->device(),
tabletEvent->pointerType(), tabletEvent->pressure(), tabletEvent->xTilt(),
tabletEvent->yTilt(), tabletEvent->tangentialPressure(), tabletEvent->rotation(),
tabletEvent->z(), tabletEvent->modifiers(), tabletEvent->uniqueId());
QApplication::sendEvent(viewport, &evt);
}
break;
#endif // QT_NO_TABLET
default:
QApplication::sendEvent(viewport, event);
break;

View file

@ -98,20 +98,6 @@ static char ftpModeFromPath(const QString& path, char defaultMode = '\0')
return defaultMode;
}
static bool supportedProxyScheme(const QString& scheme)
{
return (scheme == QLatin1String("ftp") || scheme == QLatin1String("socks"));
}
static bool isSocksProxy()
{
#ifndef QT_NO_NETWORKPROXY
return (QNetworkProxy::applicationProxy().type() == QNetworkProxy::Socks5Proxy);
#else
return false;
#endif
}
// JPF: somebody should find a better solution for this or move this to KIO
// JPF: anyhow, in KDE 3.2.0 I found diffent MAX_IPC_SIZE definitions!
@ -202,9 +188,6 @@ Ftp::Ftp( const QByteArray &pool, const QByteArray &app )
// init other members
m_port = 0;
#ifndef QT_NO_NETWORKPROXY
m_socketProxyAuth = 0;
#endif
}
@ -324,10 +307,6 @@ void Ftp::setHost( const QString& _host, quint16 _port, const QString& _user,
{
kDebug(7102) << _host << "port=" << _port << "user=" << _user;
m_proxyURL.clear();
m_proxyUrls = config()->readEntry("ProxyUrls", QStringList());
kDebug(7102) << "proxy urls:" << m_proxyUrls;
if ( m_host != _host || m_port != _port ||
m_user != _user || m_pass != _pass )
closeConnection();
@ -414,49 +393,7 @@ bool Ftp::ftpOpenConnection (LoginMode loginMode)
*/
bool Ftp::ftpOpenControlConnection()
{
#ifndef QT_NO_NETWORKPROXY
if (m_proxyUrls.isEmpty())
return ftpOpenControlConnection(m_host, m_port);
int errorCode = 0;
QString errorMessage;
Q_FOREACH (const QString& proxyUrl, m_proxyUrls) {
const KUrl url (proxyUrl);
const QString scheme (url.protocol());
if (!supportedProxyScheme(scheme)) {
// TODO: Need a new error code to indicate unsupported URL scheme.
errorCode = ERR_COULD_NOT_CONNECT;
errorMessage = url.url();
continue;
}
if (scheme == QLatin1String("socks")) {
kDebug(7102) << "Connecting to SOCKS proxy @" << url;
const int proxyPort = url.port();
QNetworkProxy proxy (QNetworkProxy::Socks5Proxy, url.host(), (proxyPort == -1 ? 0 : proxyPort));
QNetworkProxy::setApplicationProxy(proxy);
if (ftpOpenControlConnection(m_host, m_port)) {
return true;
}
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
} else {
if (ftpOpenControlConnection(url.host(), url.port())) {
m_proxyURL = url;
return true;
}
}
}
if (errorCode) {
error(errorCode, errorMessage);
}
return false;
#else
return ftpOpenControlConnection(m_host, m_port);
#endif // QT_NO_NETWORKPROXY
}
bool Ftp::ftpOpenControlConnection( const QString &host, int port )
@ -471,10 +408,6 @@ bool Ftp::ftpOpenControlConnection( const QString &host, int port )
m_control = new QTcpSocket();
m_control->connectToHost(host, port);
m_control->waitForConnected(connectTimeout() * 1000);
#ifndef QT_NO_NETWORKPROXY
connect(m_control, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthentication(QNetworkProxy,QAuthenticator*)));
#endif
int iErrorCode = m_control->state() == QAbstractSocket::ConnectedState ? 0 : ERR_COULD_NOT_CONNECT;
// on connect success try to read the server message...
@ -616,16 +549,6 @@ bool Ftp::ftpLogin(bool* userChanged)
tempbuf = "USER ";
tempbuf += user.toLatin1();
if ( m_proxyURL.isValid() )
{
tempbuf += '@';
tempbuf += m_host.toLatin1();
if ( m_port > 0 && m_port != DEFAULT_FTP_PORT )
{
tempbuf += ':';
tempbuf += QString::number(m_port).toLatin1();
}
}
kDebug(7102) << "Sending Login name: " << tempbuf;
@ -877,7 +800,7 @@ int Ftp::ftpOpenPASVDataConnection()
// Check that we can do PASV
QHostAddress address = m_control->peerAddress();
if (address.protocol() != QAbstractSocket::IPv4Protocol && !isSocksProxy())
if (address.protocol() != QAbstractSocket::IPv4Protocol)
return ERR_INTERNAL; // no PASV for non-PF_INET connections
if (m_extControl & pasvUnknown)
@ -918,7 +841,7 @@ int Ftp::ftpOpenPASVDataConnection()
// now connect the data socket ...
quint16 port = i[4] << 8 | i[5];
const QString host = (isSocksProxy() ? m_host : address.toString());
const QString host = (address.toString());
m_data = new QTcpSocket();
m_data->connectToHost(host, port);
m_data->waitForConnected(connectTimeout() * 1000);
@ -956,7 +879,7 @@ int Ftp::ftpOpenEPSVDataConnection()
if ( !start || sscanf(start, "|||%d|", &portnum) != 1)
return ERR_INTERNAL;
const QString host = (isSocksProxy() ? m_host : address.toString());
const QString host = (address.toString());
m_data = new QTcpSocket();
m_data->connectToHost(host, portnum);
m_data->waitForConnected(connectTimeout() * 1000);
@ -2635,76 +2558,6 @@ Ftp::StatusCode Ftp::ftpSendMimeType(int& iError, const KUrl& url)
return statusSuccess;
}
#ifndef QT_NO_NETWORKPROXY
void Ftp::proxyAuthentication(const QNetworkProxy& proxy, QAuthenticator* authenticator)
{
Q_UNUSED(proxy);
kDebug(7102) << "Authenticator received -- realm:" << authenticator->realm() << "user:"
<< authenticator->user();
AuthInfo info;
info.url = m_proxyURL;
info.realmValue = authenticator->realm();
info.verifyPath = true; //### whatever
info.username = authenticator->user();
const bool haveCachedCredentials = checkCachedAuthentication(info);
// if m_socketProxyAuth is a valid pointer then authentication has been attempted before,
// and it was not successful. see below and saveProxyAuthenticationForSocket().
if (!haveCachedCredentials || m_socketProxyAuth) {
// Save authentication info if the connection succeeds. We need to disconnect
// this after saving the auth data (or an error) so we won't save garbage afterwards!
connect(m_control, SIGNAL(connected()), this, SLOT(saveProxyAuthentication()));
//### fillPromptInfo(&info);
info.prompt = i18n("You need to supply a username and a password for "
"the proxy server listed below before you are allowed "
"to access any sites.");
info.keepPassword = true;
info.commentLabel = i18n("Proxy:");
info.comment = i18n("<b>%1</b> at <b>%2</b>", info.realmValue, m_proxyURL.host());
const bool dataEntered = openPasswordDialog(info, i18n("Proxy Authentication Failed."));
if (!dataEntered) {
kDebug(7102) << "looks like the user canceled proxy authentication.";
error(ERR_USER_CANCELED, m_proxyURL.host());
return;
}
}
authenticator->setUser(info.username);
authenticator->setPassword(info.password);
authenticator->setOption(QLatin1String("keepalive"), info.keepPassword);
if (m_socketProxyAuth) {
*m_socketProxyAuth = *authenticator;
} else {
m_socketProxyAuth = new QAuthenticator(*authenticator);
}
m_proxyURL.setUser(info.username);
m_proxyURL.setPassword(info.password);
}
void Ftp::saveProxyAuthentication()
{
kDebug(7102);
disconnect(m_control, SIGNAL(connected()), this, SLOT(saveProxyAuthentication()));
Q_ASSERT(m_socketProxyAuth);
if (m_socketProxyAuth) {
kDebug(7102) << "-- realm:" << m_socketProxyAuth->realm() << "user:" << m_socketProxyAuth->user();
KIO::AuthInfo a;
a.verifyPath = true;
a.url = m_proxyURL;
a.realmValue = m_socketProxyAuth->realm();
a.username = m_socketProxyAuth->user();
a.password = m_socketProxyAuth->password();
a.keepPassword = m_socketProxyAuth->option(QLatin1String("keepalive")).toBool();
cacheAuthentication(a);
}
delete m_socketProxyAuth;
m_socketProxyAuth = 0;
}
#endif // QT_NO_NETWORKPROXY
void Ftp::fixupEntryName(FtpEntry* e)
{
Q_ASSERT(e);

View file

@ -32,11 +32,6 @@
#include <QTcpServer>
#include <QTcpSocket>
#ifndef QT_NO_NETWORKPROXY
# include <QNetworkProxy>
# include <QAuthenticator>
#endif
struct FtpEntry
{
QString name;
@ -354,12 +349,6 @@ private:
*/
bool maybeEmitStatEntry(FtpEntry& ftpEnt, const QString& search, const QString& filename, bool isDir);
#ifndef QT_NO_NETWORKPROXY
private Q_SLOTS:
void proxyAuthentication(const QNetworkProxy&, QAuthenticator*);
void saveProxyAuthentication();
#endif
private: // data members
QString m_host;
@ -370,8 +359,6 @@ private: // data members
* Where we end up after connecting
*/
QString m_initialPath;
KUrl m_proxyURL;
QStringList m_proxyUrls;
/**
* the current working directory - see ftpFolder
@ -448,13 +435,6 @@ private: // data members
* active mode server socket
*/
QTcpServer *m_server;
#ifndef QT_NO_NETWORKPROXY
/**
* proxy server authenticator
*/
QAuthenticator* m_socketProxyAuth;
#endif
};
#endif // KDELIBS_FTP_H