Merge branch 'release/2.1.3' into develop

This commit is contained in:
Janek Bevendorff 2017-03-01 23:37:14 +01:00
commit 93c212f28d
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53
9 changed files with 15 additions and 11 deletions

View File

@ -166,7 +166,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
msgBox.setIcon(QMessageBox::Question);
msgBox.addButton(QMessageBox::Yes);
msgBox.addButton(QMessageBox::No);
auto readOnlyButton = msgBox.addButton(tr("Open read-only"), QMessageBox::AcceptRole);
auto readOnlyButton = msgBox.addButton(tr("Open read-only"), QMessageBox::NoRole);
msgBox.setDefaultButton(readOnlyButton);
msgBox.setEscapeButton(QMessageBox::No);
auto result = msgBox.exec();

View File

@ -301,6 +301,10 @@ MainWindow::MainWindow()
connect(m_ui->welcomeWidget, SIGNAL(importKeePass1Database()), SLOT(switchToKeePass1Database()));
connect(m_ui->actionAbout, SIGNAL(triggered()), SLOT(showAboutDialog()));
#ifdef Q_OS_MAC
setUnifiedTitleAndToolBarOnMac(true);
#endif
connect(m_ui->tabWidget, SIGNAL(messageGlobal(QString,MessageWidget::MessageType)), this, SLOT(displayGlobalMessage(QString, MessageWidget::MessageType)));
connect(m_ui->tabWidget, SIGNAL(messageDismissGlobal()), this, SLOT(hideGlobalMessage()));

View File

@ -110,7 +110,7 @@ static QByteArray encrypt2(const QByteArray & data, SymmetricCipherGcrypt & ciph
//Encrypt
QByteArray buffer = data + QByteArray(paddingSize, paddingSize);
cipher.reset();
cipher.processInPlace(buffer);
Q_UNUSED(cipher.processInPlace(buffer));
return buffer;
}

View File

@ -91,7 +91,7 @@ typedef int (*http_cb) (http_parser*);
/* Status Codes */
#define HTTP_STATUS_MAP(XX) \
#define HTTPPARSER_HTTP_STATUS_MAP(XX) \
XX(100, CONTINUE, Continue) \
XX(101, SWITCHING_PROTOCOLS, Switching Protocols) \
XX(102, PROCESSING, Processing) \
@ -150,12 +150,12 @@ typedef int (*http_cb) (http_parser*);
XX(507, INSUFFICIENT_STORAGE, Insufficient Storage) \
XX(508, LOOP_DETECTED, Loop Detected) \
XX(510, NOT_EXTENDED, Not Extended) \
XX(511, NETWORK_AUTHENTICATION_REQUIRED, Network Authentication Required) \
XX(511, NETWORK_AUTHENTICATION_REQUIRED, Network Authentication Required)
enum http_status
{
#define XX(num, name, string) HTTP_STATUS_##name = num,
HTTP_STATUS_MAP(XX)
HTTPPARSER_HTTP_STATUS_MAP(XX)
#undef XX
};

View File

@ -41,7 +41,7 @@ public:
if ( !icollectRequired ) // not allowed to collect data
return false;
int newLength = icollectedData.length() + (int) length;
int newLength = icollectedData.length() + static_cast<int>(length);
if ( icollectCapacity > 0 && newLength > icollectCapacity )
return false; // the capacity is full

View File

@ -112,7 +112,7 @@ protected:
void onReadyRead() {
while ( isocket.bytesAvailable() > 0 ) {
char buffer[4097] = {0};
size_t readLength = (size_t) isocket.readRaw(buffer, 4096);
size_t readLength = static_cast<size_t>(isocket.readRaw(buffer, 4096));
parse(buffer, readLength);
}

View File

@ -42,7 +42,7 @@ public:
// if it's a QLocalServer
virtual void incomingConnection(quintptr socketDescriptor) {
iserver->incomingConnection((qintptr) socketDescriptor);
iserver->incomingConnection(static_cast<qintptr>(socketDescriptor));
}
};

View File

@ -83,7 +83,7 @@ public:
void onReadyRead() {
while ( isocket.bytesAvailable() > 0 ) {
char buffer[4097] = {0};
size_t readLength = (size_t) isocket.readRaw(buffer, 4096);
size_t readLength = static_cast<size_t>(isocket.readRaw(buffer, 4096));
parse(buffer, readLength);
}

View File

@ -8,7 +8,7 @@ namespace qhttp {
# error "to compile QHttp classes, Qt 5.0 or later is needed."
#endif
#define HTTP_STATUS_MAP(XX) \
#define QHTTPABSTRACTS_HTTP_STATUS_MAP(XX) \
XX(100, "Continue") \
XX(101, "Switching Protocols") \
/* RFC 2518) obsoleted by RFC 4918 */ \
@ -78,7 +78,7 @@ static struct {
int code;
const char* message;
} g_status_codes[] {
HTTP_STATUS_MAP(PATCH_STATUS_CODES)
QHTTPABSTRACTS_HTTP_STATUS_MAP(PATCH_STATUS_CODES)
};
#undef PATCH_STATUS_CODES