Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are three paths we are interested in: 1) "next to" the app (next to the exe on Window, beside the .app on macOS) 2) place to store user data (file dialog defaults) 3) place to find plugins and other internal support files This fixes (1) for macOS so it can find the global shift file. It does this by setting the current directory on startup and using it to look for things. So on the Mac it get set to beside the .app, on Windows it stays next to the exe. This commit also changes dialogs to use the user's documents directory as the default for (2) by using QStandardPaths. (3) wasn't changed.
- Loading branch information
Showing
17 changed files
with
89 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef CCFILEUTILS_H | ||
#define CCFILEUTILS_H | ||
//########################################################################## | ||
//# # | ||
//# CLOUDCOMPARE # | ||
//# # | ||
//# This program is free software; you can redistribute it and/or modify # | ||
//# it under the terms of the GNU General Public License as published by # | ||
//# the Free Software Foundation; version 2 or later of the License. # | ||
//# # | ||
//# This program is distributed in the hope that it will be useful, # | ||
//# but WITHOUT ANY WARRANTY; without even the implied warranty of # | ||
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | ||
//# GNU General Public License for more details. # | ||
//# # | ||
//# COPYRIGHT: CloudCompare project # | ||
//# # | ||
//########################################################################## | ||
|
||
#include <QStandardPaths> | ||
#include <QString> | ||
|
||
namespace ccFileUtils | ||
{ | ||
//! Shortcut for getting the documents location path | ||
inline QString defaultDocPath() | ||
{ | ||
// note that according to the docs the QStandardPaths::DocumentsLocation path is never empty | ||
return QStandardPaths::standardLocations( QStandardPaths::DocumentsLocation ).first(); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.