qt: define QT_NO_KEYWORDS

QT_NO_KEYWORDS prevents Qt from defining the `foreach`, `signals`,
`slots` and `emit` macros.

Avoid overlap between Qt macros and boost - for example #undef hackiness
in #6421.

Conflicts:
	src/qt/addressbookpage.cpp
	src/qt/peertablemodel.cpp
	src/qt/receivecoinsdialog.cpp
	src/qt/rpcconsole.cpp

Rebased-From: d29ec6c2301e593d577126d1ca85b93307b32bf1
Github-Pull: #6433
This commit is contained in:
Wladimir J. van der Laan
2015-07-14 13:59:05 +02:00
parent d7101a6d31
commit e092f22951
66 changed files with 184 additions and 186 deletions

View File

@@ -59,10 +59,10 @@ class RPCExecutor : public QObject
{
Q_OBJECT
public slots:
public Q_SLOTS:
void request(const QString &command);
signals:
Q_SIGNALS:
void reply(int category, const QString &command);
};
@@ -94,7 +94,7 @@ bool parseCommandLine(std::vector<std::string> &args, const std::string &strComm
STATE_ESCAPE_DOUBLEQUOTED
} state = STATE_EATING_SPACES;
std::string curarg;
foreach(char ch, strCommand)
Q_FOREACH(char ch, strCommand)
{
switch(state)
{
@@ -157,7 +157,7 @@ void RPCExecutor::request(const QString &command)
std::vector<std::string> args;
if(!parseCommandLine(args, command.toStdString()))
{
emit reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
return;
}
if(args.empty())
@@ -179,7 +179,7 @@ void RPCExecutor::request(const QString &command)
else
strPrint = write_string(result, true);
emit reply(RPCConsole::CMD_REPLY, QString::fromStdString(strPrint));
Q_EMIT reply(RPCConsole::CMD_REPLY, QString::fromStdString(strPrint));
}
catch (const json_spirit::Object& objError)
{
@@ -187,16 +187,16 @@ void RPCExecutor::request(const QString &command)
{
int code = find_value(objError, "code").get_int();
std::string message = find_value(objError, "message").get_str();
emit reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + " (code " + QString::number(code) + ")");
Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + " (code " + QString::number(code) + ")");
}
catch (const std::runtime_error&) // raised when converting to invalid type, i.e. missing code or message
{ // Show raw JSON object
emit reply(RPCConsole::CMD_ERROR, QString::fromStdString(write_string(json_spirit::Value(objError), false)));
Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(write_string(json_spirit::Value(objError), false)));
}
}
catch (const std::exception& e)
{
emit reply(RPCConsole::CMD_ERROR, QString("Error: ") + QString::fromStdString(e.what()));
Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Error: ") + QString::fromStdString(e.what()));
}
}
@@ -243,7 +243,7 @@ RPCConsole::RPCConsole(QWidget *parent) :
RPCConsole::~RPCConsole()
{
GUIUtil::saveWindowGeometry("nRPCConsoleWindow", this);
emit stopExecutor();
Q_EMIT stopExecutor();
delete ui;
}
@@ -417,7 +417,7 @@ void RPCConsole::on_lineEdit_returnPressed()
if(!cmd.isEmpty())
{
message(CMD_REQUEST, cmd);
emit cmdRequest(cmd);
Q_EMIT cmdRequest(cmd);
// Remove command, if already in history
history.removeOne(cmd);
// Append command to history