mirror of https://gitee.com/cxasm/notepad--.git
repo: 引入简易的 PathUtils
This commit is contained in:
parent
f7277e6660
commit
06b4549140
|
@ -15,6 +15,7 @@ if(TRUE)
|
|||
spark_add_executable_path(${PROJECT_NAME}
|
||||
${PROJECT_SOURCE_DIR}/src
|
||||
${PROJECT_SOURCE_DIR}/src/cceditor
|
||||
${PROJECT_SOURCE_DIR}/src/utils
|
||||
${QRC_SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#include "pathutil.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
|
||||
QString PathUtil::execDir()
|
||||
{
|
||||
QString path = qApp->applicationDirPath();
|
||||
return path + QDir::separator();
|
||||
}
|
||||
|
||||
QString PathUtil::pluginDir() {
|
||||
QString path = execDir() + "plugin";
|
||||
return path + QDir::separator();
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef PATHUTIL_H
|
||||
#define PATHUTIL_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class PathUtil
|
||||
{
|
||||
public:
|
||||
static QString execDir();
|
||||
static QString pluginDir();
|
||||
};
|
||||
|
||||
#endif // PATHUTIL_H
|
Loading…
Reference in New Issue