Skip to content

Commit

Permalink
Replace qgetenv with std::getenv
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Aug 22, 2023
1 parent 71de89e commit 44ce6b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ ConfigManager::ConfigManager() :
m_sf2Dir = m_workingDir + SF2_PATH;
m_gigDir = m_workingDir + GIG_PATH;
m_themeDir = defaultThemeDir();
if (!qgetenv("LMMS_DATA_DIR").isEmpty())
if (std::getenv("LMMS_DATA_DIR"))
{
QDir::addSearchPath("data", QString::fromLocal8Bit(qgetenv("LMMS_DATA_DIR")));
QDir::addSearchPath("data", QString::fromLocal8Bit(std::getenv("LMMS_DATA_DIR")));
}
initDevelopmentWorkingDir();

Expand Down Expand Up @@ -557,8 +557,8 @@ void ConfigManager::loadConfigFile(const QString & configFile)
upgrade();

QStringList searchPaths;
if(! qgetenv("LMMS_THEME_PATH").isNull())
searchPaths << qgetenv("LMMS_THEME_PATH");
if (std::getenv("LMMS_THEME_PATH"))
searchPaths << std::getenv("LMMS_THEME_PATH");
searchPaths << themeDir() << defaultThemeDir();
QDir::setSearchPaths("resources", searchPaths);

Expand Down
2 changes: 1 addition & 1 deletion src/core/PluginFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void PluginFactory::setupSearchPaths()
#endif
// Or via an environment variable:
QString env_path;
if (!(env_path = qgetenv("LMMS_PLUGIN_DIR")).isEmpty())
if (const char* env_path = std::getenv("LMMS_PLUGIN_DIR"))
QDir::addSearchPath("plugins", env_path);

QDir::addSearchPath("plugins", ConfigManager::inst()->workingDir() + "plugins");
Expand Down

0 comments on commit 44ce6b1

Please sign in to comment.