Skip to content

Commit

Permalink
main: creates the dictionary resource dir on startup
Browse files Browse the repository at this point in the history
This is to fix a critical windows bug where the resource directory was
not being created.
  • Loading branch information
ripose-jp committed Mar 23, 2022
1 parent 8767b4a commit d13b999
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,19 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}

/* Create the resource directory if it doesn't exist */
if (!QDir(DirectoryUtils::getDictionaryResourceDir()).exists() &&
!QDir().mkdir(DirectoryUtils::getDictionaryResourceDir()))
{
QMessageBox message;
message.critical(
0, "Error Creating Resource Directory",
"Could not make resource directory at " +
DirectoryUtils::getDictionaryResourceDir()
);
return EXIT_FAILURE;
}

/* General Setup */
registerMetaTypes();
setlocale(LC_NUMERIC, "C"); // mpv requires this
Expand Down

0 comments on commit d13b999

Please sign in to comment.