aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qregisters.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-07-14 15:32:48 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-07-14 15:32:48 +0200
commit7a851424152a942443190ac34856c08d8dfe7580 (patch)
treece9d234d60934e1cb5fbc20fcc1f6e6b677b492d /src/qregisters.h
parent45e2f9a5c6a8ac29ce9fa1bf2e18343098c4a050 (diff)
fixed error message for Qq if <q> does not exist
* the problem comes from StateExpectQReg resetting the QRegMachine too early. StateExpectQReg(QREG_OPTIONAL) states cannot call machine.fail() in their got_register() callback. In other words, commands with both optional or required registers depending on runtime state cannot be modelled with StateExpectQReg. * instead we derive from State directly - most functionality is encapsulated in QRegSpecMachine anyway. * might also fix crashes on some systems.
Diffstat (limited to 'src/qregisters.h')
-rw-r--r--src/qregisters.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qregisters.h b/src/qregisters.h
index 1c55066..48b023d 100644
--- a/src/qregisters.h
+++ b/src/qregisters.h
@@ -466,12 +466,14 @@ private:
State *got_file(const gchar *filename);
};
-class StateQueryQReg : public StateExpectQReg {
+class StateQueryQReg : public State {
+ QRegSpecMachine machine;
+
public:
- StateQueryQReg() : StateExpectQReg(QREG_OPTIONAL) {}
+ StateQueryQReg();
private:
- State *got_register(QRegister *reg);
+ State *custom(gchar chr);
};
class StateCtlUCommand : public StateExpectQReg {