Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e12e3add authored by Joachim Eibl's avatar Joachim Eibl

- Fix for saving files on KDE with relative path specified via

  command line option -o.
Signed-off-by: default avatarjoachim99 <joachim.eibl@gmx.de>
parent acce35cd
......@@ -183,7 +183,8 @@ static QString nicePath( const QFileInfo& fi )
void FileAccess::setFile( const QFileInfo& fi, FileAccess* pParent )
{
m_filePath = nicePath( fi.filePath() ); // remove "./" at start
m_filePath = pParent == 0 ? fi.absoluteFilePath() :
nicePath( fi.filePath() ); // remove "./" at start
m_bSymLink = fi.isSymLink();
if ( m_bSymLink || (!m_bExists && m_filePath.contains("@@") ) )
......@@ -566,7 +567,16 @@ QString FileAccess::absoluteFilePath() const
if ( parent() != 0 )
return parent()->absoluteFilePath() + "/" + m_filePath;
else
return m_filePath;
{
if ( m_filePath.isEmpty() )
return QString();
QFileInfo fi( m_filePath );
if ( fi.isAbsolute() )
return m_filePath;
else
return fi.absoluteFilePath(); // Probably never reached
}
} // Full abs path
// Just the name-part of the path, without parent directories
......@@ -1184,7 +1194,7 @@ bool FileAccessJobHandler::rename( const QString& dest )
m_bSuccess = false;
KIO::FileCopyJob* pJob = KIO::file_move( m_pFileAccess->url(), kurl, permissions, KIO::HideProgressInfo );
connect( pJob, SIGNAL(result(KJob*)), this, SLOT(slotSimpleJobResult(KJob*)));
connect( pJob, SIGNAL(percent(KJob*,unsigned long)), this, SLOT(slotPercent(KJob*, unsigned long)));
connect( pJob, SIGNAL(percent(KJob*,unsigned long)), &pp, SLOT(slotPercent(KJob*, unsigned long)));
ProgressProxy::enterEventLoop( pJob,
i18n("Renaming file: %1 -> %2",m_pFileAccess->prettyAbsPath(),dest) );
......@@ -1673,7 +1683,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
&pp, SLOT( slotListDirInfoMessage(KJob*, const QString&) ));
// This line makes the transfer via fish unreliable.:-(
//connect( pListJob, SIGNAL(percent(KJob*,unsigned long)), this, SLOT(slotPercent(KJob*, unsigned long)));
//connect( pListJob, SIGNAL(percent(KJob*,unsigned long)), &pp, SLOT(slotPercent(KJob*, unsigned long)));
ProgressProxy::enterEventLoop( pListJob,
i18n("Listing directory: %1",m_pFileAccess->prettyAbsPath()) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment