mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kparts: make use of KTemporaryFile::filePath()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
93bc6749ab
commit
cf6a3fdb91
1 changed files with 3 additions and 13 deletions
|
@ -522,11 +522,7 @@ void ReadOnlyPartPrivate::openRemoteFile()
|
||||||
QString extension;
|
QString extension;
|
||||||
if (!ext.isEmpty() && m_url.query().isNull()) // not if the URL has a query, e.g. cgi.pl?something
|
if (!ext.isEmpty() && m_url.query().isNull()) // not if the URL has a query, e.g. cgi.pl?something
|
||||||
extension = '.'+ext; // keep the '.'
|
extension = '.'+ext; // keep the '.'
|
||||||
KTemporaryFile tempFile;
|
m_file = KTemporaryFile::filePath(QString::fromLatin1("XXXXXXXXXX%1").arg(extension));
|
||||||
tempFile.setSuffix(extension);
|
|
||||||
tempFile.setAutoRemove(false);
|
|
||||||
tempFile.open();
|
|
||||||
m_file = tempFile.fileName();
|
|
||||||
|
|
||||||
KUrl destURL;
|
KUrl destURL;
|
||||||
destURL.setPath( m_file );
|
destURL.setPath( m_file );
|
||||||
|
@ -843,10 +839,7 @@ void ReadWritePartPrivate::prepareSaving()
|
||||||
// We haven't saved yet, or we did but locally - provide a temp file
|
// We haven't saved yet, or we did but locally - provide a temp file
|
||||||
if ( m_file.isEmpty() || !m_bTemp )
|
if ( m_file.isEmpty() || !m_bTemp )
|
||||||
{
|
{
|
||||||
KTemporaryFile tempFile;
|
m_file = KTemporaryFile::filePath();
|
||||||
tempFile.setAutoRemove(false);
|
|
||||||
tempFile.open();
|
|
||||||
m_file = tempFile.fileName();
|
|
||||||
m_bTemp = true;
|
m_bTemp = true;
|
||||||
}
|
}
|
||||||
// otherwise, we already had a temp file
|
// otherwise, we already had a temp file
|
||||||
|
@ -877,10 +870,7 @@ bool ReadWritePart::saveToUrl()
|
||||||
d->m_uploadJob->kill();
|
d->m_uploadJob->kill();
|
||||||
d->m_uploadJob = 0;
|
d->m_uploadJob = 0;
|
||||||
}
|
}
|
||||||
KTemporaryFile *tempFile = new KTemporaryFile();
|
QString uploadFile = KTemporaryFile::filePath();
|
||||||
tempFile->open();
|
|
||||||
QString uploadFile = tempFile->fileName();
|
|
||||||
delete tempFile;
|
|
||||||
KUrl uploadUrl;
|
KUrl uploadUrl;
|
||||||
uploadUrl.setPath( uploadFile );
|
uploadUrl.setPath( uploadFile );
|
||||||
// Create hardlink
|
// Create hardlink
|
||||||
|
|
Loading…
Add table
Reference in a new issue