summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index b277d1f..fc26799 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -198,11 +198,20 @@ MainWindow::MainWindow(const char *filename)
this, SLOT(clearRecentFiles()));
if (!examplesdir.isEmpty()) {
+ bool found_example = false;
QStringList examples = QDir(examplesdir).entryList(QStringList("*.scad"),
QDir::Files | QDir::Readable, QDir::Name);
foreach (const QString &ex, examples) {
this->menuExamples->addAction(ex, this, SLOT(actionOpenExample()));
+ found_example = true;
}
+ if (!found_example) {
+ delete this->menuExamples;
+ this->menuExamples = NULL;
+ }
+ } else {
+ delete this->menuExamples;
+ this->menuExamples = NULL;
}
// Edit menu
contact: Jan Huwald // Impressum