Skip to content

Commit

Permalink
Fixed environment variable query
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/celestia/code/trunk/celestia@5198 10d76133-bd44-0410-b00f-95d021917061
  • Loading branch information
t00fri committed Apr 1, 2012
1 parent f609103 commit bcd475b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/celestia/qt/qtappwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
const QStringList& qExtrasDirectories)
{
QString celestia_data_dir = QString::fromLocal8Bit(::getenv("CELESTIA_DATA_DIR"));

if (celestia_data_dir.isEmpty()) {
QString celestia_data_dir = CONFIG_DATA_DIR;
QDir::setCurrent(celestia_data_dir);
} else if (QDir(celestia_data_dir).isReadable()) {
QDir::setCurrent(celestia_data_dir);
} else {
QMessageBox::critical(0, "Celestia",
_("Celestia is unable to run because the data directroy was not "
Expand Down

0 comments on commit bcd475b

Please sign in to comment.