From 466a4e6ef2cf67dd75f08550abcd4f31c5d6e54d Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Mon, 17 Sep 2018 12:18:53 +0200 Subject: [PATCH] fairtrade: upstreamed patchset. --- .../fairtrade/fairtrade-1.0.0~git.recipe | 7 +- .../patches/fairtrade-1.0.0~git.patchset | 292 ------------------ 2 files changed, 3 insertions(+), 296 deletions(-) delete mode 100644 haiku-apps/fairtrade/patches/fairtrade-1.0.0~git.patchset diff --git a/haiku-apps/fairtrade/fairtrade-1.0.0~git.recipe b/haiku-apps/fairtrade/fairtrade-1.0.0~git.recipe index f6af8655d..d35971014 100644 --- a/haiku-apps/fairtrade/fairtrade-1.0.0~git.recipe +++ b/haiku-apps/fairtrade/fairtrade-1.0.0~git.recipe @@ -5,12 +5,11 @@ scanned using a bar code scanner and all of them will be add in the shopping bas HOMEPAGE="https://github.com/czeidler/fairtrade" COPYRIGHT="2006-2013 Clemens Zeidler" LICENSE="MIT" -REVISION="2" -srcGitRev="2b4ff648e2118021b092c4f0d9d0b61bc51c1374" +REVISION="3" +srcGitRev="e02a920fddbf651afd4355a73bc673a07e51f74c" SOURCE_URI="${HOMEPAGE}/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="3508410755c1bdf9c90403fd5bbf622f5f6036fe7a787cfe570c6542fd9f4186" +CHECKSUM_SHA256="40627283f4d1032886c9483283572b597d3ccb057d8269af203aecf0b8c4e603" SOURCE_DIR="fairtrade-$srcGitRev" -PATCHES="fairtrade-$portVersion.patchset" ARCHITECTURES="x86_gcc2 !x86 x86_64" diff --git a/haiku-apps/fairtrade/patches/fairtrade-1.0.0~git.patchset b/haiku-apps/fairtrade/patches/fairtrade-1.0.0~git.patchset deleted file mode 100644 index 451da3945..000000000 --- a/haiku-apps/fairtrade/patches/fairtrade-1.0.0~git.patchset +++ /dev/null @@ -1,292 +0,0 @@ -From 21c18e57e38872c43778b6148b017c3bc0fcf177 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sun, 29 Jan 2017 20:47:06 +0100 -Subject: fix build for gcc5/x86_64. - - -diff --git a/Import/ImportProducts.cpp b/Import/ImportProducts.cpp -index 6a60da9..9be09a1 100644 ---- a/Import/ImportProducts.cpp -+++ b/Import/ImportProducts.cpp -@@ -5,7 +5,7 @@ - - #include "ImportProducts.h" - --#include -+#include - #include - - #define DEBUG 1 -@@ -42,18 +42,18 @@ ImportProducts::Import() - //line.get(buffer, 1024, '\t'); - - //barcode -- char* buf; -- line.gets(&buf, '\t'); -+ char buf[256]; -+ line.getline(buf, 256, '\t'); - string word = buf; - if(word == "Barcode" || word == ""){ - continue; - } - product.barcode = word.c_str(); - //name -- line.gets(&buf, '\t'); -+ line.getline(buf, 256, '\t'); - product.name = buf; - //comment -- line.gets(&buf, '\t'); -+ line.getline(buf, 256, '\t'); - product.comment = buf; - //prize - double prize; -diff --git a/Import/main.cpp b/Import/main.cpp -index 77f9b63..7bf815f 100644 ---- a/Import/main.cpp -+++ b/Import/main.cpp -@@ -5,6 +5,7 @@ - - #include "ImportProducts.h" - -+#include - - int - main(int argc, char* argv[]) -diff --git a/gui/column/ColumnListView.cpp b/gui/column/ColumnListView.cpp -index 9e551f6..1a5474f 100644 ---- a/gui/column/ColumnListView.cpp -+++ b/gui/column/ColumnListView.cpp -@@ -459,7 +459,7 @@ BRow::BRow(float height) - BRow::~BRow() - { - while (true) { -- BField *field = (BField*) fFields.RemoveItem(0L); -+ BField *field = (BField*) fFields.RemoveItem((int32)0); - if (field == 0) - break; - -@@ -773,7 +773,7 @@ BColumnListView::BColumnListView(BRect rect, const char *name, uint32 resizingMo - BColumnListView::~BColumnListView() - { - while (true) { -- BColumn *column = (BColumn*) fColumns.RemoveItem(0L); -+ BColumn *column = (BColumn*) fColumns.RemoveItem((int32)0); - if (column == 0) - break; - -@@ -2026,7 +2026,7 @@ void TitleView::ComputeDragBoundries(BColumn *findColumn, BPoint ) - void TitleView::DrawTitle(BView *view, BRect rect, BColumn *column, bool depressed) - { - BRect drawRect; -- rgb_color borderColor = mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0), 128); -+ rgb_color borderColor = ::mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0), 128); - rgb_color backgroundColor; - - rgb_color bevelHigh; -@@ -2036,15 +2036,15 @@ void TitleView::DrawTitle(BView *view, BRect rect, BColumn *column, bool depress - drawRect = rect; - drawRect.InsetBy(2, 2); - if (depressed) { -- backgroundColor = mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0), 64); -- bevelHigh = mix_color(backgroundColor, make_color(0, 0, 0), 64); -- bevelLow = mix_color(backgroundColor, make_color(255, 255, 255), 128); -+ backgroundColor = ::mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0), 64); -+ bevelHigh = ::mix_color(backgroundColor, make_color(0, 0, 0), 64); -+ bevelLow = ::mix_color(backgroundColor, make_color(255, 255, 255), 128); - drawRect.left++; - drawRect.top++; - } else { - backgroundColor = fMasterView->Color(B_COLOR_HEADER_BACKGROUND); -- bevelHigh = mix_color(backgroundColor, make_color(255, 255, 255), 192); -- bevelLow = mix_color(backgroundColor, make_color(0, 0, 0), 64); -+ bevelHigh = ::mix_color(backgroundColor, make_color(255, 255, 255), 192); -+ bevelLow = ::mix_color(backgroundColor, make_color(0, 0, 0), 64); - drawRect.bottom--; - drawRect.right--; - } -diff --git a/gui/column/ObjectList.h b/gui/column/ObjectList.h -index cc639c5..5f5cc48 100644 ---- a/gui/column/ObjectList.h -+++ b/gui/column/ObjectList.h -@@ -668,7 +668,7 @@ BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state - - template - bool --BObjectList::BinaryInsertUnique(T *, CompareFunction func) -+BObjectList::BinaryInsertUnique(T *item, CompareFunction func) - { - int32 index = _PointerList_::BinarySearchIndex(item, - (GenericCompareFunction)func); -@@ -681,7 +681,7 @@ BObjectList::BinaryInsertUnique(T *, CompareFunction func) - - template - bool --BObjectList::BinaryInsertUnique(T *, CompareFunctionWithState func, void *state) -+BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) - { - int32 index = _PointerList_::BinarySearchIndex(item, - (GenericCompareFunctionWithState)func, state); -diff --git a/gui/productsview.cpp b/gui/productsview.cpp -index 0362333..5169cc7 100644 ---- a/gui/productsview.cpp -+++ b/gui/productsview.cpp -@@ -152,7 +152,7 @@ ProductView::BarcodeEntered(BString barcode) - - - void --ProductView::EditProduct(product_f *product = NULL) -+ProductView::EditProduct(product_f *product) - { - BWindow *EditWindow = new EditProductWindow(BRect(150,200,700,700),"edit product",product); - EditWindow->Show(); -diff --git a/sqlite/SQLConnection.cpp b/sqlite/SQLConnection.cpp -index bc4df8b..0851637 100644 ---- a/sqlite/SQLConnection.cpp -+++ b/sqlite/SQLConnection.cpp -@@ -1,5 +1,6 @@ - #include "SQLConnection.h" - -+#include - #include - #include - -diff --git a/sqlite/SQLConnection.h b/sqlite/SQLConnection.h -index a6d2a2f..85a0690 100644 ---- a/sqlite/SQLConnection.h -+++ b/sqlite/SQLConnection.h -@@ -6,6 +6,8 @@ - - #include "sqlite3.h" - -+using namespace std; -+ - class SQLiteConnection - { - private: --- -2.12.2 - - -From b35cc70bddac0e47f4cd60346d9fff468dfc3966 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sun, 29 Jan 2017 21:58:02 +0100 -Subject: move datafiles in config/settings/fairtrade/ - - -diff --git a/ConfigApp/ConfigFairTrade.h b/ConfigApp/ConfigFairTrade.h -index 72058f1..01ffeca 100644 ---- a/ConfigApp/ConfigFairTrade.h -+++ b/ConfigApp/ConfigFairTrade.h -@@ -22,8 +22,8 @@ class config{ - public: - config() - { -- databasePath = "./fairtrade.db"; -- csvExportPath = "./CSVExport"; -+ databasePath = "fairtrade.db"; -+ csvExportPath = "CSVExport"; - welcomeString1 = "Willkommen"; - welcomeString2 = "bei der Eine-Welt-Gruppe Anrath"; - shutdownOnExit = true; -diff --git a/fairtrade.cpp b/fairtrade.cpp -index 1ea6562..b4219b7 100644 ---- a/fairtrade.cpp -+++ b/fairtrade.cpp -@@ -24,30 +24,25 @@ TradeApp::TradeApp(char *signature) - BApplication(signature) - { - //read config -- app_info appInfo; -- GetAppInfo(&appInfo); -- BEntry appEntry(&appInfo.ref); -- BPath appPath; -- appEntry.GetPath(&appPath); -- -- BString configPath = appPath.Path(); -- configPath.RemoveLast(appInfo.ref.name); -- chdir(configPath.String()); -- configPath+= "./"; -- configPath+= kConfigFile; -- BPath configP(configPath.String(), NULL, true); -+ BPath path; -+ if (find_directory (B_USER_SETTINGS_DIRECTORY, &path) != B_OK) -+ return; -+ path.Append ("fairtrade"); -+ -+ BPath configP(path.Path()); -+ configP.Append(kConfigFile); - - fConfig.ReadConfig(configP.Path()); - -- BString dbString = fConfig.databasePath; -- if(dbString.FindFirst("/") != 0){ -+ BPath dbP; -+ if(fConfig.databasePath.FindFirst("/") != 0){ - //relative path -- dbString = appPath.Path(); -- dbString.RemoveLast(appInfo.ref.name); -- dbString+= fConfig.databasePath; -- } -+ dbP.SetTo(path.Path()); -+ dbP.Append(fConfig.databasePath); -+ } else -+ dbP.SetTo(fConfig.databasePath); - //create dir if not exist -- BString dbDir(dbString); -+ BString dbDir(dbP.Path()); - dbDir.Truncate(dbDir.IFindLast("/")); - - BDirectory dir; -@@ -57,13 +52,12 @@ TradeApp::TradeApp(char *signature) - fExportPath = fConfig.csvExportPath; - if(fExportPath.FindFirst("/") != 0){ - //relative path -- fExportPath = appPath.Path(); -- fExportPath.RemoveLast(appInfo.ref.name); -+ fExportPath = path.Path(); - fExportPath+= fConfig.csvExportPath; - } - - HideCursor(); -- fStock = new Stock(dbString.String()); -+ fStock = new Stock(dbP.Path()); - - fMainWindow = new MainWindow(BRect(100, 300, 400, 700), "Fair Trade", fConfig); - fMainWindowMessenger = new BMessenger(fMainWindow); --- -2.12.2 - - -From 8a3cfbb93db74447aeb79ca21475ed5b9348cd2b Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 23 Jun 2017 21:10:39 +0200 -Subject: time_t isn't always an int32. - - -diff --git a/stock.cpp b/stock.cpp -index 3e5cc34..7efa477 100644 ---- a/stock.cpp -+++ b/stock.cpp -@@ -56,7 +56,7 @@ product_f::Archive(BMessage *msg) - msg->AddFloat("prize", prize); - msg->AddInt32("supplies", supplies); - msg->AddBool("valid", valid); -- msg->AddInt32("insertdate",insertdate); -+ msg->AddInt64("insertdate",(int64)insertdate); - } - - -@@ -70,7 +70,9 @@ product_f::Instantiate(BMessage *msg) - msg->FindFloat("prize", &prize); - msg->FindInt32("supplies", &supplies); - msg->FindBool("valid", &valid); -- msg->FindInt32("insertdate", &insertdate); -+ int64 insertwhen; -+ msg->FindInt64("insertdate", &insertwhen); -+ insertdate = insertwhen; - } - - --- -2.12.2 -