Skip to content

Commit

Permalink
Added code to change current directory to location of config file whe…
Browse files Browse the repository at this point in the history
…n in portable mode.
  • Loading branch information
jsbackus committed Oct 8, 2016
1 parent 267a65c commit 0b8fa76
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ int main(int argc, char *argv[])

QApplication *a = new QApplication(argc, argv);

#if defined(Q_OS_WIN) && defined(WIN_PORTABLE_PACKAGE)
// If in portable mode, make sure the current directory is the same as the
// config directory. This is to ensure that all relative paths resolve
// correctly when loading on startup.
if( QDir::setCurrent( PadderCommon::configPath() );
#endif

QDir configDir(PadderCommon::configPath());
if (!configDir.exists())
{
Expand Down

0 comments on commit 0b8fa76

Please sign in to comment.