• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A generic touchscreen calibration program for X.Org


Commit MetaInfo

Revisionfa47700129680bbd4fbb324dc1999b664dd4419a (tree)
Time2013-01-23 02:34:11
AuthorAndreas Müller <schnitzeltony@goog...>
CommiterAndreas Müller

Log Message

CalibratorUsbtouchscreen: overridde default file name when setting --output-filename

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

Change Summary

Incremental Difference

--- a/src/calibrator/Usbtouchscreen.cpp
+++ b/src/calibrator/Usbtouchscreen.cpp
@@ -104,10 +104,11 @@ bool CalibratorUsbtouchscreen::finish_data(const XYinfo new_axys)
104104 write_bool_parameter(p_swap_xy, new_axys.swap_xy);
105105
106106 // Read, then write calibration parameters to modprobe_conf_local,
107- // to keep the for the next boot
108- FILE *fid = fopen(modprobe_conf_local, "r");
107+ // or the file set by --output-filename to keep the for the next boot
108+ const char* filename = output_filename == NULL ? modprobe_conf_local : output_filename;
109+ FILE *fid = fopen(filename, "r");
109110 if (fid == NULL) {
110- fprintf(stderr, "Error: Can't open '%s' for reading. Make sure you have the necessary rights\n", modprobe_conf_local);
111+ fprintf(stderr, "Error: Can't open '%s' for reading. Make sure you have the necessary rights\n", filename);
111112 fprintf(stderr, "New calibration data NOT saved\n");
112113 return false;
113114 }
@@ -135,9 +136,9 @@ bool CalibratorUsbtouchscreen::finish_data(const XYinfo new_axys)
135136 p_flip_y, yesno(flip_y), p_swap_xy, yesno(new_axys.swap_xy));
136137 new_contents += new_opt;
137138
138- fid = fopen(modprobe_conf_local, "w");
139+ fid = fopen(filename, "w");
139140 if (fid == NULL) {
140- fprintf(stderr, "Error: Can't open '%s' for writing. Make sure you have the necessary rights\n", modprobe_conf_local);
141+ fprintf(stderr, "Error: Can't open '%s' for writing. Make sure you have the necessary rights\n", filename);
141142 fprintf(stderr, "New calibration data NOT saved\n");
142143 return false;
143144 }