ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/main.cpp
(Generate patch)

Comparing Vago/trunk/Vago/main.cpp (file contents):
Revision 771 by s10k, Sun Mar 31 19:02:16 2013 UTC vs.
Revision 790 by s10k, Sat Apr 6 20:54:26 2013 UTC

# Line 1 | Line 1
1 + #define USING_VM_TABLET_WARNING_FIX // Comment this line if not using a mac vm
2 +
3 + #ifdef USING_VM_TABLET_WARNING_FIX
4 + #include <qapplication.h>
5 + void myMessageOutput(QtMsgType type, const char *msg);
6 + #endif
7 +
8   #include <QtGui/QApplication>
9   #include "mainwindow.h"
10  
11   int main(int argc, char *argv[])
12   {
13 +
14 + #ifdef USING_VM_TABLET_WARNING_FIX
15 +    qInstallMsgHandler(myMessageOutput);
16 + #endif
17 +
18      QApplication a(argc, argv);
19      MainWindow w;
20      w.show();
# Line 10 | Line 22 | int main(int argc, char *argv[])
22      
23      return a.exec();
24   }
25 +
26 + #ifdef USING_VM_TABLET_WARNING_FIX
27 + void myMessageOutput(QtMsgType type, const char *msg)
28 + {
29 +    switch (type) {
30 +    case QtWarningMsg:
31 +        if(QString(msg)=="QCocoaView handleTabletEvent: This tablet device is unknown (received no proximity event for it). Discarding event."){ // ignore this message
32 +            return;
33 +        }
34 +        else{
35 +            fprintf(stderr, "%s\n", msg);
36 +            break;
37 +        }
38 +    case QtFatalMsg:
39 +        fprintf(stderr, "%s\n", msg);
40 +        abort();
41 +    default:
42 +        fprintf(stderr, "%s\n", msg);
43 +        break;
44 +    }
45 + }
46 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)