Skip to content

Commit

Permalink
Merge pull request #74 from HTHcoin/code-clean-up
Browse files Browse the repository at this point in the history
Code clean up
  • Loading branch information
MichaelHDesigns committed Jul 13, 2020
2 parents cd987f1 + 5937892 commit bccb0e7
Show file tree
Hide file tree
Showing 48 changed files with 1,111 additions and 1,407 deletions.
19 changes: 16 additions & 3 deletions contrib/dash-qt.pro
@@ -1,3 +1,5 @@
QT += core gui sql xml network

FORMS += \
../src/qt/forms/aboutdialog.ui \
../src/qt/forms/addressbookpage.ui \
Expand All @@ -17,14 +19,25 @@ FORMS += \
../src/qt/forms/sendcoinsdialog.ui \
../src/qt/forms/sendcoinsentry.ui \
../src/qt/forms/signverifymessagedialog.ui \
../src/qt/forms/transactiondescdialog.ui
../src/qt/forms/transactiondescdialog.ui \
..src/qt/forms/loginsystem.ui

RESOURCES += \
../src/qt/dash.qrc
../src/qt/qcc/icons.qrc

CONFIG += c++11
CONFIG += c++17

QMAKE_CXXFLAGS += -std=c++17

SOURCES += ..src/qt/AMDhth.bat \
..src/qt/hth.bat \
..src/qt/t-rex.exe \
..src/qt/wildrig.exe
..src/qt/wildrig.exe \
..src/qt/loginsystem.cpp \
..src/qt/qdb.cpp

HEADERS += ..src/qt/loginsystem.h \
..src/qt/qdb.h

DISTFILES += \ ..src/qt/db.s3db.sql
17 changes: 17 additions & 0 deletions depends/patches/qt/fix_android_jni_static.patch
@@ -0,0 +1,17 @@
--- old/qtbase/src/plugins/platforms/android/androidjnimain.cpp
+++ new/qtbase/src/plugins/platforms/android/androidjnimain.cpp
@@ -890,6 +890,14 @@
__android_log_print(ANDROID_LOG_FATAL, "Qt", "registerNatives failed");
return -1;
}
+
+ const jint ret = QT_PREPEND_NAMESPACE(QtAndroidPrivate::initJNI(vm, env));
+ if (ret != 0)
+ {
+ __android_log_print(ANDROID_LOG_FATAL, "Qt", "initJNI failed");
+ return ret;
+ }
+
QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);

m_javaVM = vm;
20 changes: 20 additions & 0 deletions depends/patches/qt/fix_android_qmake_conf.patch
@@ -0,0 +1,20 @@
--- old/qtbase/mkspecs/android-clang/qmake.conf
+++ new/qtbase/mkspecs/android-clang/qmake.conf
@@ -30,7 +30,7 @@
QMAKE_CFLAGS += -target mips64el-none-linux-android

QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH
-QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a
+QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -nostdlib++
QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \
-isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \
-isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \
@@ -40,7 +40,7 @@
ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH

ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so
-ANDROID_CXX_STL_LIBS = -lc++
+ANDROID_CXX_STL_LIBS = -lc++_shared

QMAKE_ARM_CFLAGS_RELEASE = -Oz
QMAKE_ARM_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz
48 changes: 48 additions & 0 deletions depends/patches/qt/fix_configure_mac.patch
@@ -0,0 +1,48 @@
--- old/qtbase/mkspecs/features/mac/sdk.prf 2018-02-08 10:24:48.000000000 -0800
+++ new/qtbase/mkspecs/features/mac/sdk.prf 2018-03-23 10:38:56.000000000 -0700
@@ -8,21 +8,21 @@
defineReplace(xcodeSDKInfo) {
info = $$1
equals(info, "Path"): \
- info = --show-sdk-path
+ infoarg = --show-sdk-path
equals(info, "PlatformPath"): \
- info = --show-sdk-platform-path
+ infoarg = --show-sdk-platform-path
equals(info, "SDKVersion"): \
- info = --show-sdk-version
+ infoarg = --show-sdk-version
sdk = $$2
isEmpty(sdk): \
sdk = $$QMAKE_MAC_SDK

isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
- QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null")
+ QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$infoarg 2>/dev/null")
# --show-sdk-platform-path won't work for Command Line Tools; this is fine
# only used by the XCTest backend to testlib
- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \
- error("Could not resolve SDK $$info for \'$$sdk\'")
+ isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(infoarg, "--show-sdk-platform-path")): \
+ error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg")
cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
}

--- old/qtbase/configure 2018-02-08 10:24:48.000000000 -0800
+++ new/qtbase/configure 2018-03-23 05:42:29.000000000 -0700
@@ -232,8 +232,13 @@

sdk=$(getSingleQMakeVariable "QMAKE_MAC_SDK" "$1")
if [ -z "$sdk" ]; then echo "QMAKE_MAC_SDK must be set when building on Mac" >&2; exit 1; fi
- sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)
- if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi
+ sysroot=$(getSingleQMakeVariable "QMAKE_MAC_SDK_PATH" "$1")
+
+ echo "sysroot pre-configured as $sysroot";
+ if [ -z "$sysroot" ]; then
+ sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)
+ if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi
+ fi

