refactor: remove Arch::hostname, use QSysInfo::machineHostName directly in the only place its used
This commit is contained in:
parent
38a74d7d0f
commit
9883fb988a
3 changed files with 2 additions and 14 deletions
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
#include "arch/Arch.h"
|
#include "arch/Arch.h"
|
||||||
|
|
||||||
#include <QSysInfo>
|
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
|
|
@ -62,8 +60,3 @@ double Arch::time()
|
||||||
auto uSecSinceEpoch = std::chrono::duration_cast<std::chrono::microseconds>(sinceEpoch).count();
|
auto uSecSinceEpoch = std::chrono::duration_cast<std::chrono::microseconds>(sinceEpoch).count();
|
||||||
return double(uSecSinceEpoch / 1000000);
|
return double(uSecSinceEpoch / 1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Arch::hostName()
|
|
||||||
{
|
|
||||||
return QSysInfo::machineHostName();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,6 @@ public:
|
||||||
*/
|
*/
|
||||||
static double time();
|
static double time();
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief hostName
|
|
||||||
* @return Return local host's name
|
|
||||||
*/
|
|
||||||
static QString hostName();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Arch *s_instance;
|
static Arch *s_instance;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QSysInfo>
|
||||||
|
|
||||||
deskflow::ArgsBase *ArgParser::m_argsBase = nullptr;
|
deskflow::ArgsBase *ArgParser::m_argsBase = nullptr;
|
||||||
|
|
||||||
|
|
@ -332,7 +333,7 @@ std::string ArgParser::assembleCommand(
|
||||||
|
|
||||||
void ArgParser::updateCommonArgs(const char *const *argv) const
|
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();
|
argsBase().m_pname = QFileInfo(argv[0]).fileName().toLocal8Bit().constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue