Browse Source

Merge pull request #6013 from Chocobo1/mac_warnings

Fix warnings on macOS
adaptive-webui-19844
sledgehammer999 8 years ago committed by GitHub
parent
commit
ba1e5b8d58
  1. 1
      src/base/net/geoipmanager.cpp
  2. 6
      src/base/net/smtp.cpp
  3. 6
      src/gui/optionsdlg.cpp
  4. 8
      src/gui/previewlistdelegate.h
  5. 2
      src/gui/properties/peerlistdelegate.h
  6. 8
      src/gui/properties/proplistdelegate.cpp
  7. 4
      src/gui/search/searchlistdelegate.cpp
  8. 6
      src/gui/transferlistdelegate.cpp

1
src/base/net/geoipmanager.cpp

@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
static const char DATABASE_URL[] = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz";
static const char GEOIP_FOLDER[] = "GeoIP";
static const char GEOIP_FILENAME[] = "GeoLite2-Country.mmdb";
static const int CACHE_SIZE = 1000;
static const int UPDATE_INTERVAL = 30; // Days between database updates
using namespace Net;

6
src/base/net/smtp.cpp

@ -53,7 +53,9 @@ @@ -53,7 +53,9 @@
namespace
{
const short DEFAULT_PORT = 25;
#ifndef QT_NO_OPENSSL
const short DEFAULT_PORT_SSL = 465;
#endif
QByteArray hmacMD5(QByteArray key, const QByteArray &msg)
{
@ -98,12 +100,12 @@ Smtp::Smtp(QObject *parent) @@ -98,12 +100,12 @@ Smtp::Smtp(QObject *parent)
, m_authType(AuthPlain)
{
static bool needToRegisterMetaType = true;
if (needToRegisterMetaType) {
qRegisterMetaType<QAbstractSocket::SocketError>();
needToRegisterMetaType = false;
}
#ifndef QT_NO_OPENSSL
m_socket = new QSslSocket(this);
#else

6
src/gui/optionsdlg.cpp

@ -1638,6 +1638,9 @@ void OptionsDialog::setSslKey(const QByteArray &key, bool interactive) @@ -1638,6 +1638,9 @@ void OptionsDialog::setSslKey(const QByteArray &key, bool interactive)
if (interactive)
QMessageBox::warning(this, tr("Invalid key"), tr("This is not a valid SSL key."));
}
#else
Q_UNUSED(key);
Q_UNUSED(interactive);
#endif
}
@ -1654,6 +1657,9 @@ void OptionsDialog::setSslCertificate(const QByteArray &cert, bool interactive) @@ -1654,6 +1657,9 @@ void OptionsDialog::setSslCertificate(const QByteArray &cert, bool interactive)
if (interactive)
QMessageBox::warning(this, tr("Invalid certificate"), tr("This is not a valid SSL certificate."));
}
#else
Q_UNUSED(cert);
Q_UNUSED(interactive);
#endif
}

8
src/gui/previewlistdelegate.h

@ -32,8 +32,8 @@ @@ -32,8 +32,8 @@
#define PREVIEWLISTDELEGATE_H
#include <QItemDelegate>
#include <QStyleOptionProgressBarV2>
#include <QStyleOptionViewItemV2>
#include <QStyleOptionProgressBar>
#include <QStyleOptionViewItem>
#include <QModelIndex>
#include <QPainter>
#include <QApplication>
@ -59,7 +59,7 @@ class PreviewListDelegate: public QItemDelegate { @@ -59,7 +59,7 @@ class PreviewListDelegate: public QItemDelegate {
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const {
painter->save();
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
switch(index.column()) {
case PreviewSelect::SIZE:
@ -67,7 +67,7 @@ class PreviewListDelegate: public QItemDelegate { @@ -67,7 +67,7 @@ class PreviewListDelegate: public QItemDelegate {
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
break;
case PreviewSelect::PROGRESS:{
QStyleOptionProgressBarV2 newopt;
QStyleOptionProgressBar newopt;
qreal progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
newopt.text = ((progress == 100.0) ? QString("100%") : Utils::String::fromDouble(progress, 1) + "%");

2
src/gui/properties/peerlistdelegate.h

@ -50,7 +50,7 @@ public: @@ -50,7 +50,7 @@ public:
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const {
painter->save();
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
switch(index.column()) {
case TOT_DOWN:
case TOT_UP:

8
src/gui/properties/proplistdelegate.cpp

@ -28,8 +28,8 @@ @@ -28,8 +28,8 @@
* Contact : chris@qbittorrent.org
*/
#include <QStyleOptionProgressBarV2>
#include <QStyleOptionViewItemV2>
#include <QStyleOptionProgressBar>
#include <QStyleOptionViewItem>
#include <QStyleOptionComboBox>
#include <QComboBox>
#include <QModelIndex>
@ -60,7 +60,7 @@ PropListDelegate::PropListDelegate(PropertiesWidget *properties, QObject *parent @@ -60,7 +60,7 @@ PropListDelegate::PropListDelegate(PropertiesWidget *properties, QObject *parent
void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
painter->save();
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
switch(index.column()) {
case PCSIZE:
@ -78,7 +78,7 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti @@ -78,7 +78,7 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
break;
case PROGRESS:
if (index.data().toDouble() >= 0) {
QStyleOptionProgressBarV2 newopt;
QStyleOptionProgressBar newopt;
qreal progress = index.data().toDouble() * 100.;
newopt.rect = opt.rect;
newopt.text = ((progress == 100.0) ? QString("100%") : Utils::String::fromDouble(progress, 1) + "%");

4
src/gui/search/searchlistdelegate.cpp

@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
* Contact : chris@qbittorrent.org
*/
#include <QStyleOptionViewItemV2>
#include <QStyleOptionViewItem>
#include <QModelIndex>
#include <QPainter>
#include <QProgressBar>
@ -46,7 +46,7 @@ void SearchListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op @@ -46,7 +46,7 @@ void SearchListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
{
painter->save();
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
switch(index.column()) {
case SearchSortModel::SIZE:
QItemDelegate::drawBackground(painter, opt, index);

6
src/gui/transferlistdelegate.cpp

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
#include "transferlistdelegate.h"
#include <QModelIndex>
#include <QStyleOptionViewItemV2>
#include <QStyleOptionViewItem>
#include <QApplication>
#include <QPainter>
#include "base/utils/misc.h"
@ -67,7 +67,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem @@ -67,7 +67,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
}
const bool hideValues = Preferences::instance()->getHideZeroValues() & isHideState;
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
QItemDelegate::drawBackground(painter, opt, index);
switch (index.column()) {
case TorrentModel::TR_AMOUNT_DOWNLOADED:
@ -162,7 +162,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem @@ -162,7 +162,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
break;
}
case TorrentModel::TR_PROGRESS: {
QStyleOptionProgressBarV2 newopt;
QStyleOptionProgressBar newopt;
qreal progress = index.data().toDouble() * 100.;
newopt.rect = opt.rect;
newopt.text = ((progress == 100.0) ? QString("100%") : Utils::String::fromDouble(progress, 1) + "%");

Loading…
Cancel
Save