diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-03-11 22:05:13 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-03-18 20:57:40 (GMT) |
commit | 0d05e79d67b5b808918541f429b06805207e8bdb (patch) | |
tree | 2ab5bbcc57e494bfef99421e99a84af0eb8d9797 /src/htags.cpp | |
parent | 3204a2206aa617b41c6da5999c3b826057d274f3 (diff) | |
download | Doxygen-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/htags.cpp')
-rw-r--r-- | src/htags.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/htags.cpp b/src/htags.cpp index 7be9e48..fdde0f3 100644 --- a/src/htags.cpp +++ b/src/htags.cpp @@ -18,19 +18,17 @@ #include <unordered_map> #include <string> -#include <qdir.h> - #include "htags.h" #include "util.h" #include "message.h" #include "config.h" #include "portable.h" #include "fileinfo.h" - +#include "qdir.h" bool Htags::useHtags = FALSE; -static QDir g_inputDir; +static Dir g_inputDir; static std::unordered_map<std::string,std::string> g_symbolMap; /*! constructs command line of htags(1) and executes it. @@ -46,14 +44,13 @@ bool Htags::execute(const QCString &htmldir) QCString projectName = Config_getString(PROJECT_NAME); QCString projectNumber = Config_getString(PROJECT_NUMBER); - QCString cwd = QDir::currentDirPath().utf8(); if (inputSource.empty()) { - g_inputDir.setPath(cwd); + g_inputDir.setPath(Dir::currentDirPath()); } else if (inputSource.size()==1) { - g_inputDir.setPath(inputSource.back().c_str()); + g_inputDir.setPath(inputSource.back()); if (!g_inputDir.exists()) err("Cannot find directory %s. " "Check the value of the INPUT tag in the configuration file.\n", @@ -89,8 +86,8 @@ bool Htags::execute(const QCString &htmldir) commandLine += "\" "; } commandLine += " \"" + htmldir + "\""; - QCString oldDir = QDir::currentDirPath().utf8(); - QDir::setCurrent(g_inputDir.absPath()); + std::string oldDir = Dir::currentDirPath(); + Dir::setCurrent(g_inputDir.absPath()); //printf("CommandLine=[%s]\n",commandLine.data()); Portable::sysTimerStart(); bool result=Portable::system("htags",commandLine,FALSE)==0; @@ -99,7 +96,7 @@ bool Htags::execute(const QCString &htmldir) err("Problems running %s. Check your installation\n", "htags"); } Portable::sysTimerStop(); - QDir::setCurrent(oldDir); + Dir::setCurrent(oldDir); return result; } @@ -165,7 +162,7 @@ bool Htags::loadFilemap(const QCString &htmlDir) QCString Htags::path2URL(const QCString &path) { QCString url,symName=path; - QCString dir = g_inputDir.absPath().utf8(); + QCString dir = g_inputDir.absPath(); int dl=dir.length(); if ((int)symName.length()>dl+1) { |