summaryrefslogtreecommitdiffstats
path: root/src/dotfilepatcher.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-03-11 22:05:13 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-03-18 20:57:40 (GMT)
commit0d05e79d67b5b808918541f429b06805207e8bdb (patch)
tree2ab5bbcc57e494bfef99421e99a84af0eb8d9797 /src/dotfilepatcher.cpp
parent3204a2206aa617b41c6da5999c3b826057d274f3 (diff)
downloadDoxygen-0d05e79d67b5b808918541f429b06805207e8bdb.zip
Doxygen-0d05e79d67b5b808918541f429b06805207e8bdb.tar.gz
Doxygen-0d05e79d67b5b808918541f429b06805207e8bdb.tar.bz2
Refactoring: Replaced QDir with Dir
- Dir is based on ghc::filesystem, a std::filesystem compatible implementation that does not require C++17.
Diffstat (limited to 'src/dotfilepatcher.cpp')
-rw-r--r--src/dotfilepatcher.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp
index aafca34..4960cf4 100644
--- a/src/dotfilepatcher.cpp
+++ b/src/dotfilepatcher.cpp
@@ -18,13 +18,13 @@
#include "qstring.h"
#include "config.h"
-#include "qdir.h"
#include "message.h"
#include "ftextstream.h"
#include "docparser.h"
#include "doxygen.h"
#include "util.h"
#include "dot.h"
+#include "dir.h"
static const char svgZoomHeader[] =
"<svg id=\"main\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\" onload=\"init(evt)\">\n"
@@ -312,25 +312,26 @@ bool DotFilePatcher::run() const
//printf("DotFilePatcher::addSVGConversion: file=%s zoomable=%d\n",
// m_patchFile.data(),map->zoomable);
}
- QCString tmpName = m_patchFile+".tmp";
- QCString patchFile = m_patchFile;
- if (!QDir::current().rename(patchFile,tmpName))
+ std::string tmpName = m_patchFile.str()+".tmp";
+ std::string patchFile = m_patchFile.str();
+ Dir thisDir;
+ if (!thisDir.rename(patchFile,tmpName))
{
- err("Failed to rename file %s to %s!\n",m_patchFile.data(),tmpName.data());
+ err("Failed to rename file %s to %s!\n",m_patchFile.data(),tmpName.c_str());
return FALSE;
}
- QFile fi(tmpName);
- QFile fo(patchFile);
+ QFile fi(tmpName.c_str());
+ QFile fo(patchFile.c_str());
if (!fi.open(IO_ReadOnly))
{
- err("problem opening file %s for patching!\n",tmpName.data());
- QDir::current().rename(tmpName,patchFile);
+ err("problem opening file %s for patching!\n",tmpName.c_str());
+ thisDir.rename(tmpName,patchFile);
return FALSE;
}
if (!fo.open(IO_WriteOnly))
{
err("problem opening file %s for patching!\n",m_patchFile.data());
- QDir::current().rename(tmpName,patchFile);
+ thisDir.rename(tmpName,patchFile);
return FALSE;
}
FTextStream t(&fo);
@@ -481,11 +482,11 @@ bool DotFilePatcher::run() const
fo.close();
// keep original SVG file so we can refer to it, we do need to replace
// dummy link by real ones
- fi.setName(tmpName);
+ fi.setName(tmpName.c_str());
fo.setName(orgName);
if (!fi.open(IO_ReadOnly))
{
- err("problem opening file %s for reading!\n",tmpName.data());
+ err("problem opening file %s for reading!\n",tmpName.c_str());
return FALSE;
}
if (!fo.open(IO_WriteOnly))
@@ -510,7 +511,7 @@ bool DotFilePatcher::run() const
fo.close();
}
// remove temporary file
- QDir::current().remove(tmpName);
+ thisDir.remove(tmpName);
return TRUE;
}