| 851 | } |
| 852 | |
| 853 | bool App::loadConfig( const LogLevel& logLevel, const Sizeu& displaySize, bool sync, |
| 854 | bool stdOutLogs, bool disableFileLogs ) { |
| 855 | if ( !mPortableMode ) |
| 856 | mPortableMode = FileSystem::fileExists( Sys::getProcessPath() + "portable_mode.txt" ); |
| 857 | auto [ok, configPath] = generateConfigPath(); |
| 858 | mConfigPath = std::move( configPath ); |
| 859 | mPortableModeFailed = !ok; |
| 860 | bool firstRun = false; |
| 861 | if ( !FileSystem::fileExists( mConfigPath ) ) { |
| 862 | FileSystem::makeDir( mConfigPath ); |
| 863 | firstRun = true; |
| 864 | } |
| 865 | FileSystem::dirAddSlashAtEnd( mConfigPath ); |
| 866 | mPluginsPath = mConfigPath + "plugins"; |
| 867 | mLanguagesPath = mConfigPath + "languages"; |
| 868 | mThemesPath = mConfigPath + "themes"; |
| 869 | mScriptsPath = mConfigPath + "scripts"; |
| 870 | mPlaygroundPath = mConfigPath + "playground"; |
| 871 | mIpcPath = mConfigPath + "ipc"; |
| 872 | mColorSchemesPath = mConfigPath + "editor" + FileSystem::getOSSlash() + "colorschemes" + |
| 873 | FileSystem::getOSSlash(); |
| 874 | mTerminalManager = std::make_unique<TerminalManager>( this ); |
| 875 | mTerminalManager->setTerminalColorSchemesPath( mConfigPath + "terminal" + |
| 876 | FileSystem::getOSSlash() + "colorschemes" + |
| 877 | FileSystem::getOSSlash() ); |
| 878 | mTerminalManager->setUseFrameBuffer( mUseFrameBuffer ); |
| 879 | |
| 880 | if ( !FileSystem::fileExists( mPluginsPath ) ) |
| 881 | FileSystem::makeDir( mPluginsPath ); |
| 882 | FileSystem::dirAddSlashAtEnd( mPluginsPath ); |
| 883 | |
| 884 | if ( !FileSystem::fileExists( mLanguagesPath ) ) |
| 885 | FileSystem::makeDir( mLanguagesPath ); |
| 886 | FileSystem::dirAddSlashAtEnd( mLanguagesPath ); |
| 887 | |
| 888 | if ( !FileSystem::fileExists( mThemesPath ) ) |
| 889 | FileSystem::makeDir( mThemesPath ); |
| 890 | FileSystem::dirAddSlashAtEnd( mThemesPath ); |
| 891 | |
| 892 | if ( !FileSystem::fileExists( mScriptsPath ) ) |
| 893 | FileSystem::makeDir( mScriptsPath ); |
| 894 | FileSystem::dirAddSlashAtEnd( mScriptsPath ); |
| 895 | |
| 896 | if ( !FileSystem::fileExists( mPlaygroundPath ) ) |
| 897 | FileSystem::makeDir( mPlaygroundPath ); |
| 898 | FileSystem::dirAddSlashAtEnd( mPlaygroundPath ); |
| 899 | |
| 900 | if ( !FileSystem::fileExists( mIpcPath ) ) |
| 901 | FileSystem::makeDir( mIpcPath ); |
| 902 | FileSystem::dirAddSlashAtEnd( mIpcPath ); |
| 903 | |
| 904 | Uint64 pid = Sys::getProcessID(); |
| 905 | mPidPath = mIpcPath + String::toString( pid ); |
| 906 | FileSystem::dirAddSlashAtEnd( mPidPath ); |
| 907 | if ( !FileSystem::fileExists( mPidPath ) ) |
| 908 | FileSystem::makeDir( mPidPath ); |
| 909 | |
| 910 | mLogsPath = mConfigPath + "ecode.log"; |
nothing calls this directly
no test coverage detected