forked from qt-creator/qt-creator
Utils: Introduce a TemporaryDirectory and TemporaryFile class
Both wrap the corresponding Qt class, but make sure all temporary files or directories are created inside a "master temporary directory". Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
e6017c40fc
commit
c6f90e575e
@@ -30,10 +30,10 @@
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/temporarydirectory.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QStringBuilder>
|
||||
#include <QDir>
|
||||
#include <QUrl>
|
||||
|
||||
#include <QApplication>
|
||||
@@ -135,7 +135,7 @@ bool HelpViewer::launchWithExternalApp(const QUrl &url)
|
||||
|
||||
const QString& path = resolvedUrl.path();
|
||||
if (!canOpenPage(path)) {
|
||||
Utils::TempFileSaver saver(QDir::tempPath()
|
||||
Utils::TempFileSaver saver(Utils::TemporaryDirectory::masterDirectoryPath()
|
||||
+ "/qtchelp_XXXXXX." + QFileInfo(path).completeSuffix());
|
||||
saver.setAutoRemove(false);
|
||||
if (!saver.hasError())
|
||||
|
||||
Reference in New Issue
Block a user