mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
Set default-location for projects to documents-dir.
All export files that are derived from the project (BOM, nomenclature, etc.) are saved in the same directory by default. In this context, the standard directories have been grouped together in qetapp.cpp / qetapp.h so that only one place needs to be searched for in case of any adjustments.
This commit is contained in:
@@ -16,8 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "exportproperties.h"
|
||||
|
||||
#include <QStandardPaths>
|
||||
#include "qetapp.h"
|
||||
|
||||
/**
|
||||
Constructeur par defaut :
|
||||
@@ -28,9 +27,7 @@
|
||||
* la zone exportee est le schema avec son cadre et son cartouche
|
||||
*/
|
||||
ExportProperties::ExportProperties() :
|
||||
destination_directory(
|
||||
QStandardPaths::writableLocation(
|
||||
QStandardPaths::DesktopLocation)),
|
||||
destination_directory(QETApp::documentDir()),
|
||||
format("PNG"),
|
||||
draw_grid(false),
|
||||
draw_border(true),
|
||||
@@ -85,14 +82,13 @@ void ExportProperties::toSettings(QSettings &settings,
|
||||
*/
|
||||
void ExportProperties::fromSettings(QSettings &settings,
|
||||
const QString &prefix) {
|
||||
QString desktop_path = QStandardPaths::writableLocation(
|
||||
QStandardPaths::DesktopLocation);
|
||||
QString export_path = QETApp::documentDir();
|
||||
destination_directory.setPath(
|
||||
settings.value(
|
||||
prefix + "path",
|
||||
desktop_path).toString());
|
||||
export_path).toString());
|
||||
if (!destination_directory.exists())
|
||||
destination_directory.setPath(desktop_path);
|
||||
destination_directory.setPath(export_path);
|
||||
|
||||
format = settings.value(prefix + "format").toString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user