mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-06 05:24:13 -04:00
Remove Config::createTempFileInstance
This commit is contained in:
parent
fcb32efd05
commit
37ddbb3cd2
12 changed files with 63 additions and 39 deletions
|
@ -17,6 +17,29 @@
|
|||
|
||||
#include "TemporaryFile.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QPointer>
|
||||
|
||||
namespace
|
||||
{
|
||||
QPointer<TemporaryFile> g_tempConfigFile;
|
||||
}
|
||||
|
||||
QString TemporaryFile::createTempConfigFile()
|
||||
{
|
||||
if (!qApp) {
|
||||
Q_ASSERT(false);
|
||||
return {};
|
||||
}
|
||||
if (g_tempConfigFile) {
|
||||
delete g_tempConfigFile;
|
||||
}
|
||||
auto tmpFileName = QString("%1/%2_settings.XXXXXX").arg(QDir::tempPath(), QCoreApplication::applicationName());
|
||||
g_tempConfigFile = new TemporaryFile(tmpFileName, qApp);
|
||||
return g_tempConfigFile->fileName();
|
||||
}
|
||||
|
||||
TemporaryFile::TemporaryFile()
|
||||
: TemporaryFile(nullptr)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue