|
a/upplay.cpp |
|
b/upplay.cpp |
|
... |
|
... |
89 |
|
89 |
|
90 |
if (Logger::getTheLog("stderr") == 0) {
|
90 |
if (Logger::getTheLog("stderr") == 0) {
|
91 |
cerr << "Can't initialize log" << endl;
|
91 |
cerr << "Can't initialize log" << endl;
|
92 |
return 1;
|
92 |
return 1;
|
93 |
}
|
93 |
}
|
94 |
|
|
|
95 |
const char *cp;
|
94 |
const char *cp;
|
96 |
if ((cp = getenv("UPPLAY_LOGLEVEL"))) {
|
95 |
if ((cp = getenv("UPPLAY_LOGLEVEL"))) {
|
97 |
Logger::getTheLog("")->setLogLevel(Logger::LogLevel(atoi(cp)));
|
96 |
Logger::getTheLog("")->setLogLevel(Logger::LogLevel(atoi(cp)));
|
98 |
}
|
97 |
}
|
99 |
|
98 |
|
|
... |
|
... |
105 |
if (!mylib->ok()) {
|
104 |
if (!mylib->ok()) {
|
106 |
cerr << "Lib init failed: " <<
|
105 |
cerr << "Lib init failed: " <<
|
107 |
mylib->errAsString("main", mylib->getInitError()) << endl;
|
106 |
mylib->errAsString("main", mylib->getInitError()) << endl;
|
108 |
return 1;
|
107 |
return 1;
|
109 |
}
|
108 |
}
|
110 |
//mylib->setLogFileName("/tmp/libupnp.log");
|
109 |
if ((cp = getenv("UPPLAY_UPNPLOGFILENAME"))) {
|
|
|
110 |
char *cp1 = getenv("UPPLAY_UPNPLOGLEVEL");
|
|
|
111 |
int loglevel = LibUPnP::LogLevelNone;
|
|
|
112 |
if (cp1) {
|
|
|
113 |
loglevel = atoi(cp1);
|
|
|
114 |
}
|
|
|
115 |
loglevel = loglevel < 0 ? 0: loglevel;
|
|
|
116 |
loglevel = loglevel > int(LibUPnP::LogLevelDebug) ?
|
|
|
117 |
int(LibUPnP::LogLevelDebug) : loglevel;
|
|
|
118 |
|
|
|
119 |
if (loglevel != LibUPnP::LogLevelNone) {
|
|
|
120 |
mylib->setLogFileName(cp, LibUPnP::LogLevel(loglevel));
|
|
|
121 |
}
|
|
|
122 |
}
|
111 |
|
123 |
|
112 |
QFont font("DejaVu Sans", 9, 55, false);
|
124 |
QFont font("DejaVu Sans", 9, 55, false);
|
113 |
font.setHintingPreference(QFont::PreferNoHinting);
|
125 |
font.setHintingPreference(QFont::PreferNoHinting);
|
114 |
int strategy = (QFont::PreferDefault | QFont::PreferQuality);
|
126 |
int strategy = (QFont::PreferDefault | QFont::PreferQuality);
|
115 |
font.setStyleStrategy((QFont::StyleStrategy) strategy );
|
127 |
font.setStyleStrategy((QFont::StyleStrategy) strategy );
|