Skip to content

Commit 9f5cadc

Browse files
Matthieu BruelMatthieu Bruel
authored andcommitted
Compilation on MacOS with Qt v6.1.2
1 parent 69a5eee commit 9f5cadc

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

src/NgPost.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ const QMap<NgPost::GROUP_POLICY, QString> NgPost::sGroupPolicies = {
240240
{GROUP_POLICY::EACH_FILE, "each_file"}
241241
};
242242

243-
#ifdef __DEBUG__
243+
#if __DEBUG__ && QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
244244
#include <QNetworkConfigurationManager>
245245
#endif
246246
NgPost::NgPost(int &argc, char *argv[]):
@@ -1818,22 +1818,22 @@ void NgPost::setNzbName(const QFileInfo &fileInfo)
18181818
_nzbName = fileInfo.isDir() ? QDir(fileInfo.absoluteFilePath()).dirName() : fileInfo.completeBaseName();
18191819
if (_removeAccentsOnNzbFileName)
18201820
{
1821-
_nzbName.replace(QRegExp("[ÀÁÂÃÄÅ]"), "A");
1822-
_nzbName.replace(QRegExp("[àáâãäå]"), "a");
1821+
_nzbName.replace(QRegularExpression("[ÀÁÂÃÄÅ]"), "A");
1822+
_nzbName.replace(QRegularExpression("[àáâãäå]"), "a");
18231823
_nzbName.replace("Ç","C");
18241824
_nzbName.replace("ç","c");
1825-
_nzbName.replace(QRegExp("[ÈÉÊË]"), "E");
1826-
_nzbName.replace(QRegExp("[èéêë]"), "e");
1827-
_nzbName.replace(QRegExp("[ÌÍÎÏ]"), "I");
1828-
_nzbName.replace(QRegExp("[ìíîï]"), "i");
1825+
_nzbName.replace(QRegularExpression("[ÈÉÊË]"), "E");
1826+
_nzbName.replace(QRegularExpression("[èéêë]"), "e");
1827+
_nzbName.replace(QRegularExpression("[ÌÍÎÏ]"), "I");
1828+
_nzbName.replace(QRegularExpression("[ìíîï]"), "i");
18291829
_nzbName.replace("Ñ","N");
18301830
_nzbName.replace("ñ","n");
1831-
_nzbName.replace(QRegExp("[ÒÓÔÕÖØ]"), "O");
1832-
_nzbName.replace(QRegExp("[òóôõöø]"), "o");
1833-
_nzbName.replace(QRegExp("[ÙÚÛÜ]"), "U");
1834-
_nzbName.replace(QRegExp("[ùúûü]"), "u");
1835-
_nzbName.replace(QRegExp("[ÿý]"), "y");
1836-
_nzbName.replace(QRegExp("[^A-Za-z0-9\\.,_\\-\\(\\)\\[\\]\\{\\}!#&'\\+ ]"), "");
1831+
_nzbName.replace(QRegularExpression("[ÒÓÔÕÖØ]"), "O");
1832+
_nzbName.replace(QRegularExpression("[òóôõöø]"), "o");
1833+
_nzbName.replace(QRegularExpression("[ÙÚÛÜ]"), "U");
1834+
_nzbName.replace(QRegularExpression("[ùúûü]"), "u");
1835+
_nzbName.replace(QRegularExpression("[ÿý]"), "y");
1836+
_nzbName.replace(QRegularExpression("[^A-Za-z0-9\\.,_\\-\\(\\)\\[\\]\\{\\}!#&'\\+ ]"), "");
18371837
}
18381838
}
18391839

src/NgPost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <QNetworkProxy>
3838
class QTranslator;
3939
class NntpConnection;
40-
class NntpServerParams;
40+
struct NntpServerParams;
4141
class NntpFile;
4242
class NntpArticle;
4343
class QCoreApplication;

src/NntpCheckCon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class NzbCheck;
2424

2525
#include <QObject>
2626
#include <QTcpSocket>
27+
#include <QSslError>
2728
class QSslSocket;
28-
class QSslError;
2929
class QByteArray;
3030

3131
class NntpCheckCon : public QObject

src/NntpConnection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
#define NNTPCONNECTION_H
2222

2323
#include <QTcpSocket>
24+
#include <QSslError>
2425

25-
class NntpServerParams;
26+
struct NntpServerParams;
2627
class NntpArticle;
2728
class NgPost;
2829
class Poster;
2930

3031
class QSslSocket;
31-
class QSslError;
3232
class QByteArray;
3333
#ifdef __USE_CONNECTION_TIMEOUT__
3434
class QTimer;

src/NzbCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int NzbCheck::parseNzb()
105105
{
106106
QXmlStreamReader::TokenType type = xmlReader.readNext();
107107
if (type == QXmlStreamReader::TokenType::StartElement
108-
&& xmlReader.name() == "file")
108+
&& xmlReader.name().compare(QLatin1String("file")))
109109
{
110110
QString subject = xmlReader.attributes().value("subject").toString();
111111
QRegularExpressionMatch match = sNntpArticleYencSubjectRegExp.match(subject);
@@ -116,7 +116,7 @@ int NzbCheck::parseNzb()
116116
{
117117
QXmlStreamReader::TokenType type = xmlReader.readNext();
118118
if (type == QXmlStreamReader::TokenType::EndElement
119-
&& xmlReader.name() == "file")
119+
&& xmlReader.name().compare(QLatin1String("file")))
120120
{
121121
if (debugMode())
122122
_cout << tr("The file '%1' has %2 articles in the nzb (expected: %3)").arg(
@@ -133,7 +133,7 @@ int NzbCheck::parseNzb()
133133
break;
134134
}
135135
else if (type == QXmlStreamReader::TokenType::StartElement
136-
&& xmlReader.name() == "segment")
136+
&& xmlReader.name().compare(QLatin1String("segment")))
137137
{
138138
++nbArticles;
139139
xmlReader.readNext();

src/NzbCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <QTimer>
2828
#include <QCommandLineOption>
2929
#include <QElapsedTimer>
30-
class NntpServerParams;
30+
struct NntpServerParams;
3131
class NntpCheckCon;
3232

3333
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)

src/hmi/MainWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <QDebug>
2929
#include <QProgressBar>
3030
#include <QLabel>
31-
#include <QDesktopWidget>
31+
#include <QScreen>
3232
#include <QMessageBox>
3333

3434

@@ -87,7 +87,7 @@ MainWindow::MainWindow(QWidget *parent) :
8787
_ui->progressBar->setRange(0, 100);
8888
updateProgressBar(0, 0, "");
8989

90-
QSize screenSize = QDesktopWidget().availableGeometry(this).size();
90+
QSize screenSize = qApp->screens()[0]->size();
9191
resize(screenSize * 0.8);
9292
setWindowIcon(QIcon(":/icons/ngPost.png"));
9393
setGeometry((screenSize.width() - width())/2, (screenSize.height() - height())/2, width(), height());

src/hmi/MainWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <QMainWindow>
2424
#include <QFileInfoList>
2525
class NgPost;
26-
class NntpServerParams;
26+
struct NntpServerParams;
2727
class NntpFile;
2828
class PostingWidget;
2929
class AutoPostWidget;

0 commit comments

Comments
 (0)