Ticket #3910: libmyth-util_isRunning31082007.diff
| File libmyth-util_isRunning31082007.diff, 1.1 KB (added by , 19 years ago) |
|---|
-
libs/libmyth/util.cpp
280 280 return GENERIC_EXIT_NOT_OK; 281 281 } 282 282 283 /** \fn isRunning(QString program) 284 * \brief Returns true if program is running. 285 */ 286 bool isRunning(QString program) 287 { 288 QString sCommand = QString("ret=`ps cax | grep -c %1`; exit $ret").arg(program); 289 int res = system(sCommand.ascii()); 290 if (WIFEXITED(res)) 291 res = WEXITSTATUS(res); 292 293 return res; 294 } 295 283 296 /** \fn cutDownString(const QString&, QFont*, uint) 284 297 * \brief Returns a string based on "text" that fits within "maxwidth" pixels. 285 298 */ -
libs/libmyth/util.h
53 53 MPUBLIC QRgb blendColors(QRgb source, QRgb add, int alpha); 54 54 55 55 MPUBLIC uint myth_system(const QString &command, int flags = 0); 56 MPUBLIC bool isRunning(QString program); 56 57 57 58 MPUBLIC QString cutDownString(const QString &text, QFont *testFont, uint maxwidth); 58 59
