refactor: remove Arch::hostname, use QSysInfo::machineHostName directly in the only place its used
This commit is contained in:
@ -8,8 +8,6 @@
|
||||
|
||||
#include "arch/Arch.h"
|
||||
|
||||
#include <QSysInfo>
|
||||
|
||||
#include <thread>
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
@ -62,8 +60,3 @@ double Arch::time()
|
||||
auto uSecSinceEpoch = std::chrono::duration_cast<std::chrono::microseconds>(sinceEpoch).count();
|
||||
return double(uSecSinceEpoch / 1000000);
|
||||
}
|
||||
|
||||
QString Arch::hostName()
|
||||
{
|
||||
return QSysInfo::machineHostName();
|
||||
}
|
||||
|
||||
@ -104,12 +104,6 @@ public:
|
||||
*/
|
||||
static double time();
|
||||
|
||||
/**
|
||||
* @brief hostName
|
||||
* @return Return local host's name
|
||||
*/
|
||||
static QString hostName();
|
||||
|
||||
private:
|
||||
static Arch *s_instance;
|
||||
};
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#endif
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QSysInfo>
|
||||
|
||||
deskflow::ArgsBase *ArgParser::m_argsBase = nullptr;
|
||||
|
||||
@ -332,7 +333,7 @@ std::string ArgParser::assembleCommand(
|
||||
|
||||
void ArgParser::updateCommonArgs(const char *const *argv) const
|
||||
{
|
||||
argsBase().m_name = ARCH->hostName().toStdString();
|
||||
argsBase().m_name = QSysInfo::machineHostName().toStdString();
|
||||
argsBase().m_pname = QFileInfo(argv[0]).fileName().toLocal8Bit().constData();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user