void ShaderEffectItem::connectPropertySignals() { QSet<QByteArray>::const_iterator it; for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) { int pi = metaObject()->indexOfProperty(it->constData()); if (pi >= 0) { QMetaProperty mp = metaObject()->property(pi); if (!mp.hasNotifySignal()) qWarning("ShaderEffectItem: property '%s' does not have notification method!", it->constData()); QByteArray signalName("2"); signalName.append(mp.notifySignal().signature()); connect(this, signalName, this, SLOT(markDirty())); } else { qWarning("ShaderEffectItem: '%s' does not have a matching property!", it->constData()); } } for (int i = 0; i < m_sources.size(); ++i) { SourceData &source = m_sources[i]; int pi = metaObject()->indexOfProperty(source.name.constData()); if (pi >= 0) { QMetaProperty mp = metaObject()->property(pi); QByteArray signalName("2"); signalName.append(mp.notifySignal().signature()); connect(this, signalName, source.mapper, SLOT(map())); source.mapper->setMapping(this, i); connect(source.mapper, SIGNAL(mapped(int)), this, SLOT(changeSource(int))); } else {
void UserProc::initKillSigs( void ) { int sig; sig = findSoftKillSig( JobAd ); if( sig >= 0 ) { soft_kill_sig = sig; } else { soft_kill_sig = SIGTERM; } sig = findRmKillSig( JobAd ); if( sig >= 0 ) { rm_kill_sig = sig; } else { rm_kill_sig = SIGTERM; } sig = findHoldKillSig( JobAd ); if( sig >= 0 ) { hold_kill_sig = sig; } else { hold_kill_sig = SIGTERM; } const char* tmp = signalName( soft_kill_sig ); dprintf( D_FULLDEBUG, "%s KillSignal: %d (%s)\n", name ? name : "Main job", soft_kill_sig, tmp ? tmp : "Unknown" ); tmp = signalName( rm_kill_sig ); dprintf( D_FULLDEBUG, "%s RmKillSignal: %d (%s)\n", name ? name : "Main job", rm_kill_sig, tmp ? tmp : "Unknown" ); tmp = signalName( hold_kill_sig ); dprintf( D_FULLDEBUG, "%s HoldKillSignal: %d (%s)\n", name ? name : "Main job", hold_kill_sig, tmp ? tmp : "Unknown" ); }
QString Property::qPropertyString() const { QString str; str = QString("Q_PROPERTY(%1 %2") .arg(realTypeName()) .arg(replaceFisrtLetterToLower(m_d->p_name)); #define AddBoolProperty(MEMBER, MARCO, QTNAME) \ if (MEMBER() != PropertyDefault##MARCO) \ { \ str += QString(" ") + #QTNAME + QString(" ") \ + ((MEMBER()) ? "true" : "false"); \ } if (member()) { str += QString(" MEMBER ") + memberVariableName(); } if (read()) { str += QString(" READ ") + readFunctionName(); } if (write()) { str += QString(" WRITE ") + writeFunctionName(); } if (reset()) { str += QString(" RESET ") + resetFunctionName(); } if (notify()) { str += QString(" NOTIFY ") + signalName(); } if (revision() != PropertyDefaultRevision) { str += QString(" REVISION %1").arg(revision()); } AddBoolProperty(designable, Designable, DESIGNABLE); AddBoolProperty(scriptable, Scriptable, SCRIPTABLE); AddBoolProperty(stored, Stored, STORED); AddBoolProperty(user, User, USER); if (constant() != PropertyDefaultConstant) { str += QString(" CONSTANT"); } if (final() != PropertyDefaultFinal) { str += QString(" FINAL"); } str += QString(")"); return str; }
// replace some of the strings void KrashConfig :: expandString(QString &str, bool shell, const QString &tempFile) const { QMap<QString,QString> map; map[QString::fromLatin1("appname")] = QString::fromLatin1(appName()); map[QString::fromLatin1("execname")] = startedByKdeinit() ? QString::fromLatin1("kdeinit") : m_execname; map[QString::fromLatin1("signum")] = QString::number(signalNumber()); map[QString::fromLatin1("signame")] = signalName(); map[QString::fromLatin1("progname")] = programName(); map[QString::fromLatin1("pid")] = QString::number(pid()); map[QString::fromLatin1("tempfile")] = tempFile; if (shell) str = KMacroExpander::expandMacrosShellQuote( str, map ); else str = KMacroExpander::expandMacros( str, map ); }
int main() { ZGDrawTools::setStyle(); TFile* file_74 = TFile::Open("~/CMSSW_7_6_3_ZG/src/ZGAnalysis/analysis/EventYields_v0_eth74X/trees.root"); TFile* file_80 = TFile::Open("EventYields_v0_stitchPt/trees.root"); std::vector<Signal> signals; signals.push_back(Signal(1000., "0p014")); signals.push_back(Signal(2000., "0p014")); signals.push_back(Signal( 745., "0p014")); signals.push_back(Signal(2000., "5p6" )); signals.push_back(Signal( 500., "5p6" )); signals.push_back(Signal( 770., "5p6" )); std::string outdir = "compare74_80"; system( Form("mkdir -p %s", outdir.c_str()) ); for( unsigned i=0; i<signals.size(); ++i ) { std::string signalName(Form("GluGluSpin0ToZG_ZToLL_W%s_M%.0f", signals[i].width.c_str(), signals[i].mass)); TTree* tree_74; if( signals[i].mass==745. && signals[i].width=="0p014" ) tree_74 = (TTree*)file_74->Get("GluGluSpin0ToZG_ZToLL_W0p014_M750"); else tree_74 = (TTree*)file_74->Get(signalName.c_str()); TTree* tree_80 = (TTree*)file_80->Get(signalName.c_str()); drawVar( outdir, tree_74, tree_80, signals[i], "gamma_pt","gamma_pt", 100, signals[i].mass*0.2, signals[i].mass*2.); if( signals[i].width=="0p014" ) { drawVar( outdir, tree_74, tree_80, signals[i], "mZg_ee", "boss_mass", 100, signals[i].mass*0.7, signals[i].mass*1.2, "leptType==11"); drawVar( outdir, tree_74, tree_80, signals[i], "mZg_mm", "boss_mass", 100, signals[i].mass*0.7, signals[i].mass*1.2, "leptType==13"); } else { drawVar( outdir, tree_74, tree_80, signals[i], "mZg_ee", "boss_mass", 50, signals[i].mass*0.5, signals[i].mass*1.3, "leptType==11"); drawVar( outdir, tree_74, tree_80, signals[i], "mZg_mm", "boss_mass", 50, signals[i].mass*0.5, signals[i].mass*1.3, "leptType==13"); } drawVar( outdir, tree_74, tree_80, signals[i], "mZee", "z_mass", 80, 50., 130., "leptType==11"); drawVar( outdir, tree_74, tree_80, signals[i], "mZmm", "z_mass", 80, 50., 130., "leptType==13"); } return 0; }
void QV4DebugServiceImpl::messageReceived(const QByteArray &message) { QMutexLocker lock(&m_configMutex); QQmlDebugPacket ms(message); QByteArray header; ms >> header; TRACE_PROTOCOL(qDebug() << "received message with header" << header); if (header == "V8DEBUG") { QByteArray type; QByteArray payload; ms >> type >> payload; TRACE_PROTOCOL(qDebug() << "... type:" << type); if (type == V4_CONNECT) { QJsonObject parameters = QJsonDocument::fromJson(payload).object(); namesAsObjects = true; redundantRefs = true; if (parameters.contains("namesAsObjects")) namesAsObjects = parameters.value("namesAsObjects").toBool(); if (parameters.contains("redundantRefs")) redundantRefs = parameters.value("redundantRefs").toBool(); emit messageToClient(name(), packMessage(type)); stopWaiting(); } else if (type == V4_PAUSE) { debuggerAgent.pauseAll(); sendSomethingToSomebody(type); } else if (type == V4_BREAK_ON_SIGNAL) { QByteArray signal; bool enabled; ms >> signal >> enabled; //Normalize to lower case. QString signalName(QString::fromUtf8(signal).toLower()); if (enabled) breakOnSignals.append(signalName); else breakOnSignals.removeOne(signalName); } else if (type == "v8request") {
static void cleanupProcessorProcess(pid_t const processorPid) { int terminationStatus; waitpid(processorPid, &terminationStatus, 0); if (WIFEXITED(terminationStatus)) { int const exitStatus = WEXITSTATUS(terminationStatus); if (exitStatus != 0) pm_message("Shell process exited with abnormal exist status %u. ", exitStatus); } else if (WIFSIGNALED(terminationStatus)) { pm_message("Shell process was killed by a Class %u (%s) signal.", WTERMSIG(terminationStatus), signalName(WTERMSIG(terminationStatus))); } else { pm_message("Shell process died, but its termination status " "0x%x doesn't make sense", terminationStatus); } }
String Interrupt::message() const { return Format() << "Caught signal " << signalName(); }
//*************************************************************************** QStringList *Kwave::SaveBlocksPlugin::setup(QStringList &previous_params) { // try to interpret the previous parameters interpreteParameters(previous_params); // create the setup dialog sample_index_t selection_left = 0; sample_index_t selection_right = 0; selection(0, &selection_left, &selection_right, false); // enable the "selection only" checkbox only if there is something // selected but not everything bool selected_something = (selection_left != selection_right); bool selected_all = ((selection_left == 0) && (selection_right + 1 >= signalLength())); bool enable_selection_only = selected_something && !selected_all; QString filename = m_url.path(); QString base = findBase(filename, m_pattern); scanBlocksToSave(base, m_selection_only && enable_selection_only); QPointer<Kwave::SaveBlocksDialog> dialog = new(std::nothrow) Kwave::SaveBlocksDialog( _("kfiledialog:///kwave_save_blocks"), Kwave::CodecManager::encodingFilter(), parentWidget(), QUrl::fromUserInput(signalName()), _("*.wav"), m_pattern, m_numbering_mode, m_selection_only, enable_selection_only ); if (!dialog) return 0; // connect the signals/slots from the plugin and the dialog connect(dialog, SIGNAL(sigSelectionChanged(QString, QString,Kwave::SaveBlocksPlugin::numbering_mode_t,bool)), this, SLOT(updateExample(QString,QString, Kwave::SaveBlocksPlugin::numbering_mode_t,bool))); connect(this, SIGNAL(sigNewExample(QString)), dialog, SLOT(setNewExample(QString))); dialog->setWindowTitle(i18n("Save Blocks")); dialog->emitUpdate(); if (dialog->exec() != QDialog::Accepted) { delete dialog; return 0; } QStringList *list = new QStringList(); Q_ASSERT(list); if (list) { // user has pressed "OK" QString pattern; QUrl url = dialog->selectedUrl(); if (url.isEmpty()) { delete dialog; return 0; } QString name = url.path(); QFileInfo path(name); // add the correct extension if necessary if (!path.suffix().length()) { QString ext = dialog->selectedExtension(); QStringList extensions = ext.split(_(" ")); ext = extensions.first(); name += ext.mid(1); path = name; url.setPath(name); } name = Kwave::Parser::escape(name); pattern = Kwave::Parser::escape(dialog->pattern()); int mode = static_cast<int>(dialog->numberingMode()); bool selection_only = (enable_selection_only) ? dialog->selectionOnly() : m_selection_only; *list << name; *list << pattern; *list << QString::number(mode); *list << QString::number(selection_only); emitCommand(_("plugin:execute(saveblocks,") + name + _(",") + pattern + _(",") + QString::number(mode) + _(",") + QString::number(selection_only) + _(")") ); } else { // user pressed "Cancel" delete list; list = 0; } if (dialog) delete dialog; return list; }