Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CellulutLO21
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
f72925d1
Commit
f72925d1
authored
3 years ago
by
Yann Boucher
Browse files
Options
Downloads
Patches
Plain Diff
Added support for automatically detecting new patterns in the pattern library directory
parent
aa30c61e
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#78277
passed
3 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/structurelibraryview.hpp
+2
-0
2 additions, 0 deletions
include/structurelibraryview.hpp
src/structurelibraryview.cpp
+11
-0
11 additions, 0 deletions
src/structurelibraryview.cpp
with
13 additions
and
0 deletions
include/structurelibraryview.hpp
+
2
−
0
View file @
f72925d1
...
...
@@ -8,6 +8,7 @@
#include
<QDir>
#include
<QTreeWidgetItem>
#include
<QFileSystemWatcher>
#include
"structure.hpp"
...
...
@@ -37,6 +38,7 @@ private slots:
private:
Ui
::
StructureLibraryView
*
ui
;
QFileSystemWatcher
m_watcher
;
};
#endif // STRUCTURELIBRARYVIEW_HPP
This diff is collapsed.
Click to expand it.
src/structurelibraryview.cpp
+
11
−
0
View file @
f72925d1
...
...
@@ -20,6 +20,10 @@ StructureLibraryView::StructureLibraryView(QWidget *parent) :
connect
(
ui
->
tree
,
&
QTreeWidget
::
itemClicked
,
this
,
&
StructureLibraryView
::
update_info
);
connect
(
ui
->
button_copy
,
&
QPushButton
::
pressed
,
this
,
&
StructureLibraryView
::
copy_button_clicked
);
connect
(
&
m_watcher
,
&
QFileSystemWatcher
::
directoryChanged
,
[
this
](
const
QString
&
)
{
load_structures
();
});
}
StructureLibraryView
::~
StructureLibraryView
()
...
...
@@ -29,8 +33,12 @@ StructureLibraryView::~StructureLibraryView()
void
StructureLibraryView
::
load_structures
()
{
// clear the previously watched directories
m_watcher
.
removePaths
(
m_watcher
.
directories
());
QTreeWidgetItem
*
pattern_list
=
add_directory_contents
(
QDir
(
"patterns/"
));
pattern_list
->
setText
(
0
,
"Patterns"
);
ui
->
tree
->
clear
();
ui
->
tree
->
addTopLevelItem
(
pattern_list
);
pattern_list
->
setExpanded
(
true
);
}
...
...
@@ -67,6 +75,9 @@ QTreeWidgetItem *StructureLibraryView::add_directory_contents(const QDir &dir)
root
->
addChild
(
child
);
}
// register this directory for filesystem watching
m_watcher
.
addPath
(
dir
.
absolutePath
());
return
root
;
}
...
...
This diff is collapsed.
Click to expand it.
Yann Boucher
@yboucher
mentioned in issue
#52 (closed)
·
3 years ago
mentioned in issue
#52 (closed)
mentioned in issue #52
Toggle commit list
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