projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix build without decoders enabled
[pulseview.git]
/
pv
/
widgets
/
importmenu.cpp
diff --git
a/pv/widgets/importmenu.cpp
b/pv/widgets/importmenu.cpp
index 145bbb43bc14c8357256287b947da89853ecce89..e3034249769e66c73041b37af30fcab6f0ec1392 100644
(file)
--- a/
pv/widgets/importmenu.cpp
+++ b/
pv/widgets/importmenu.cpp
@@
-31,6
+31,7
@@
using std::map;
using std::pair;
using std::string;
using std::shared_ptr;
using std::pair;
using std::string;
using std::shared_ptr;
+using std::vector;
using sigrok::Context;
using sigrok::InputFormat;
using sigrok::Context;
using sigrok::InputFormat;
@@
-39,16
+40,23
@@
namespace pv {
namespace widgets {
ImportMenu::ImportMenu(QWidget *parent, shared_ptr<Context> context,
namespace widgets {
ImportMenu::ImportMenu(QWidget *parent, shared_ptr<Context> context,
-
QAction *open_action
) :
+
vector<QAction *>open_actions
) :
QMenu(parent),
context_(context),
mapper_(this)
{
assert(context);
QMenu(parent),
context_(context),
mapper_(this)
{
assert(context);
- if (open_action) {
- addAction(open_action);
- setDefaultAction(open_action);
+ if (!open_actions.empty()) {
+ bool first_action = true;
+ for (auto open_action : open_actions) {
+ addAction(open_action);
+
+ if (first_action) {
+ first_action = false;
+ setDefaultAction(open_action);
+ }
+ }
addSeparator();
}
addSeparator();
}
@@
-84,5
+92,5
@@
void ImportMenu::on_action(QObject *action)
format_selected((*iter).second);
}
format_selected((*iter).second);
}
-}
//
widgets
-}
//
pv
+}
// namespace
widgets
+}
// namespace
pv