Skip to content

Commit b42b22f

Browse files
committedOct 21, 2024·
attempt to fix Qt 6.4 build
1 parent 7ed66a6 commit b42b22f

14 files changed

+58
-14
lines changed
 

‎gpt4all-chat/src/chat.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
#include <QStringList>
1515
#include <QVariant>
1616
#include <Qt>
17-
#include <QtLogging>
1817

1918
#include <utility>
2019

20+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
21+
# include <QtLogging>
22+
#endif
23+
2124
Chat::Chat(QObject *parent)
2225
: QObject(parent)
2326
, m_id(Network::globalInstance()->generateUniqueId())

‎gpt4all-chat/src/chatapi.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#include <QVariant>
1717
#include <Qt>
1818
#include <QtGlobal>
19-
#include <QtLogging>
2019

2120
#include <iostream>
2221

22+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
23+
# include <QtLogging>
24+
#endif
25+
2326
using namespace Qt::Literals::StringLiterals;
2427

2528
//#define DEBUG

‎gpt4all-chat/src/chatlistmodel.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
#include <QVector>
1717
#include <Qt>
1818
#include <QtGlobal>
19-
#include <QtLogging>
19+
20+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
21+
# include <QtLogging>
22+
#endif
2023

2124
class ChatsRestoreThread : public QThread
2225
{

‎gpt4all-chat/src/chatllm.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <QUrl>
2525
#include <QWaitCondition>
2626
#include <Qt>
27-
#include <QtLogging>
2827

2928
#include <algorithm>
3029
#include <cctype>
@@ -37,6 +36,10 @@
3736
#include <utility>
3837
#include <vector>
3938

39+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
40+
# include <QtLogging>
41+
#endif
42+
4043
using namespace Qt::Literals::StringLiterals;
4144

4245
//#define DEBUG

‎gpt4all-chat/src/database.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@
2424
#include <QUtf8StringView>
2525
#include <QVariant>
2626
#include <Qt>
27-
#include <QtLogging>
2827

2928
#include <algorithm>
3029
#include <cmath>
3130
#include <optional>
3231
#include <stdexcept>
3332

33+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
34+
# include <QtLogging>
35+
#endif
36+
3437
using namespace Qt::Literals::StringLiterals;
3538
namespace ranges = std::ranges;
3639
namespace us = unum::usearch;

‎gpt4all-chat/src/download.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@
2727
#include <QVariant>
2828
#include <QVector>
2929
#include <Qt>
30-
#include <QtLogging>
3130

3231
#include <algorithm>
3332
#include <compare>
3433
#include <cstddef>
3534
#include <utility>
3635

36+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
37+
# include <QtLogging>
38+
#endif
39+
3740
using namespace Qt::Literals::StringLiterals;
3841

3942
class MyDownload: public Download { };

‎gpt4all-chat/src/embllm.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
#include <QUrl>
2323
#include <Qt>
2424
#include <QtGlobal>
25-
#include <QtLogging>
2625

2726
#include <exception>
2827
#include <utility>
2928
#include <vector>
3029

30+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
31+
# include <QtLogging>
32+
#endif
33+
3134
using namespace Qt::Literals::StringLiterals;
3235

3336
static const QString EMBEDDING_MODEL_NAME = u"nomic-embed-text-v1.5"_s;

‎gpt4all-chat/src/llm.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
#include <QProcess>
1212
#include <QSettings>
1313
#include <QUrl>
14-
#include <QtLogging>
14+
15+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
16+
# include <QtLogging>
17+
#endif
1518

1619
#ifdef GPT4ALL_OFFLINE_INSTALLER
1720
# include <QDesktopServices>

‎gpt4all-chat/src/logger.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
#include <QFile>
55
#include <QString>
6-
#include <QtLogging>
6+
#include <QtGlobal>
7+
8+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
9+
# include <QtLogging>
10+
#endif
711

812
class Logger
913
{

‎gpt4all-chat/src/modellist.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <QTextStream>
3333
#include <QTimer>
3434
#include <QUrl>
35-
#include <QtLogging>
3635

3736
#include <algorithm>
3837
#include <cstddef>
@@ -41,6 +40,10 @@
4140
#include <string>
4241
#include <utility>
4342

43+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
44+
# include <QtLogging>
45+
#endif
46+
4447
using namespace Qt::Literals::StringLiterals;
4548

4649
//#define USE_LOCAL_MODELSJSON

‎gpt4all-chat/src/mysettings.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
#include <QThread>
1616
#include <QUrl>
1717
#include <QVariant>
18-
#include <QtLogging>
18+
#include <QtGlobal>
1919

2020
#include <algorithm>
2121
#include <string>
2222
#include <thread>
2323
#include <vector>
2424

25+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
26+
# include <QtLogging>
27+
#endif
28+
2529
using namespace Qt::Literals::StringLiterals;
2630

2731
// used only for settings serialization, do not translate

‎gpt4all-chat/src/network.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@
2929
#include <QSysInfo>
3030
#include <Qt>
3131
#include <QtGlobal>
32-
#include <QtLogging>
3332
#include <QUrl>
3433
#include <QUuid>
3534

3635
#include <cmath>
3736
#include <cstring>
3837
#include <utility>
3938

39+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
40+
# include <QtLogging>
41+
#endif
42+
4043
#ifdef __GLIBC__
4144
# include <gnu/libc-version.h>
4245
#endif

‎gpt4all-chat/src/server.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <Qt>
2727
#include <QtCborCommon>
2828
#include <QtGlobal>
29-
#include <QtLogging>
3029

3130
#include <cstdint>
3231
#include <iostream>
@@ -37,6 +36,10 @@
3736
#include <unordered_map>
3837
#include <utility>
3938

39+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
40+
# include <QtLogging>
41+
#endif
42+
4043
using namespace std::string_literals;
4144
using namespace Qt::Literals::StringLiterals;
4245

‎gpt4all-chat/src/xlsxtomd.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#include <QStringView>
1717
#include <QVariant>
1818
#include <QtGlobal>
19-
#include <QtLogging>
2019

2120
#include <memory>
2221

22+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
23+
# include <QtLogging>
24+
#endif
25+
2326
using namespace Qt::Literals::StringLiterals;
2427

2528

0 commit comments

Comments
 (0)