generic: build fix

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-23 14:08:10 +03:00
parent 34b75e4f7f
commit 9f05a33ee6
9 changed files with 20 additions and 19 deletions

View file

@ -751,6 +751,7 @@ public:
inline bool hasUser() const { return !userName().isEmpty(); };
inline bool hasPass() const { return !password().isEmpty(); };
inline bool hasHost() const { return !host().isEmpty(); };
inline bool hasPath() const { return !path().isEmpty(); };
private:
QString toString() const; // forbidden, use url(), prettyUrl(), or pathOrUrl() instead.

View file

@ -379,7 +379,7 @@ KDirOperator::KDirOperator(const KUrl& _url, QWidget *parent) :
} else {
d->currUrl = _url;
if (d->currUrl.protocol().isEmpty()) {
d->currUrl.setProtocol(QLatin1String("file"));
d->currUrl.setScheme(QLatin1String("file"));
}
}

View file

@ -319,7 +319,7 @@ void KUrlNavigator::Private::slotProtocolChanged(const QString& protocol)
Q_ASSERT(m_editable);
KUrl url;
url.setProtocol(protocol);
url.setScheme(protocol);
url.setPath((protocol == QLatin1String("file")) ? QLatin1String("/") : QLatin1String("//"));
m_pathBox->setEditUrl(url);

View file

@ -966,7 +966,7 @@ void KDirModelTest::testUrlWithRef() // #171117
const QString path = m_tempDir->name();
KDirLister* dirLister = m_dirModel->dirLister();
KUrl url(path);
url.setRef("ref");
url.setFragment("ref");
QVERIFY(url.url().endsWith("#ref"));
dirLister->openUrl(url, KDirLister::NoFlags);
connect(dirLister, SIGNAL(completed()), this, SLOT(slotListingCompleted()));
@ -1003,10 +1003,10 @@ void KDirModelTest::testZipFile() // # 171721
KUrl zipUrl(path);
zipUrl.addPath("wronglocalsizes.zip"); // just a zip file lying here for other reasons
QVERIFY(QFile::exists(zipUrl.toLocalFile()));
zipUrl.setProtocol("zip");
zipUrl.setScheme("zip");
QModelIndex index = m_dirModel->indexForUrl(zipUrl);
QVERIFY(!index.isValid()); // protocol mismatch, can't find it!
zipUrl.setProtocol("file");
zipUrl.setScheme("file");
index = m_dirModel->indexForUrl(zipUrl);
QVERIFY(index.isValid());
}

View file

@ -157,7 +157,7 @@ void KUrlCompletionTest::testLocalURL()
// Completion from URL with a ref -> no match
url = KUrl( m_dirURL.toLocalFile() + 'f' );
url.setRef( "ref" );
url.setFragment( "ref" );
kDebug() << "makeCompletion(" << url << ")";
m_completion->makeCompletion( url.prettyUrl() );
waitForCompletion();

View file

@ -270,7 +270,7 @@ void FileProtocol::get(const KUrl &url)
{
if (!url.isLocalFile()) {
KUrl redir(url);
redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "sftp"));
redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "sftp"));
redirection(redir);
finished();
return;

View file

@ -313,7 +313,7 @@ void FileProtocol::listDir(const KUrl &url)
{
if (!url.isLocalFile()) {
KUrl redir(url);
redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "sftp"));
redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "sftp"));
redirection(redir);
kDebug(7101) << "redirecting to " << redir.url();
finished();
@ -604,7 +604,7 @@ void FileProtocol::stat(const KUrl &url)
{
if (!url.isLocalFile()) {
KUrl redir(url);
redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "sftp"));
redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "sftp"));
redirection(redir);
kDebug(7101) << "redirecting to " << redir.url();
finished();

View file

@ -352,11 +352,11 @@ bool Ftp::ftpOpenConnection (LoginMode loginMode)
if (userNameChanged && m_bLoggedOn)
{
KUrl realURL;
realURL.setProtocol( "ftp" );
realURL.setScheme( "ftp" );
if (m_user != FTP_LOGIN)
realURL.setUser( m_user );
realURL.setUserName( m_user );
if (m_pass != FTP_PASSWD)
realURL.setPass( m_pass );
realURL.setPassword( m_pass );
realURL.setHost( m_host );
if ( m_port > 0 && m_port != DEFAULT_FTP_PORT )
realURL.setPort( m_port );
@ -451,12 +451,12 @@ bool Ftp::ftpLogin(bool* userChanged)
}
AuthInfo info;
info.url.setProtocol( "ftp" );
info.url.setScheme( "ftp" );
info.url.setHost( m_host );
if ( m_port > 0 && m_port != DEFAULT_FTP_PORT )
info.url.setPort( m_port );
if (!user.isEmpty())
info.url.setUser(user);
info.url.setUserName(user);
// Check for cached authentication first and fallback to
// anonymous login when no stored credentials are found.
@ -569,7 +569,7 @@ bool Ftp::ftpLogin(bool* userChanged)
{
// Update the username in case it was changed during login.
if (!m_user.isEmpty()) {
info.url.setUser (user);
info.url.setUserName (user);
m_user = user;
}
@ -1456,9 +1456,9 @@ void Ftp::listDir( const KUrl &url )
if ( path.isEmpty() )
{
KUrl realURL;
realURL.setProtocol( "ftp" );
realURL.setUser( m_user );
realURL.setPass( m_pass );
realURL.setScheme( "ftp" );
realURL.setUserName( m_user );
realURL.setPassword( m_pass );
realURL.setHost( m_host );
if ( m_port > 0 && m_port != DEFAULT_FTP_PORT )
realURL.setPort( m_port );

View file

@ -621,7 +621,7 @@ bool HttpProtocol::authUrl(const KUrl &url)
kioauthinfo.comment = i18n("<b>%1</b>", url.prettyUrl());
if (openPasswordDialog(kioauthinfo)) {
KUrl newurl(url);
newurl.setUser(kioauthinfo.username);
newurl.setUserName(kioauthinfo.username);
newurl.setPassword(kioauthinfo.password);
redirection(newurl);
finished();