Skip to content

Commit

Permalink
Ensure qtcharts support works across all platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
barrystyle committed Dec 12, 2019
1 parent f326361 commit bef46ae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 3 additions & 4 deletions build-aux/m4/bitcoin_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,15 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
TEMP_LIBS="$LIBS"
BITCOIN_QT_CHECK([
if test "x$qt_include_path" != x; then
QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus -I$qt_include_path/QtSvg -I$qt_include_path/QtCharts"
QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus -I$qt_include_path/QtConcurrent -I$qt_include_path/QtSvg -I$qt_include_path/QtCharts"
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
fi
])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtSvg],, BITCOIN_QT_FAIL(QtSvg headers missing))])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtCharts],, BITCOIN_QT_FAIL(QtCharts headers missing))])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtConcurrent],, BITCOIN_QT_FAIL(QtConcurrent headers missing))])
BITCOIN_QT_CHECK([
if test "x$bitcoin_qt_want_version" = xauto; then
Expand Down Expand Up @@ -515,7 +514,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Svg],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Svg not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Concurrent],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Concurrent not found)))
QT_LIBS="$LIBS"
LIBS="$TEMP_LIBS"
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ AC_ARG_ENABLE([extended-functional-tests],

AC_ARG_WITH([qtcharts],
[AS_HELP_STRING([--with-qtcharts],
[enable QTCHARTS code support (default is yes if qt is enabled and qtchartview is found)])],
[enable qtcharts support (default is yes if qt is enabled and qtchartview is found)])],
[use_qtcharts=$withval],
[use_qtcharts=auto])

Expand Down Expand Up @@ -1142,7 +1142,7 @@ else
BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
if test x$use_qtcharts != xno; then
BITCOIN_QT_CHECK([AC_CHECK_LIB([Qt5Charts], [main],[CHARTS_LIBS=-lQt5Charts], [have_qtcharts=no])])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([qchartview.h],, have_qtcharts=no)])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtCharts/qchartview.h],, have_qtcharts=no)])
fi
fi

Expand Down Expand Up @@ -1314,7 +1314,7 @@ if test x$bitcoin_enable_qt != xno; then
AC_MSG_RESULT($bitcoin_enable_qt_dbus)

dnl enable qtcharts support
AC_MSG_CHECKING([whether to build GUI with support for qtcharts codes])
AC_MSG_CHECKING([whether to build GUI with support for qtcharts])
if test x$have_qtcharts = xno; then
if test x$use_qtcharts = xyes; then
AC_MSG_ERROR("QTCharts support requested but cannot be built. use --without-qtcharts")
Expand Down
6 changes: 6 additions & 0 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,12 @@ bool WalletModel::isMine(CBitcoinAddress address)
return IsMine(*wallet, address.Get());
}

bool WalletModel::isMine(const QString& addressStr)
{
CBitcoinAddress address(addressStr.toStdString());
return IsMine(*wallet, address.Get());
}

bool WalletModel::isUsed(CBitcoinAddress address)
{
return wallet->IsUsed(address);
Expand Down
1 change: 1 addition & 0 deletions src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ class WalletModel : public QObject
int64_t getKeyCreationTime(const CBitcoinAddress& address);
CBitcoinAddress getNewAddress(std::string label = "") const;
bool isMine(CBitcoinAddress address);
bool isMine(const QString& addressStr);
bool isUsed(CBitcoinAddress address);
void getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);
bool isSpent(const COutPoint& outpoint) const;
Expand Down

0 comments on commit bef46ae

Please sign in to comment.