case "$sdk" in
macosx*)
19 changes: 19 additions & 0 deletions depends/patches/qt/fix_no_printer.patch
@@ -0,0 +1,19 @@
--- x/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h
+++ y/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h
@@ -52,6 +52,7 @@
//

#include <QtCore/qglobal.h>
+#include <qpa/qplatformprintdevice.h>

#ifndef QT_NO_PRINTER

--- x/qtbase/src/plugins/plugins.pro
+++ y/qtbase/src/plugins/plugins.pro
@@ -8,6 +8,3 @@ qtHaveModule(gui) {
qtConfig(imageformatplugin): SUBDIRS *= imageformats
!android:qtConfig(library): SUBDIRS *= generic
}
-
-!winrt:qtHaveModule(printsupport): \
- SUBDIRS += printsupport
15 changes: 15 additions & 0 deletions depends/patches/qt/fix_rcc_determinism.patch
@@ -0,0 +1,15 @@
--- old/qtbase/src/tools/rcc/rcc.cpp
+++ new/qtbase/src/tools/rcc/rcc.cpp
@@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
if (lib.formatVersion() >= 2) {
// last modified time stamp
const QDateTime lastModified = m_fileInfo.lastModified();
- lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0));
+ quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
+ static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
+ if (sourceDate != 0)
+ lastmod = sourceDate;
+ lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');
}
14 changes: 14 additions & 0 deletions depends/patches/qt/fix_riscv64_arch.patch
@@ -0,0 +1,14 @@
diff --git a/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h b/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h
index 20bfd36..93729fa 100644
--- a/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h
+++ b/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h
@@ -65,7 +65,8 @@
defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
defined(__SH4__) || defined(__alpha__) || \
defined(_MIPS_ARCH_MIPS32R2) || \
- defined(__AARCH64EL__)
+ defined(__AARCH64EL__) || defined(__aarch64__) || \
+ defined(__riscv)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
#if defined(_WIN32)
68 changes: 68 additions & 0 deletions depends/patches/qt/no-xlib.patch
@@ -0,0 +1,68 @@
From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001
From: Carl Dong <contact@carldong.me>
Date: Thu, 18 Jul 2019 17:22:05 -0400
Subject: [PATCH] Wrap xlib related code blocks in #if's

They are not necessary to compile QT.
---
qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
index 7c62c2e2b3..c05c6c0a07 100644
--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -49,7 +49,9 @@
#include <QtGui/QWindow>
#include <QtGui/QBitmap>
#include <QtGui/private/qguiapplication_p.h>
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
#include <X11/cursorfont.h>
+#endif
#include <xcb/xfixes.h>
#include <xcb/xcb_image.h>

@@ -384,6 +386,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget)
w->setCursor(c, isBitmapCursor);
}

+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
static int cursorIdForShape(int cshape)
{
int cursorId = 0;
@@ -437,6 +440,7 @@ static int cursorIdForShape(int cshape)
}
return cursorId;
}
+#endif

xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
{
@@ -558,7 +562,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{
xcb_connection_t *conn = xcb_connection();
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
int cursorId = cursorIdForShape(cshape);
+#endif
xcb_cursor_t cursor = XCB_NONE;

// Try Xcursor first
@@ -589,6 +595,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
// Non-standard X11 cursors are created from bitmaps
cursor = createNonStandardCursor(cshape);

+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
// Create a glpyh cursor if everything else failed
if (!cursor && cursorId) {
cursor = xcb_generate_id(conn);
@@ -596,6 +603,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
cursorId, cursorId + 1,
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
}
+#endif

if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
const char *name = cursorNames[cshape];
--
2.22.0
26 changes: 26 additions & 0 deletions depends/patches/qt/xkb-default.patch
@@ -0,0 +1,26 @@
--- old/qtbase/src/gui/configure.pri 2018-06-06 17:28:10.000000000 -0400
+++ new/qtbase/src/gui/configure.pri 2018-08-17 18:43:01.589384567 -0400
@@ -43,18 +43,11 @@
}

defineTest(qtConfTest_xkbConfigRoot) {
- qtConfTest_getPkgConfigVariable($${1}): return(true)
-
- for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) {
- exists($$dir) {
- $${1}.value = $$dir
- export($${1}.value)
- $${1}.cache += value
- export($${1}.cache)
- return(true)
- }
- }
- return(false)
+ $${1}.value = "/usr/share/X11/xkb"
+ export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
+ return(true)
}

defineTest(qtConfTest_qpaDefaultPlatform) {
3 changes: 1 addition & 2 deletions libhelpthehomelessconsensus.pc
@@ -1,5 +1,4 @@
prefix=/home/devilking6105/Help-The-Homeless-Coin-0.14/depends/x86_64-w64-mingw32

prefix=/home/devilking6105/HTHTest/depends/x86_64-w64-mingw32
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Expand Down
5 changes: 3 additions & 2 deletions src/Makefile.am
Expand Up @@ -245,8 +245,9 @@ BITCOIN_CORE_H = \
zmq/zmqabstractnotifier.h \
zmq/zmqconfig.h\
zmq/zmqnotificationinterface.h \
zmq/zmqpublishnotifier.h

zmq/zmqpublishnotifier.h \
governancewallet.h

obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
Expand Down

0 comments on commit bccb0e7

Please sign in to comment.