Save/restore file paths as relative to project file.

This commit is contained in:
Jim Evins
2019-08-18 21:56:37 -04:00
parent ec3d900e87
commit 6a789c9632
11 changed files with 312 additions and 132 deletions
+2 -6
View File
@@ -111,8 +111,6 @@ namespace glabels
model::Model *model = model::XmlLabelParser::readFile( fileName );
if ( model )
{
model->setFileName( fileName );
// Either apply to current window or open a new one
if ( window->isEmpty() )
{
@@ -156,7 +154,6 @@ namespace glabels
}
model::XmlLabelCreator::writeFile( window->model(), window->model()->fileName() );
window->model()->clearModified();
// Save CWD
mCwd = QFileInfo( window->model()->fileName() ).absolutePath();
@@ -170,7 +167,8 @@ namespace glabels
///
bool File::saveAs( MainWindow *window )
{
// Either use the saved CWD from a previous open/save or grab it from the path of the current file
// Either use the saved CWD from a previous open/save or grab it from the path
// of the current file.
QString cwd = mCwd;
if ( window->model() && !window->model()->fileName().isEmpty() )
{
@@ -210,8 +208,6 @@ namespace glabels
}
model::XmlLabelCreator::writeFile( window->model(), fileName );
window->model()->setFileName( fileName );
window->model()->clearModified();
// Save CWD
mCwd = QFileInfo( fileName ).absolutePath();