refactor: getAppFileName() 移动到 main.c
This commit is contained in:
parent
d5403c95a8
commit
9319dd3ac1
13
src/misc.cpp
13
src/misc.cpp
|
@ -488,16 +488,3 @@ void bindThisThread(size_t idx)
|
|||
#endif
|
||||
|
||||
} // namespace WinProcGroup
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
QString getAppFileName()
|
||||
{
|
||||
QString filename;
|
||||
filename = QCoreApplication::applicationFilePath().mid(QCoreApplication::applicationDirPath().size() + 1);
|
||||
filename = filename.mid(0, filename.size() - QString(".exe").size());
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
|
|
@ -163,8 +163,6 @@ inline uint64_t rand56()
|
|||
return rand64() << 8;
|
||||
}
|
||||
|
||||
extern QString getAppFileName();
|
||||
|
||||
void start_logger(const std::string &fname);
|
||||
|
||||
#endif // #ifndef MISC_H_INCLUDED
|
|
@ -17,9 +17,6 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include "gamewindow.h"
|
||||
#include "misc.h"
|
||||
#include "bitboard.h"
|
||||
|
@ -27,9 +24,22 @@
|
|||
QString APP_FILENAME_DEFAULT = "MillGame";
|
||||
|
||||
#ifdef QT_UI
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#ifndef TRAINING_MODE
|
||||
#ifndef UCT_DEMO
|
||||
|
||||
QString getAppFileName()
|
||||
{
|
||||
QString filename;
|
||||
filename = QCoreApplication::applicationFilePath().mid(QCoreApplication::applicationDirPath().size() + 1);
|
||||
filename = filename.mid(0, filename.size() - QString(".exe").size());
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Bitboards::init();
|
||||
|
|
Loading…
Reference in New Issue