Ticket #22857: lprof-current-patch.txt

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

LProf patch for update to 10.6 plus update to current cvs version

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