diff --git a/billioncoin-qt.pro b/billioncoin-qt.pro index 1c924b1..659894b 100644 --- a/billioncoin-qt.pro +++ b/billioncoin-qt.pro @@ -1,10 +1,13 @@ TEMPLATE = app -TARGET = +TARGET = BillionCoin-Qt VERSION = 0.6.3 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN __NO_SYSTEM_INCLUDES CONFIG += no_include_pwd +CONFIG += thread QT += webkit +QT += widgets +QT += webkitwidgets windows:LIBS += -lshlwapi LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) @@ -26,6 +29,23 @@ OPENSSL_LIB_PATH=C:\deps\openssl-1.0.1e MINIUPNPC_LIB_PATH=C:\deps\miniupnpc-1.8 MINIUPNPC_INCLUDE_PATH=C:\deps\miniupnpc-1.8 +macx { + LIBS += -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread + + BOOST_LIB_SUFFIX =-mt + BOOST_THREAD_LIB_SUFFIX =-mt + BOOST_INCLUDE_PATH=/opt/local/include + BOOST_LIB_PATH=/opt/local/lib + BDB_INCLUDE_PATH=/opt/local/include/db48 + BDB_LIB_PATH=/opt/local/lib/db48 + BDB_LIB_SUFFIX = -4.8 + OPENSSL_INCLUDE_PATH=/usr/include/openssl + OPENSSL_LIB_PATH=/usr/lib + MINIUPNPC_LIB_PATH=/opt/local/include/miniupnpc + MINIUPNPC_INCLUDE_PATH=/opt/local/lib + USE_QRCODE=1 +} + OBJECTS_DIR = build MOC_DIR = build UI_DIR = build @@ -301,7 +321,10 @@ QMAKE_EXTRA_COMPILERS += TSQM # "Other files" to show in Qt Creator OTHER_FILES += \ contrib/gitian-descriptors/* doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt.rc \ - share/setup.nsi + share/setup.nsi \ + src/qt/res/makedmg.sh \ + src/qt/res/setdmg.scpt \ + src/qt/res/images/dmg_bg.png # platform specific defaults, if not overridden on command line isEmpty(BOOST_LIB_SUFFIX) { @@ -358,7 +381,7 @@ macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 macx:ICON = src/qt/res/icons/bitcoin.icns -macx:TARGET = "billioncoin-qt" +macx:TARGET = "BillionCoin-Qt" # Set libraries and includes at end, to use platform-defined defaults if not overridden INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH @@ -377,4 +400,15 @@ contains(RELEASE, 1) { system($$QMAKE_LRELEASE -silent $$_PRO_FILE_) +mac { + LIBS += -ldb_cxx$$BDB_LIB_SUFFIX + # Bundle OSX dependencies + QMAKE_POST_LINK += macdeployqt "$$OUT_PWD/BillionCoin-Qt.app"; + QMAKE_POST_LINK += cp /opt/local/lib/db48/libdb_cxx-4.8.dylib "$$OUT_PWD/BillionCoin-Qt.app/Contents/Frameworks/libdb_cxx-4.8.dylib"; + QMAKE_POST_LINK += install_name_tool -change /opt/local/lib/db48/libdb_cxx-4.8.dylib @executable_path/../Frameworks/libdb_cxx-4.8.dylib "$$OUT_PWD/BillionCoin-Qt.app/Contents/MacOS/BillionCoin-Qt"; + QMAKE_POST_LINK += install_name_tool -id @executable_path/../Frameworks/libdb_cxx-4.8.dylib "$$OUT_PWD/BillionCoin-Qt.app/Contents/Frameworks/libdb_cxx-4.8.dylib"; + + # Create DMG file + QMAKE_POST_LINK += $$PWD/src/qt/res/makedmg.sh "$$PWD" "$$OUT_PWD" +} diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 3a9eea9..d95bb74 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2500,7 +2500,7 @@ int ReadHTTPStatus(std::basic_istream& stream, int &proto) int ReadHTTPHeader(std::basic_istream& stream, map& mapHeadersRet) { int nLen = 0; - loop + forloop { string str; std::getline(stream, str); @@ -3039,7 +3039,7 @@ void ThreadRPCServer3(void* parg) AcceptedConnection *conn = (AcceptedConnection *) parg; bool fRun = true; - loop { + forloop { if (fShutdown || !fRun) { conn->close(); diff --git a/src/db.cpp b/src/db.cpp index de93362..f09d0e7 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -657,7 +657,7 @@ bool CTxDB::LoadBlockIndexGuts() // Load mapBlockIndex unsigned int fFlags = DB_SET_RANGE; - loop + forloop { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); diff --git a/src/init.cpp b/src/init.cpp index 6191769..6346596 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -76,7 +76,9 @@ void Shutdown(void* parg) bitdb.Flush(false); StopNode(); bitdb.Flush(true); +#ifndef MAC_OSX boost::filesystem::remove(GetPidFile()); +#endif UnregisterWallet(pwalletMain); delete pwalletMain; CreateThread(ExitTimeout, NULL); @@ -447,7 +449,9 @@ bool AppInit2() } if (pid > 0) { +#ifndef MAC_OSX CreatePidFile(GetPidFile(), pid); +#endif return true; } diff --git a/src/irc.cpp b/src/irc.cpp index 471f5e9..158c05e 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -79,7 +79,7 @@ static bool Send(SOCKET hSocket, const char* pszSend) bool RecvLineIRC(SOCKET hSocket, string& strLine) { - loop + forloop { bool fRet = RecvLine(hSocket, strLine); if (fRet) @@ -102,7 +102,7 @@ bool RecvLineIRC(SOCKET hSocket, string& strLine) int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL) { - loop + forloop { string strLine; strLine.reserve(10000); @@ -137,7 +137,7 @@ bool Wait(int nSeconds) bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet) { strRet.clear(); - loop + forloop { string strLine; if (!RecvLineIRC(hSocket, strLine)) diff --git a/src/main.cpp b/src/main.cpp index 8421108..ae6a9d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2035,7 +2035,7 @@ static unsigned int nCurrentBlockFile = 1; FILE* AppendBlockFile(unsigned int& nFileRet) { nFileRet = 0; - loop + forloop { FILE* file = OpenBlockFile(nCurrentBlockFile, 0, "ab"); if (!file) @@ -2119,7 +2119,7 @@ if (false && block.GetHash() != hashGenesisBlock) uint256 thash; char scratchpad[SCRYPT_SCRATCHPAD_SIZE]; - loop + forloop { scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad); if (thash <= hashTarget) @@ -3054,7 +3054,7 @@ bool ProcessMessages(CNode* pfrom) // (x) data // - loop + forloop { // Don't bother if send buffer is too full to respond anyway if (pfrom->vSend.size() >= SendBufferSize()) @@ -3769,14 +3769,14 @@ void static BitcoinMiner(CWallet *pwallet) // int64 nStart = GetTime(); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); - loop + forloop { unsigned int nHashesDone = 0; //unsigned int nNonceFound; uint256 thash; char scratchpad[SCRYPT_SCRATCHPAD_SIZE]; - loop + forloop { scrypt_1024_1_1_256_sp(BEGIN(pblock->nVersion), BEGIN(thash), scratchpad); diff --git a/src/net.cpp b/src/net.cpp index 54a55ed..dc91ea2 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -141,7 +141,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer) bool RecvLine(SOCKET hSocket, string& strLine) { strLine = ""; - loop + forloop { char c; int nBytes = recv(hSocket, &c, 1, 0); @@ -314,7 +314,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha { if (strLine.empty()) // HTTP response is separated from headers by blank line { - loop + forloop { if (!RecvLine(hSocket, strLine)) { @@ -667,7 +667,7 @@ void ThreadSocketHandler2(void* parg) list vNodesDisconnected; unsigned int nPrevNodeCount = 0; - loop + forloop { // // Disconnect nodes @@ -1079,7 +1079,7 @@ void ThreadMapPort2(void* parg) else printf("UPnP Port Mapping successful.\n"); int i = 1; - loop { + forloop { if (fShutdown || !fUseUPnP) { r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port, "TCP", 0); @@ -1114,7 +1114,7 @@ void ThreadMapPort2(void* parg) freeUPNPDevlist(devlist); devlist = 0; if (r != 0) FreeUPNPUrls(&urls); - loop { + forloop { if (fShutdown || !fUseUPnP) return; Sleep(2000); @@ -1336,7 +1336,7 @@ void ThreadOpenConnections2(void* parg) // Initiate network connections int64 nStart = GetTime(); - loop + forloop { ProcessOneShot(); @@ -1395,7 +1395,7 @@ void ThreadOpenConnections2(void* parg) int64 nANow = GetAdjustedTime(); int nTries = 0; - loop + forloop { // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections) CAddress addr = addrman.Select(10 + min(nOutbound,8)*10); @@ -1485,7 +1485,7 @@ void ThreadOpenAddedConnections2(void* parg) } } } - loop + forloop { vector > vservConnectAddresses = vservAddressesToAdd; // Attempt to connect to each IP for each addnode entry until at least one is successful per addnode entry diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 8a74a47..631ed1a 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -132,10 +132,13 @@ void AddressBookPage::setModel(AddressTableModel *model) ui->tableView->sortByColumn(0, Qt::AscendingOrder); // Set column widths - ui->tableView->horizontalHeader()->resizeSection( - AddressTableModel::Address, 320); - ui->tableView->horizontalHeader()->setResizeMode( - AddressTableModel::Label, QHeaderView::Stretch); +#if QT_VERSION < 0x050000 + ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Label, QHeaderView::Stretch); + ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents); +#else + ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Label, QHeaderView::Stretch); + ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents); +#endif connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged())); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index eff9aed..50eb9df 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -147,8 +147,11 @@ int main(int argc, char *argv[]) #endif // Internal string conversion is all UTF-8 +#if QT_VERSION < 0x050000 + // Internal string conversion is all UTF-8 QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForTr()); +#endif Q_INIT_RESOURCE(bitcoin); QApplication app(argc, argv); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 17e2f88..6cb7102 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -59,6 +59,8 @@ #include #include +#include + #include BitcoinGUI::BitcoinGUI(QWidget *parent): @@ -925,8 +927,10 @@ void BitcoinGUI::encryptWallet(bool status) void BitcoinGUI::backupWallet() { - QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); - QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)")); + QString filename = GUIUtil::getSaveFileName(this, + tr("Backup Wallet"), QString(), + tr("Wallet Data (*.dat)"), NULL); + if(!filename.isEmpty()) { if(!walletModel->backupWallet(filename)) { QMessageBox::warning(this, tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location.")); diff --git a/src/qt/chatbox.h b/src/qt/chatbox.h index 4d0f39f..8209f4e 100644 --- a/src/qt/chatbox.h +++ b/src/qt/chatbox.h @@ -2,6 +2,7 @@ #define CHATBOX_H #include +#include namespace Ui { class ChatBox; diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index a38d406..54af30a 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include // For Qt::escape #include #include @@ -23,6 +22,12 @@ #include #include +#if QT_VERSION < 0x050000 +#include +#else +#include +#endif + #ifdef WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT @@ -89,7 +94,12 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) SendCoinsRecipient rv; rv.address = uri.path(); rv.amount = 0; +#if QT_VERSION < 0x050000 QList > items = uri.queryItems(); +#else + QUrlQuery uriQuery(uri); + QList > items = uriQuery.queryItems(); +#endif for (QList >::iterator i = items.begin(); i != items.end(); i++) { bool fShouldReturnFalse = false; @@ -142,7 +152,11 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) QString HtmlEscape(const QString& str, bool fMultiLine) { +#if QT_VERSION < 0x050000 QString escaped = Qt::escape(str); +#else + QString escaped = str.toHtmlEscaped(); +#endif if(fMultiLine) { escaped = escaped.replace("\n", "
\n"); @@ -177,7 +191,11 @@ QString getSaveFileName(QWidget *parent, const QString &caption, QString myDir; if(dir.isEmpty()) // Default to user documents location { +#if QT_VERSION < 0x050000 myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); +#else + myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); +#endif } else { diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index df56e69..7775717 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -1,8 +1,16 @@ #include "macdockiconhandler.h" +#if QT_VERSION < 0x050000 #include #include +#else +#include +#include +#endif + +#include +#include extern void qt_mac_set_dock_menu(QMenu*); @@ -47,11 +55,11 @@ - (void)handleDockClickEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAp MacDockIconHandler::MacDockIconHandler() : QObject() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - this->m_dockIconClickEventHandler = [[DockIconClickEventHandler alloc] initWithDockIconHandler:this]; + //this->m_dockIconClickEventHandler = [[DockIconClickEventHandler alloc] initWithDockIconHandler:this]; - this->m_dummyWidget = new QWidget(); - this->m_dockMenu = new QMenu(this->m_dummyWidget); - qt_mac_set_dock_menu(this->m_dockMenu); + //this->m_dummyWidget = new QWidget(); + //this->m_dockMenu = new QMenu(this->m_dummyWidget); + //qt_mac_set_dock_menu(this->m_dockMenu); [pool release]; } @@ -69,15 +77,29 @@ - (void)handleDockClickEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAp void MacDockIconHandler::setIcon(const QIcon &icon) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSImage *image; + NSImage *image = nil; if (icon.isNull()) image = [[NSImage imageNamed:@"NSApplicationIcon"] retain]; else { + // generate NSImage from QIcon and use this as dock icon. QSize size = icon.actualSize(QSize(128, 128)); QPixmap pixmap = icon.pixmap(size); - CGImageRef cgImage = pixmap.toMacCGImageRef(); - image = [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize]; - CFRelease(cgImage); + + // write temp file hack (could also be done through QIODevice [memory]) + QTemporaryFile notificationIconFile; + if (!pixmap.isNull() && notificationIconFile.open()) { + QImageWriter writer(¬ificationIconFile, "PNG"); + if (writer.write(pixmap.toImage())) { + const char *cString = notificationIconFile.fileName().toUtf8().data(); + NSString *macString = [NSString stringWithCString:cString encoding:NSUTF8StringEncoding]; + image = [[NSImage alloc] initWithContentsOfFile:macString]; + } + } + + if(!image) { + // if testnet image could not be created, load std. app icon + image = [[NSImage imageNamed:@"NSApplicationIcon"] retain]; + } } [NSApp setApplicationIconImage:image]; diff --git a/src/qt/miningpage.cpp b/src/qt/miningpage.cpp index 3184112..8a5d630 100644 --- a/src/qt/miningpage.cpp +++ b/src/qt/miningpage.cpp @@ -86,10 +86,10 @@ void MiningPage::startPoolMining() QString urlLine = QString("%1:%2").arg(url, ui->portLine->text()); QString userpassLine = QString("%1:%2").arg(ui->usernameLine->text(), ui->passwordLine->text()); args << "--algo" << "scrypt"; - args << "--scantime" << ui->scantimeBox->text().toAscii(); - args << "--url" << urlLine.toAscii(); - args << "--userpass" << userpassLine.toAscii(); - args << "--threads" << ui->threadsBox->text().toAscii(); + args << "--scantime" << ui->scantimeBox->text().toLatin1(); + args << "--url" << urlLine.toLatin1(); + args << "--userpass" << userpassLine.toLatin1(); + args << "--threads" << ui->threadsBox->text().toLatin1(); args << "--retries" << "-1"; // Retry forever. args << "-P"; // This is needed for this to work correctly on Windows. Extra protocol dump helps flush the buffer quicker. diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 173ec15..5a5951c 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -45,9 +45,10 @@ class TxViewDelegate : public QAbstractItemDelegate bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool(); QVariant value = index.data(Qt::ForegroundRole); QColor foreground = option.palette.color(QPalette::Text); - if(qVariantCanConvert(value)) + if(value.canConvert()) { - foreground = qvariant_cast(value); + QBrush brush = qvariant_cast(value); + foreground = brush.color(); } painter->setPen(foreground); diff --git a/src/qt/res/icons/bitcoin.icns b/src/qt/res/icons/bitcoin.icns index 849af17..6c44a91 100644 Binary files a/src/qt/res/icons/bitcoin.icns and b/src/qt/res/icons/bitcoin.icns differ diff --git a/src/qt/res/images/dmg_bg.png b/src/qt/res/images/dmg_bg.png new file mode 100644 index 0000000..06363fe Binary files /dev/null and b/src/qt/res/images/dmg_bg.png differ diff --git a/src/qt/res/makedmg.sh b/src/qt/res/makedmg.sh new file mode 100755 index 0000000..7f56e46 --- /dev/null +++ b/src/qt/res/makedmg.sh @@ -0,0 +1,16 @@ +mkdir "$2/BillionCoin-Qt" +mkdir "$2/BillionCoin-Qt/.background" +cp -R "$2/BillionCoin-Qt.app" "$2/BillionCoin-Qt/BillionCoin-Qt.app" +cp "$1/src/qt/res/images/dmg_bg.png" "$2/BillionCoin-Qt/.background/BillionCoin.png" +ln -s /Applications/ "$2/BillionCoin-Qt/Applications" + +hdiutil create -srcfolder "$2/BillionCoin-Qt" -volname "BillionCoin-Qt" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size 100m "$2/pack.temp.dmg" +device=$(hdiutil attach -readwrite -noverify -noautoopen "$2/pack.temp.dmg" | egrep '^/dev/' | sed 1q | awk '{print $1}') +sleep 15 +osascript "$1/src/qt/res/setdmg.scpt" +#chmod -Rf go-w /Volumes/BillionCoin-Qt +#sync +#sync +#hdiutil detach ${device} +hdiutil convert "$2/pack.temp.dmg" -format UDZO -imagekey zlib-level=9 -o "$2/BillionCoin-Qt" +rm -f "$2/pack.temp.dmg" diff --git a/src/qt/res/setdmg.scpt b/src/qt/res/setdmg.scpt new file mode 100644 index 0000000..2177cfc --- /dev/null +++ b/src/qt/res/setdmg.scpt @@ -0,0 +1,19 @@ +tell application "Finder" + tell disk "BillionCoin-Qt" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {400, 100, 1000, 550} + set theViewOptions to the icon view options of container window + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to 72 + set background picture of theViewOptions to file ".background:BillionCoin.png" + #make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"} + set position of item "BillionCoin-Qt.app" of container window to {135, 345} + set position of item "Applications" of container window to {470, 345} + update without registering applications + delay 5 + eject + end tell +end tell diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 86c2b01..3a26c60 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -92,7 +92,7 @@ void SendCoinsDialog::on_sendButton_clicked() QStringList formatted; foreach(const SendCoinsRecipient &rcp, recipients) { - formatted.append(tr("%1 to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address)); + formatted.append(tr("%1 to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), GUIUtil::HtmlEscape(rcp.label), rcp.address)); } fNewRecipientAllowed = false; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 1370a30..75090cf 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -179,8 +179,11 @@ void TransactionView::setModel(WalletModel *model) TransactionTableModel::Date, 120); transactionView->horizontalHeader()->resizeSection( TransactionTableModel::Type, 120); - transactionView->horizontalHeader()->setResizeMode( - TransactionTableModel::ToAddress, QHeaderView::Stretch); +#if QT_VERSION < 0x050000 + transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); +#else + transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); +#endif transactionView->horizontalHeader()->resizeSection( TransactionTableModel::Amount, 100); } diff --git a/src/script.cpp b/src/script.cpp index 7a9c624..eb8244a 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1240,7 +1240,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector& v) return; string::size_type i1 = 0; string::size_type i2; - loop + forloop { i2 = str.find(c, i1); if (i2 == str.npos) @@ -443,7 +443,7 @@ vector ParseHex(const char* psz) { // convert hex dump to vector vector vch; - loop + forloop { while (isspace(*psz)) psz++; @@ -897,7 +897,7 @@ string DecodeBase32(const string& str) bool WildcardMatch(const char* psz, const char* mask) { - loop + forloop { switch (*mask) { @@ -1037,7 +1037,10 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) boost::filesystem::path GetConfigFile() { boost::filesystem::path pathConfigFile(GetArg("-conf", "billioncoin.conf")); + // This breaks on OSX +#ifndef MAC_OSX if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile; +#endif return pathConfigFile; } @@ -1068,7 +1071,10 @@ void ReadConfigFile(map& mapSettingsRet, boost::filesystem::path GetPidFile() { boost::filesystem::path pathPidFile(GetArg("-pid", "billioncoind.pid")); + // This breaks on OSX +#ifndef MAC_OSX if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile; +#endif return pathPidFile; } diff --git a/src/util.h b/src/util.h index bcce681..4cbbde8 100644 --- a/src/util.h +++ b/src/util.h @@ -36,7 +36,7 @@ typedef unsigned long long uint64; static const int64 COIN = 100000000; static const int64 CENT = 1000000; -#define loop for (;;) +#define forloop for (;;) #define BEGIN(a) ((char*)&(a)) #define END(a) ((char*)&((&(a))[1])) #define UBEGIN(a) ((unsigned char*)&(a)) diff --git a/src/wallet.cpp b/src/wallet.cpp index f828261..62cde64 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1098,7 +1098,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, CW CTxDB txdb("r"); { nFeeRet = nTransactionFee; - loop + forloop { wtxNew.vin.clear(); wtxNew.vout.clear(); diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 31bcf75..bf46228 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -68,7 +68,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list