Merge pull request #466 from nextcloud/fix_compile_warnings

Fix compile warnings
This commit is contained in:
Camila Ayres 2018-07-02 13:50:04 +02:00 committed by GitHub
commit 178edb97bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 37 deletions

View file

@ -304,6 +304,8 @@ void AccountSettings::slotEncryptionFlagSuccess(const QByteArray& fileId)
void AccountSettings::slotEncryptionFlagError(const QByteArray& fileId, int httpErrorCode) void AccountSettings::slotEncryptionFlagError(const QByteArray& fileId, int httpErrorCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpErrorCode);
qDebug() << "Error on the encryption flag"; qDebug() << "Error on the encryption flag";
} }
@ -344,6 +346,8 @@ void AccountSettings::slotUploadMetadataSuccess(const QByteArray& folderId)
void AccountSettings::slotUpdateMetadataError(const QByteArray& folderId, int httpReturnCode) void AccountSettings::slotUpdateMetadataError(const QByteArray& folderId, int httpReturnCode)
{ {
Q_UNUSED(httpReturnCode);
const auto token = accountsState()->account()->e2e()->tokenForFolder(folderId); const auto token = accountsState()->account()->e2e()->tokenForFolder(folderId);
auto unlockJob = new UnlockEncryptFolderApiJob(accountsState()->account(), folderId, token); auto unlockJob = new UnlockEncryptFolderApiJob(accountsState()->account(), folderId, token);
connect(unlockJob, &UnlockEncryptFolderApiJob::success, connect(unlockJob, &UnlockEncryptFolderApiJob::success,
@ -355,15 +359,23 @@ void AccountSettings::slotUpdateMetadataError(const QByteArray& folderId, int ht
void AccountSettings::slotLockForEncryptionError(const QByteArray& fileId, int httpErrorCode) void AccountSettings::slotLockForEncryptionError(const QByteArray& fileId, int httpErrorCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpErrorCode);
qCInfo(lcAccountSettings()) << "Locking error" << httpErrorCode; qCInfo(lcAccountSettings()) << "Locking error" << httpErrorCode;
} }
void AccountSettings::slotUnlockFolderError(const QByteArray& fileId, int httpErrorCode) void AccountSettings::slotUnlockFolderError(const QByteArray& fileId, int httpErrorCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpErrorCode);
qCInfo(lcAccountSettings()) << "Unlocking error!"; qCInfo(lcAccountSettings()) << "Unlocking error!";
} }
void AccountSettings::slotUnlockFolderSuccess(const QByteArray& fileId) void AccountSettings::slotUnlockFolderSuccess(const QByteArray& fileId)
{ {
Q_UNUSED(fileId);
qCInfo(lcAccountSettings()) << "Unlocking success!"; qCInfo(lcAccountSettings()) << "Unlocking success!";
} }
@ -475,27 +487,41 @@ void AccountSettings::slotDecryptionFlagSuccess(const QByteArray& fileId)
} }
} }
void AccountSettings::slotDecryptionFlagError(const QByteArray& fileID, int httpReturnCode) void AccountSettings::slotDecryptionFlagError(const QByteArray& fileId, int httpReturnCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpReturnCode);
qDebug() << "Error Setting the Decryption Flag"; qDebug() << "Error Setting the Decryption Flag";
} }
void AccountSettings::slotUnlockForDecryptionError(const QByteArray& fileId, int httpReturnCode) void AccountSettings::slotUnlockForDecryptionError(const QByteArray& fileId, int httpReturnCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpReturnCode);
qDebug() << "Error unlocking folder after decryption"; qDebug() << "Error unlocking folder after decryption";
} }
void AccountSettings::slotDeleteMetadataError(const QByteArray& fileId, int httpReturnCode) void AccountSettings::slotDeleteMetadataError(const QByteArray& fileId, int httpReturnCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpReturnCode);
qDebug() << "Error deleting the metadata"; qDebug() << "Error deleting the metadata";
} }
void AccountSettings::slotLockForDecryptionError(const QByteArray& fileId, int httpReturnCode) void AccountSettings::slotLockForDecryptionError(const QByteArray& fileId, int httpReturnCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpReturnCode);
qDebug() << "Error Locking for decryption"; qDebug() << "Error Locking for decryption";
} }
void AccountSettings::slotSubfolderContextMenuRequested(const QModelIndex& index, const QPoint& pos) void AccountSettings::slotSubfolderContextMenuRequested(const QModelIndex& index, const QPoint& pos)
{ {
Q_UNUSED(pos);
QMenu menu; QMenu menu;
auto ac = menu.addAction(tr("Open folder")); auto ac = menu.addAction(tr("Open folder"));
connect(ac, &QAction::triggered, this, &AccountSettings::slotOpenCurrentLocalSubFolder); connect(ac, &QAction::triggered, this, &AccountSettings::slotOpenCurrentLocalSubFolder);

View file

@ -34,8 +34,8 @@ AccountState::AccountState(AccountPtr account)
, _state(AccountState::Disconnected) , _state(AccountState::Disconnected)
, _connectionStatus(ConnectionValidator::Undefined) , _connectionStatus(ConnectionValidator::Undefined)
, _waitingForNewCredentials(false) , _waitingForNewCredentials(false)
, _maintenanceToConnectedDelay(60000 + (qrand() % (4 * 60000))) // 1-5min delay
, _notificationsEtagResponseHeader("*") , _notificationsEtagResponseHeader("*")
, _maintenanceToConnectedDelay(60000 + (qrand() % (4 * 60000))) // 1-5min delay
{ {
qRegisterMetaType<AccountState *>("AccountState*"); qRegisterMetaType<AccountState *>("AccountState*");

View file

@ -102,6 +102,8 @@ void WebFlowCredentials::askFromUser() {
} }
void WebFlowCredentials::slotAskFromUserCredentialsProvided(const QString &user, const QString &pass, const QString &host) { void WebFlowCredentials::slotAskFromUserCredentialsProvided(const QString &user, const QString &pass, const QString &host) {
Q_UNUSED(host);
if (_user != user) { if (_user != user) {
qCInfo(lcWebFlowCredentials()) << "Authed with the wrong user!"; qCInfo(lcWebFlowCredentials()) << "Authed with the wrong user!";

View file

@ -94,7 +94,7 @@ static chrono::milliseconds millisecondsValue(const QSettings &setting, const ch
chrono::milliseconds defaultValue) chrono::milliseconds defaultValue)
{ {
return chrono::milliseconds(setting.value(QLatin1String(key), qlonglong(defaultValue.count())).toLongLong()); return chrono::milliseconds(setting.value(QLatin1String(key), qlonglong(defaultValue.count())).toLongLong());
}; }
ConfigFile::ConfigFile() ConfigFile::ConfigFile()
{ {

View file

@ -50,7 +50,7 @@ Logger::Logger(QObject *parent)
{ {
qSetMessagePattern("[%{function} \t%{message}"); qSetMessagePattern("[%{function} \t%{message}");
#ifndef NO_MSG_HANDLER #ifndef NO_MSG_HANDLER
// qInstallMessageHandler(mirallLogCatcher); qInstallMessageHandler(mirallLogCatcher);
#else #else
Q_UNUSED(mirallLogCatcher) Q_UNUSED(mirallLogCatcher)
#endif #endif

View file

@ -106,7 +106,7 @@ bool PropagateDownloadEncrypted::decryptFile(QFile& tmpFile)
tmpFile.close(); tmpFile.close();
QFile _tmpOutput(_propagator->getFilePath(tmpFileName), this); QFile _tmpOutput(_propagator->getFilePath(tmpFileName), this);
bool fileDecrypted = EncryptionHelper::fileDecryption(_encryptedInfo.encryptionKey, EncryptionHelper::fileDecryption(_encryptedInfo.encryptionKey,
_encryptedInfo.initializationVector, _encryptedInfo.initializationVector,
&tmpFile, &tmpFile,
&_tmpOutput); &_tmpOutput);

View file

@ -114,6 +114,8 @@ void PropagateUploadEncrypted::slotFolderLockedSuccessfully(const QByteArray& fi
void PropagateUploadEncrypted::slotFolderEncryptedMetadataError(const QByteArray& fileId, int httpReturnCode) void PropagateUploadEncrypted::slotFolderEncryptedMetadataError(const QByteArray& fileId, int httpReturnCode)
{ {
Q_UNUSED(fileId);
Q_UNUSED(httpReturnCode);
qCDebug(lcPropagateUploadEncrypted()) << "Error Getting the encrypted metadata. unlock the folder."; qCDebug(lcPropagateUploadEncrypted()) << "Error Getting the encrypted metadata. unlock the folder.";
unlockFolder(); unlockFolder();
} }
@ -207,6 +209,7 @@ void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDo
void PropagateUploadEncrypted::slotUpdateMetadataSuccess(const QByteArray& fileId) void PropagateUploadEncrypted::slotUpdateMetadataSuccess(const QByteArray& fileId)
{ {
Q_UNUSED(fileId);
qCDebug(lcPropagateUploadEncrypted) << "Uploading of the metadata success, Encrypting the file"; qCDebug(lcPropagateUploadEncrypted) << "Uploading of the metadata success, Encrypting the file";
QFileInfo outputInfo(_completeFileName); QFileInfo outputInfo(_completeFileName);
@ -226,8 +229,9 @@ void PropagateUploadEncrypted::slotUpdateMetadataError(const QByteArray& fileId,
void PropagateUploadEncrypted::slotFolderLockedError(const QByteArray& fileId, int httpErrorCode) void PropagateUploadEncrypted::slotFolderLockedError(const QByteArray& fileId, int httpErrorCode)
{ {
Q_UNUSED(httpErrorCode);
/* try to call the lock from 5 to 5 seconds /* try to call the lock from 5 to 5 seconds
and fail if it's more than 5 minutes. */ * and fail if it's more than 5 minutes. */
QTimer::singleShot(5000, this, [this, fileId]{ QTimer::singleShot(5000, this, [this, fileId]{
if (!_currentLockingInProgress) { if (!_currentLockingInProgress) {
qCDebug(lcPropagateUploadEncrypted) << "Error locking the folder while no other update is locking it up."; qCDebug(lcPropagateUploadEncrypted) << "Error locking the folder while no other update is locking it up.";
@ -249,6 +253,7 @@ void PropagateUploadEncrypted::slotFolderLockedError(const QByteArray& fileId, i
void PropagateUploadEncrypted::slotFolderEncryptedIdError(QNetworkReply *r) void PropagateUploadEncrypted::slotFolderEncryptedIdError(QNetworkReply *r)
{ {
Q_UNUSED(r);
qCDebug(lcPropagateUploadEncrypted) << "Error retrieving the Id of the encrypted folder."; qCDebug(lcPropagateUploadEncrypted) << "Error retrieving the Id of the encrypted folder.";
} }