Skip to content

Commit

Permalink
Fix some bugs with windows paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrm committed Jul 26, 2021
1 parent d5667d1 commit 95da217
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,4 @@ build/*
*.vcxproj
*.vcxproj.filters
*.vcxproj.user

moc*
11 changes: 5 additions & 6 deletions pdf_viewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,23 @@ void configure_paths(){
std::filesystem::copy(parent_path / "tutorial.pdf", tutorial_path);
}
#else //windows
#ifdef NDEBUG
install_app(exe_path.c_str());
#endif
std::filesystem::path standard_data_path(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).at(0).toStdWString());

default_config_path = parent_path / "prefs.config";
default_keys_path = parent_path / "keys.config";
tutorial_file_path = parent_path / "keys_user.config";
tutorial_path = parent_path / "tutorial.pdf";

#ifdef NON_PORTABLE
user_config_path = standard_data_path / "prefs_user.config";
default_keys_path = standard_data_path / "keys_user.config";
user_keys_path = standard_data_path / "keys_user.config";
database_file_path = standard_data_path / "test.db";
last_opened_file_address_path = standard_data_path / "last_document_path.txt";
#else
user_config_path = parent_path / "prefs_user.config";
default_keys_path = parent_path / "keys_user.config";
user_keys_path = parent_path / "keys_user.config";
database_file_path = parent_path / "test.db";
last_opened_file_address_path = parent_path / "last_document_path.txt";
#endif
Expand All @@ -177,9 +179,6 @@ int main(int argc, char* args[]) {
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
QApplication app(argc, args);

#ifdef NDEBUG
install_app(exe_path.c_str());
#endif

configure_paths();

Expand Down

0 comments on commit 95da217

Please sign in to comment.