Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
da449098
Commit
da449098
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
simplify logic
parent
0a389851
No related branches found
No related tags found
1 merge request
!427
Reduce include dependences in GUI; break cyclic dependence between View and Model
Pipeline
#48763
passed
3 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Model/Project/ProjectDocument.cpp
+7
-0
7 additions, 0 deletions
GUI/Model/Project/ProjectDocument.cpp
GUI/Model/Project/ProjectDocument.h
+1
-0
1 addition, 0 deletions
GUI/Model/Project/ProjectDocument.h
GUI/View/Main/ProjectManager.cpp
+7
-11
7 additions, 11 deletions
GUI/View/Main/ProjectManager.cpp
with
15 additions
and
11 deletions
GUI/Model/Project/ProjectDocument.cpp
+
7
−
0
View file @
da449098
...
...
@@ -72,6 +72,13 @@ QString ProjectDocument::projectDir() const
return
m_project_dir
;
}
QString
ProjectDocument
::
validProjectDir
()
const
{
if
(
m_project_name
.
isEmpty
())
return
""
;
return
m_project_dir
;
}
void
ProjectDocument
::
setProjectDir
(
const
QString
&
text
)
{
m_project_dir
=
text
;
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Project/ProjectDocument.h
+
1
−
0
View file @
da449098
...
...
@@ -62,6 +62,7 @@ public:
void
setProjectName
(
const
QString
&
text
);
QString
projectDir
()
const
;
QString
validProjectDir
()
const
;
void
setProjectDir
(
const
QString
&
text
);
QString
projectFileName
()
const
;
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Main/ProjectManager.cpp
+
7
−
11
View file @
da449098
...
...
@@ -123,11 +123,9 @@ void ProjectManager::writeSettings()
QStringList
ProjectManager
::
recentProjects
()
{
QStringList
updatedList
;
for
(
QString
fileName
:
m_recentProjects
)
{
QFile
fin
(
fileName
);
if
(
fin
.
exists
())
for
(
QString
fileName
:
m_recentProjects
)
if
(
QFile
fin
(
fileName
);
fin
.
exists
())
updatedList
.
append
(
fileName
);
}
m_recentProjects
=
updatedList
;
return
m_recentProjects
;
}
...
...
@@ -136,8 +134,8 @@ QStringList ProjectManager::recentProjects()
QString
ProjectManager
::
projectDir
()
const
{
if
(
gSessionData
->
projectDocument
&&
gSessionData
->
projectDocument
->
hasValidNameAndPath
()
)
return
gSessionData
->
projectDocument
->
p
rojectDir
();
if
(
gSessionData
->
projectDocument
)
return
gSessionData
->
projectDocument
->
validP
rojectDir
();
return
""
;
}
...
...
@@ -146,11 +144,9 @@ QString ProjectManager::projectDir() const
QString
ProjectManager
::
userExportDir
()
const
{
QString
result
=
projectDir
();
if
(
result
.
isEmpty
())
result
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
HomeLocation
);
return
result
;
if
(
QString
dir
=
projectDir
();
!
dir
.
isEmpty
())
return
dir
;
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
HomeLocation
);
}
//! Returns directory name which was used by the user to import files.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment