Ticket #22857: lprof-sl-patch.txt

File lprof-sl-patch.txt, 5.9 KB (added by lassi.tuura@…, 14 years ago)

LProf patch to build macports lprof version on 10.6

Line 
1diff -x .DS_Store -x work -x src -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/lprof/Portfile ./Portfile
2--- /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/lprof/Portfile    2009-12-31 22:36:31.000000000 +0100
3+++ ./Portfile  2010-01-19 21:27:28.000000000 +0100
4@@ -5,7 +5,7 @@
5 
6 name                lprof
7 version             20090113
8-revision            2
9+revision            3
10 categories          graphics
11 license             GPL
12 maintainers         nomaintainer
13@@ -23,6 +23,8 @@
14 cvs.root            :pserver:anonymous@lprof.cvs.sourceforge.net:/cvsroot/lprof
15 cvs.date            ${version}
16 cvs.module          lprof
17+patchfiles          results-sort-columns.patch
18+patchfiles          argyll-nsbeep.patch
19 
20 depends_lib         path:bin/qmake-mac:qt4-mac port:libusb-compat
21 depends_build       port:cmake
22diff -x .DS_Store -x work -x src -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/lprof/files/argyll-nsbeep.patch ./files/argyll-nsbeep.patch
23--- /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/lprof/files/argyll-nsbeep.patch   1970-01-01 01:00:00.000000000 +0100
24+++ ./files/argyll-nsbeep.patch 2010-01-19 20:59:00.000000000 +0100
25@@ -0,0 +1,20 @@
26+--- src/argyll/spectro/unixio.c        2008-02-19 22:02:24.000000000 +0100
27++++ src/argyll/spectro/unixio.c        2010-01-19 20:56:02.000000000 +0100
28+@@ -288,7 +288,7 @@ static int beep_msec;
29+ static int delayed_beep(void *pp) {
30+       msec_sleep(beep_delay);
31+ #ifdef __APPLE__
32+-      SysBeep((beep_msec * 60)/1000);
33++      NSBeep();
34+ #else
35+       fprintf(stdout, "\a"); fflush(stdout);
36+ #endif
37+@@ -307,7 +307,7 @@ void msec_beep(int delay, int freq, int
38+                       error("Delayed beep failed to create thread");
39+       } else {
40+ #ifdef __APPLE__
41+-              SysBeep((msec * 60)/1000);
42++              NSBeep();
43+ #else
44+               /* Linux is pretty lame in this regard... */
45+               fprintf(stdout, "\a"); fflush(stdout);
46diff -x .DS_Store -x work -x src -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/lprof/files/results-sort-columns.patch ./files/results-sort-columns.patch
47--- /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/lprof/files/results-sort-columns.patch    1970-01-01 01:00:00.000000000 +0100
48+++ ./files/results-sort-columns.patch  2009-05-05 20:35:58.000000000 +0200
49@@ -0,0 +1,118 @@
50+--- src/libqtlcmswidgets/qtlcmswidgets.h.orig  2009-05-02 22:30:25.000000000 +0200
51++++ src/libqtlcmswidgets/qtlcmswidgets.h       2009-05-02 23:21:14.000000000 +0200
52+@@ -336,7 +336,11 @@
53+ // -------------------------------------------------------------- Checks results
54+
55+
56+-class CheckProfile {
57++class CheckProfile : public QObject {
58++    Q_OBJECT
59++    Q3Table *table;
60++    int lastSortCol;
61++    bool asc;
62+
63+ public:
64+
65+@@ -356,6 +360,9 @@
66+     void CreateFancyReport(QString& Report, Statistics& st, Statistics& st94,
67+                            CheckerCorrection corr, double params[]);
68+
69++private slots:
70++    void sortByColumn(int col);
71++
72+ public:
73+
74+     CheckProfile(QComboBox *corrCombo = NULL);
75+--- src/libqtlcmswidgets/qtlcmswidgets.cpp.orig        2009-05-02 22:16:36.000000000 +0200
76++++ src/libqtlcmswidgets/qtlcmswidgets.cpp     2009-05-03 00:51:36.000000000 +0200
77+@@ -1001,6 +1001,64 @@
78+     }
79+ }
80+
81++static int cmpTableItems(const void *n1, const void *n2)
82++{
83++    Q3TableItem **i1 = (Q3TableItem **)n1;
84++    Q3TableItem **i2 = (Q3TableItem **)n2;
85++    int diff = (*i1)->key().localeAwareCompare((*i2)->key());
86++    if (diff == 0)
87++    {
88++      Q3TableItem *id1 = (*i1)->table()->item((*i1)->row(), 11);
89++      Q3TableItem *id2 = (*i2)->table()->item((*i2)->row(), 11);
90++      diff = id1->key().localeAwareCompare(id2->key());
91++    }
92++    return diff;
93++}
94++
95++// Like Q3Table::sortColumn, except swaps the whole row, with the header,
96++// and where the row values are identical, sorts by patch row rank.
97++static void sortColumn(Q3Table *table, int col, bool ascending)
98++{
99++    int i, rows = table->numRows();
100++    Q3TableItem **items = new Q3TableItem *[rows];
101++    for (int i = 0; i < rows; ++i)
102++    {
103++        items[i] = table->item(i, col);
104++    }
105++
106++    qsort(items, rows, sizeof(Q3TableItem *), cmpTableItems);
107++
108++    table->setUpdatesEnabled(false);
109++    table->verticalHeader()->setUpdatesEnabled(false);
110++    for (i = 0; i < rows; ++i)
111++    {
112++      int newRow = (ascending ? i : rows - i - 1);
113++        if (items[i]->row() != newRow)
114++            table->swapRows(items[i]->row(), newRow, true);
115++    }
116++    table->verticalHeader()->setUpdatesEnabled(true);
117++    table->setUpdatesEnabled(true);
118++    table->horizontalHeader()->setSortIndicator(col, ascending ? Qt::Ascending : Qt::Descending);
119++    table->verticalHeader()->update();
120++    table->update();
121++    delete [] items;
122++}
123++
124++void CheckProfile::sortByColumn(int col)
125++{
126++    if (col == lastSortCol)
127++    {
128++      asc = !asc;
129++    }
130++    else
131++    {
132++      lastSortCol = col;
133++      asc = false;
134++    }
135++    sortColumn(table, lastSortCol, asc);
136++}
137++
138++
139+ void CheckProfile::Results(Q3Table* ResultsGrid,
140+                            QString& ResultsText,
141+                            LPMEASUREMENT m,
142+@@ -1020,7 +1078,14 @@
143+     Vertical -> setResizeEnabled(FALSE);
144+
145+     ResultsGrid -> setLeftMargin(60);
146+-    ResultsGrid -> setNumCols(11);
147++    ResultsGrid -> setNumCols(12);
148++    ResultsGrid -> hideColumn(11);
149++
150++    asc = false;
151++    lastSortCol = -1;
152++    table = ResultsGrid;
153++    connect(ResultsGrid->horizontalHeader(), SIGNAL(sectionClicked(int)),
154++          this, SLOT(sortByColumn(int)));
155+
156+     Horizontal -> setLabel(0, QString::fromLocal8Bit(""));
157+     Horizontal -> setLabel(1, QTranslator::tr("CIE La*b* dE"));
158+@@ -1244,6 +1309,9 @@
159+             Text.sprintf(" %2.2f ", dEBFL);
160+             SetGridItem(ResultsGrid, i, 10, Text);
161+
162++          Text.sprintf(" %04d", i);
163++          SetGridItem(ResultsGrid, i, 11, Text);
164++
165+             if (p ->dwFlags & PATCH_HAS_STD_DE)
166+             {
167+                     st.EstimateTargetError(p -> dEStd);