Open
Conversation
Contributor
azuwis
commented
Nov 13, 2024
- Q_WS_MAC -> Q_OS_MACOS
- Make loadFile a public member
Q_WS_MAC is no longer defined in Qt 5 and later[1]. [1]: https://doc.qt.io/qt-6/macos-issues.html#compile-time-flags
Fix build on macOS:
```
kchmviewerapp.cpp:66:11: error: 'loadFile' is a private member of 'MainWindow'
main->loadFile(m_filePath);
^
./mainwindow.h:169:9: note: declared private here
bool loadFile( const QString &fileName, bool call_open_page = true );
^
```
Contributor
|
Hi. |
Contributor
Author
|
Do you mean? : diff --git a/src/src.pro b/src/src.pro
index 14c31a1..046a12e 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -72,8 +72,6 @@ linux-g++-32: {
# General per-platform settings
macx: {
- HEADERS += kchmviewerapp.h
- SOURCES += kchmviewerapp.cpp
QMAKE_INFO_PLIST=resources/Info.plist
QMAKE_POST_LINK += cp resources/*.icns ${DESTDIR}/kchmviewer.app/Contents/Resources;
LIBS += ../lib/libebook/libebook.aGive error: |
Contributor
|
This is not enough, main.cpp must also be changed so that there are no differences between macos and other platforms. As far as I understand, KchmViewer used to not be able to open files from command line arguments and KchmviewerApp added this feature for macos. |
Contributor
Author
|
It does build using this patch: index da7d917..3747400 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,11 +31,7 @@
#include <kaboutdata.h>
#endif
-#if defined (Q_OS_MACOS)
- #include "kchmviewerapp.h"
-#else
- typedef QApplication KchmviewerApp;
-#endif
+typedef QApplication KchmviewerApp;
MainWindow * mainWindow;
diff --git a/src/src.pro b/src/src.pro
index 14c31a1..046a12e 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -72,8 +72,6 @@ linux-g++-32: {
# General per-platform settings
macx: {
- HEADERS += kchmviewerapp.h
- SOURCES += kchmviewerapp.cpp
QMAKE_INFO_PLIST=resources/Info.plist
QMAKE_POST_LINK += cp resources/*.icns ${DESTDIR}/kchmviewer.app/Contents/Resources;
LIBS += ../lib/libebook/libebook.aI don't quite understand why |
Contributor
|
I found the reason for these files, they should not be deleted. |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.