mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +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:
@@ -869,6 +869,44 @@ QString QETApp::dataDir()
|
||||
return datadir;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETApp::documentDir
|
||||
Return the standard-folder where to save users documents
|
||||
This directory is generally
|
||||
C:/Users/<USER>/Documents
|
||||
on Windows and
|
||||
~/Documents
|
||||
under UNIX-like systems.
|
||||
\~ @return The path of users document-folder
|
||||
*/
|
||||
QString QETApp::documentDir()
|
||||
{
|
||||
QString docdir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
|
||||
if (docdir.endsWith('/')) {
|
||||
docdir.remove(docdir.length()-1, 1);
|
||||
}
|
||||
return docdir;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETApp::pictureDir
|
||||
Returns the standard-folder of users pictures
|
||||
This directory is generally
|
||||
C:/Users/<USER>/Pictures
|
||||
on Windows and
|
||||
~/Pictures
|
||||
under UNIX-like systems.
|
||||
\~ @return The path of users picture-folder
|
||||
*/
|
||||
QString QETApp::pictureDir()
|
||||
{
|
||||
QString picturedir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
|
||||
if (picturedir.endsWith('/')) {
|
||||
picturedir.remove(picturedir.length()-1, 1);
|
||||
}
|
||||
return picturedir;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETApp::realPath
|
||||
Allows you to know the absolute path of the * .elmt file
|
||||
|
||||
Reference in New Issue
Block a user