本文整理汇总了C++中qCInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ qCInfo函数的具体用法?C++ qCInfo怎么用?C++ qCInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qCInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: qCInfo
void DetermineAuthTypeJob::start()
{
qCInfo(lcDetermineAuthTypeJob) << "Determining auth type for" << _account->davUrl();
QNetworkRequest req;
// Prevent HttpCredentialsAccessManager from setting an Authorization header.
req.setAttribute(HttpCredentials::DontAddCredentialsAttribute, true);
// Don't reuse previous auth credentials
req.setAttribute(QNetworkRequest::AuthenticationReuseAttribute, QNetworkRequest::Manual);
// Don't send cookies, we can't determine the auth type if we're logged in
req.setAttribute(QNetworkRequest::CookieLoadControlAttribute, QNetworkRequest::Manual);
auto propfind = _account->sendRequest("PROPFIND", _account->davUrl(), req);
propfind->setTimeout(30 * 1000);
propfind->setIgnoreCredentialFailure(true);
connect(propfind, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) {
auto authChallenge = reply->rawHeader("WWW-Authenticate").toLower();
auto result = Basic;
if (authChallenge.contains("bearer ")) {
result = OAuth;
} else if (authChallenge.isEmpty()) {
qCWarning(lcDetermineAuthTypeJob) << "Did not receive WWW-Authenticate reply to auth-test PROPFIND";
}
qCInfo(lcDetermineAuthTypeJob) << "Auth type for" << _account->davUrl() << "is" << result;
emit this->authType(result);
this->deleteLater();
});
}
开发者ID:owncloud,项目名称:client,代码行数:28,代码来源:networkjobs.cpp
示例2: QString
void ExtScript::readJsonFilters()
{
QString fileName = QStandardPaths::locate(
QStandardPaths::GenericDataLocation,
QString(
"awesomewidgets/scripts/awesomewidgets-extscripts-filters.json"));
qCInfo(LOG_LIB) << "Filters file" << fileName;
QFile jsonFile(fileName);
if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qCWarning(LOG_LIB) << "Could not open" << fileName;
return;
}
QString jsonText = jsonFile.readAll();
jsonFile.close();
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonText.toUtf8(), &error);
if (error.error != QJsonParseError::NoError) {
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
return;
}
jsonFilters = jsonDoc.toVariant().toMap();
qCInfo(LOG_LIB) << "Filters" << jsonFilters;
}
开发者ID:wlemuel,项目名称:awesome-widgets,代码行数:25,代码来源:extscript.cpp
示例3: qCDebug
/**
* @fn editOptionPrivate
*/
QueuedResult<bool> QueuedCorePrivateHelper::editOptionPrivate(const QString &_key,
const QVariant &_value)
{
qCDebug(LOG_LIB) << "Set key" << _key << "to" << _value;
// add to database
long long id = advancedSettings()->id(_key);
QVariantHash payload = {{"key", _key}, {"value", _value}};
bool status;
if (id == -1) {
id = database()->add(QueuedDB::SETTINGS_TABLE, payload);
qCInfo(LOG_LIB) << "Added new key with ID" << id;
status = (id != -1);
} else {
status = database()->modify(QueuedDB::SETTINGS_TABLE, id, payload);
qCInfo(LOG_LIB) << "Value for" << _key << "has been modified with status" << status;
}
// add to child object
if (status) {
advancedSettings()->set(_key, _value);
// notify plugins if required
if (plugins()) {
auto tryPluginOption = plugins()->convertOptionName(_key);
if ((!tryPluginOption.first.isEmpty()) && (!tryPluginOption.second.isEmpty()))
plugins()->optionChanged(_key, _value);
// notify plugins
emit(plugins()->interface()->onEditOption(_key, _value));
}
}
return status;
}
开发者ID:arcan1s,项目名称:queued,代码行数:37,代码来源:QueuedCorePrivateHelper.cpp
示例4: qCInfo
void ExtScript::updateValue()
{
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
QString qdebug = QTextCodec::codecForMib(106)
->toUnicode(process->readAllStandardError())
.trimmed();
qCInfo(LOG_LIB) << "Error" << qdebug;
QString qoutput = QTextCodec::codecForMib(106)
->toUnicode(process->readAllStandardOutput())
.trimmed();
qCInfo(LOG_LIB) << "Output" << qoutput;
QString strValue;
switch (m_redirect) {
case stdout2stderr:
break;
case stderr2stdout:
strValue = QString("%1\n%2").arg(qdebug).arg(qoutput);
break;
case swap:
strValue = qdebug;
break;
case nothing:
default:
strValue = qoutput;
break;
}
// filters
value[tag(QString("custom"))] = applyFilters(strValue);
}
开发者ID:wlemuel,项目名称:awesome-widgets,代码行数:31,代码来源:extscript.cpp
示例5: qCInfo
bool DataExporter::exportDay(const QVector<TimeLogEntry> &data)
{
if (data.isEmpty()) {
qCInfo(DATA_IO_CATEGORY) << QString("No data for date %1").arg(m_currentDate.toString());
return true;
}
qCInfo(DATA_IO_CATEGORY) << QString("Exporting data for date %1").arg(m_currentDate.toString());
QString fileName = QString("%1 (%2).csv").arg(m_currentDate.toString(Qt::ISODate))
.arg(m_currentDate.toString("ddd"));
QString filePath = m_dir.filePath(fileName);
QFile file(filePath);
if (file.exists()) {
fail(QString("File %1 already exists").arg(filePath));
return false;
}
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
fail(formatFileError("Fail to open file", file));
return false;
}
QStringList strings;
foreach (const TimeLogEntry &entry, data) {
QStringList values;
values << entry.startTime.toUTC().toString(Qt::ISODate);
values << entry.category;
values << entry.comment;
values << entry.uuid.toString();
strings.append(values.join(m_sep));
}
开发者ID:g-timetracker,项目名称:g-timetracker,代码行数:32,代码来源:DataExporter.cpp
示例6: qCDebug
bool AWKeyCache::addKeyToCache(const QString type, const QString key)
{
qCDebug(LOG_AW) << "Key" << key << "with type" << type;
QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation(
QStandardPaths::GenericCacheLocation));
qCInfo(LOG_AW) << "Cache file" << fileName;
QSettings cache(fileName, QSettings::IniFormat);
cache.beginGroup(type);
QStringList cachedValues;
for (auto key : cache.allKeys())
cachedValues.append(cache.value(key).toString());
if (type == QString("hdd")) {
QStringList allDevices
= QDir(QString("/dev")).entryList(QDir::System, QDir::Name);
QStringList devices
= allDevices.filter(QRegExp(QString("^[hms]d[a-z]$")));
for (auto dev : devices) {
QString device = QString("/dev/%1").arg(dev);
if (cachedValues.contains(device))
continue;
qCInfo(LOG_AW) << "Found new key" << device << "for type" << type;
cache.setValue(
QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')),
device);
}
} else if (type == QString("net")) {
QList<QNetworkInterface> rawInterfaceList
= QNetworkInterface::allInterfaces();
for (auto interface : rawInterfaceList) {
QString device = interface.name();
if (cachedValues.contains(device))
continue;
qCInfo(LOG_AW) << "Found new key" << device << "for type" << type;
cache.setValue(
QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')),
device);
}
} else {
if (cachedValues.contains(key))
return false;
qCInfo(LOG_AW) << "Found new key" << key << "for type" << type;
cache.setValue(
QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')), key);
}
cache.endGroup();
cache.sync();
return true;
}
开发者ID:wlemuel,项目名称:awesome-widgets,代码行数:53,代码来源:awkeycache.cpp
示例7: qCInfo
void ConfigFile::setupDefaultExcludeFilePaths(ExcludedFiles &excludedFiles)
{
ConfigFile cfg;
QString systemList = cfg.excludeFile(ConfigFile::SystemScope);
qCInfo(lcConfigFile) << "Adding system ignore list to csync:" << systemList;
excludedFiles.addExcludeFilePath(systemList);
QString userList = cfg.excludeFile(ConfigFile::UserScope);
if (QFile::exists(userList)) {
qCInfo(lcConfigFile) << "Adding user defined ignore list to csync:" << userList;
excludedFiles.addExcludeFilePath(userList);
}
}
开发者ID:owncloud,项目名称:client,代码行数:13,代码来源:configfile.cpp
示例8: qCInfo
int InboundAudioStream::writeDroppableSilentFrames(int silentFrames) {
// We can't guarentee that all clients have faded the stream down
// to silence and encoded that silence before sending us a
// SilentAudioFrame. If the encoder has truncated the stream it will
// leave the decoder holding some unknown loud state. To handle this
// case we will call the decoder's lostFrame() method, which indicates
// that it should interpolate from its last known state down toward
// silence.
if (_decoder) {
// FIXME - We could potentially use the output from the codec, in which
// case we might get a cleaner fade toward silence. NOTE: The below logic
// attempts to catch up in the event that the jitter buffers have grown.
// The better long term fix is to use the output from the decode, detect
// when it actually reaches silence, and then delete the silent portions
// of the jitter buffers. Or petentially do a cross fade from the decode
// output to silence.
QByteArray decodedBuffer;
_decoder->lostFrame(decodedBuffer);
}
// calculate how many silent frames we should drop.
int silentSamples = silentFrames * _numChannels;
int samplesPerFrame = _ringBuffer.getNumFrameSamples();
int desiredJitterBufferFramesPlusPadding = _desiredJitterBufferFrames + DESIRED_JITTER_BUFFER_FRAMES_PADDING;
int numSilentFramesToDrop = 0;
if (silentSamples >= samplesPerFrame && _currentJitterBufferFrames > desiredJitterBufferFramesPlusPadding) {
// our avg jitter buffer size exceeds its desired value, so ignore some silent
// frames to get that size as close to desired as possible
int numSilentFramesToDropDesired = _currentJitterBufferFrames - desiredJitterBufferFramesPlusPadding;
int numSilentFramesReceived = silentSamples / samplesPerFrame;
numSilentFramesToDrop = std::min(numSilentFramesToDropDesired, numSilentFramesReceived);
// dont reset _currentJitterBufferFrames here; we want to be able to drop further silent frames
// without waiting for _framesAvailableStat to fill up to 10s of samples.
_currentJitterBufferFrames -= numSilentFramesToDrop;
_silentFramesDropped += numSilentFramesToDrop;
qCInfo(audiostream, "Dropped %d silent frames", numSilentFramesToDrop);
qCInfo(audiostream, "Set current jitter frames to %d (dropped)", _currentJitterBufferFrames);
_framesAvailableStat.reset();
}
int ret = _ringBuffer.addSilentSamples(silentSamples - numSilentFramesToDrop * samplesPerFrame);
return ret;
}
开发者ID:huffman,项目名称:hifi,代码行数:50,代码来源:InboundAudioStream.cpp
示例9: Q_UNUSED
void LibInputHandlerPrivate::logHandler(libinput *handle, libinput_log_priority priority,
const char *format, va_list args)
{
Q_UNUSED(handle);
char buffer[512];
int n = vsnprintf(buffer, sizeof(buffer), format, args);
if (n > 0) {
// Remove newline
if (buffer[n - 1] == '\n')
buffer[n - 1] = '\0';
// Log the message prefixing "libinput" so that messages from the
// library can be dinstinguished from ours
switch (priority) {
case LIBINPUT_LOG_PRIORITY_DEBUG:
qCDebug(lcInput, "%s", buffer);
break;
case LIBINPUT_LOG_PRIORITY_ERROR:
qCWarning(lcInput, "%s", buffer);
break;
case LIBINPUT_LOG_PRIORITY_INFO:
qCInfo(lcInput, "%s", buffer);
break;
default:
break;
}
}
}
开发者ID:greenisland,项目名称:greenisland,代码行数:29,代码来源:libinputhandler.cpp
示例10: qCInfo
bool AbstractExtItem::tryDelete() const
{
bool status = QFile::remove(m_fileName);
qCInfo(LOG_LIB) << "Remove file" << m_fileName << status;
return status;
}
开发者ID:arcan1s,项目名称:awesome-widgets,代码行数:7,代码来源:abstractextitem.cpp
示例11: DateTimeCalendar
void DateTime::action() const
{
DateTimeCalendar *calendar = new DateTimeCalendar(nullptr);
int ret = calendar->exec();
qCInfo(LOG_PL) << "Calendar exited with code" << ret;
delete calendar;
}
开发者ID:arcan1s,项目名称:quadro-plugins,代码行数:7,代码来源:DateTime.cpp
示例12: DateiNichtGefunden
void Konfiguration::Laden()
{
QString Datei;
if (K_Konfig)
return;
if (!K_Klientconfig)
{
Datei=K_Datei;
if (!QFile::exists(K_Datei))
{
Q_EMIT DateiNichtGefunden();
return;
}
K_Konfig=new QSettings(K_Datei,QSettings::IniFormat,this);
}
else
{
K_Konfig=new QSettings(QSettings::IniFormat,QSettings::UserScope,qApp->organizationName(),
qApp->applicationName(),this);
Datei=K_Konfig->fileName();
}
qCInfo(qalarm_Konfiguration)<<tr("Lade Datei %1").arg(Datei);
K_Konfig->setIniCodec("UTF-8");
Q_EMIT Geladen();
}
开发者ID:QAlarm,项目名称:Lib,代码行数:25,代码来源:Konfiguration.cpp
示例13: while
void QueuedServer::init()
{
while (QueuedCoreAdaptor::getStatus().type() != Result::Content::Value) {
qCWarning(LOG_SERV) << "Daemon seems to be unavailable wait" << WAIT_FOR_DAEMON;
QTime timer = QTime::currentTime().addMSecs(WAIT_FOR_DAEMON);
while (QTime::currentTime() < timer)
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
m_server->init(QueuedCoreAdaptor::getOption(QueuedConfig::QueuedSettings::ServerTimeout, "")
.get()
.toInt());
QString address = QueuedCoreAdaptor::getOption(QueuedConfig::QueuedSettings::ServerAddress, "")
.get()
.toString();
ushort port
= QueuedCoreAdaptor::getOption(QueuedConfig::QueuedSettings::ServerPort, "").get().toUInt();
m_server->listen(QHostAddress(address), port);
m_server->setMaxPendingConnections(
QueuedCoreAdaptor::getOption(QueuedConfig::QueuedSettings::ServerMaxConnections, "")
.get()
.toInt());
qCInfo(LOG_SERV) << "Server listen on" << m_server->serverAddress() << m_server->serverPort();
}
开发者ID:arcan1s,项目名称:queued,代码行数:26,代码来源:QueuedServer.cpp
示例14: settings
void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
{
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
qint64 infoVersion = Helper::stringVersionToInt(info.version());
qint64 seenVersion = Helper::stringVersionToInt(settings.value(seenVersionC).toString());
qint64 currVersion = Helper::currentVersionToInt();
if (info.version().isEmpty()
|| infoVersion <= currVersion
|| infoVersion <= seenVersion) {
qCInfo(lcUpdater) << "Client is on latest version!";
setDownloadState(UpToDate);
} else {
QString url = info.downloadUrl();
qint64 autoUpdateFailedVersion =
Helper::stringVersionToInt(settings.value(autoUpdateFailedVersionC).toString());
if (url.isEmpty() || _showFallbackMessage || infoVersion == autoUpdateFailedVersion) {
showDialog(info);
}
if (!url.isEmpty()) {
_targetFile = cfg.configPath() + url.mid(url.lastIndexOf('/'));
if (QFile(_targetFile).exists()) {
setDownloadState(DownloadComplete);
} else {
QNetworkReply *reply = qnam()->get(QNetworkRequest(QUrl(url)));
connect(reply, &QIODevice::readyRead, this, &NSISUpdater::slotWriteFile);
connect(reply, &QNetworkReply::finished, this, &NSISUpdater::slotDownloadFinished);
setDownloadState(Downloading);
_file.reset(new QTemporaryFile);
_file->setAutoRemove(true);
_file->open();
}
}
}
}
开发者ID:msphn,项目名称:client,代码行数:35,代码来源:ocupdater.cpp
示例15: keyFilePath
// for now a copy of how we sign in libraries/networking/src/DataServerAccountInfo -
// we sha256 the text, read the private key from disk (for now!), and return the signed
// sha256. Note later with multiple keys, we may need the key parameter (or something
// similar) so I left it alone for now. Also this will probably change when we move
// away from RSA keys anyways. Note that since this returns a QString, we better avoid
// the horror of code pages and so on (changing the bytes) by just returning a base64
// encoded string representing the signature (suitable for http, etc...)
QString Wallet::signWithKey(const QByteArray& text, const QString& key) {
EC_KEY* ecPrivateKey = NULL;
auto keyFilePathString = keyFilePath().toStdString();
if ((ecPrivateKey = readPrivateKey(keyFilePath().toStdString().c_str()))) {
unsigned char* sig = new unsigned char[ECDSA_size(ecPrivateKey)];
unsigned int signatureBytes = 0;
qCInfo(commerce) << "Hashing and signing plaintext" << text << "with key at address" << ecPrivateKey;
QByteArray hashedPlaintext = QCryptographicHash::hash(text, QCryptographicHash::Sha256);
int retrn = ECDSA_sign(0,
reinterpret_cast<const unsigned char*>(hashedPlaintext.constData()),
hashedPlaintext.size(),
sig,
&signatureBytes, ecPrivateKey);
EC_KEY_free(ecPrivateKey);
QByteArray signature(reinterpret_cast<const char*>(sig), signatureBytes);
if (retrn != -1) {
return signature.toBase64();
}
}
return QString();
}
开发者ID:howard-stearns,项目名称:hifi,代码行数:35,代码来源:Wallet.cpp
示例16: initialize
bool Wallet::generateKeyPair() {
// FIXME: initialize OpenSSL elsewhere soon
initialize();
qCInfo(commerce) << "Generating keypair.";
auto keyPair = generateECKeypair();
if (!keyPair.first) {
qCWarning(commerce) << "Empty keypair";
return false;
}
writeBackupInstructions();
// TODO: redo this soon -- need error checking and so on
writeSecurityImage(_securityImage, keyFilePath());
QString key = keyPair.first->toBase64();
_publicKeys.push_back(key);
qCDebug(commerce) << "public key:" << key;
_isOverridingServer = false;
// It's arguable whether we want to change the receiveAt every time, but:
// 1. It's certainly needed the first time, when createIfNeeded answers true.
// 2. It is maximally private, and we can step back from that later if desired.
// 3. It maximally exercises all the machinery, so we are most likely to surface issues now.
auto ledger = DependencyManager::get<Ledger>();
return ledger->receiveAt(key, key, getWallet());
}
开发者ID:Atlante45,项目名称:hifi,代码行数:27,代码来源:Wallet.cpp
示例17: qCInfo
// TODO: Instead of doing all in this slot, we should iteratively parse in readyRead(). This
// would allow us to be more asynchronous in processing while data is coming from the network,
// not all in one big blob at the end.
bool LsColJob::finished()
{
qCInfo(lcLsColJob) << "LSCOL of" << reply()->request().url() << "FINISHED WITH STATUS"
<< reply()->error()
<< (reply()->error() == QNetworkReply::NoError ? QLatin1String("") : errorString());
QString contentType = reply()->header(QNetworkRequest::ContentTypeHeader).toString();
int httpCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (httpCode == 207 && contentType.contains("application/xml; charset=utf-8")) {
LsColXMLParser parser;
connect(&parser, &LsColXMLParser::directoryListingSubfolders,
this, &LsColJob::directoryListingSubfolders);
connect(&parser, &LsColXMLParser::directoryListingIterated,
this, &LsColJob::directoryListingIterated);
connect(&parser, &LsColXMLParser::finishedWithError,
this, &LsColJob::finishedWithError);
connect(&parser, &LsColXMLParser::finishedWithoutError,
this, &LsColJob::finishedWithoutError);
QString expectedPath = reply()->request().url().path(); // something like "/owncloud/remote.php/webdav/folder"
if (!parser.parse(reply()->readAll(), &_sizes, expectedPath)) {
// XML parse error
emit finishedWithError(reply());
}
} else if (httpCode == 207) {
// wrong content type
emit finishedWithError(reply());
} else {
// wrong HTTP code or any other network error
emit finishedWithError(reply());
}
return true;
}
开发者ID:uniblockchain,项目名称:client,代码行数:37,代码来源:networkjobs.cpp
示例18: QString
QString YahooWeatherHelper::url() const
{
QString apiUrl
= QString("%1").arg(YAHOO_FORECAST_URL).arg(m_city).arg(m_country);
qCInfo(LOG_PL) << "Using url" << apiUrl;
return apiUrl;
}
开发者ID:arcan1s,项目名称:quadro-plugins,代码行数:8,代码来源:YahooWeatherHelper.cpp
示例19: qCInfo
void WebsocketServer::NeuerKlient()
{
QWebSocket *Klient=K_Server->nextPendingConnection();
qCInfo(qalarm_serverWebsocketServer)<<tr("Neuer Klient: IP: %1 Anschluss: %2").arg(Klient->peerAddress().toString())
.arg(Klient->peerPort());
qCDebug(qalarm_serverWebsocketServer)<<tr("Klient fordert an: %1").arg(Klient->requestUrl().toString());
Klient->deleteLater();
}
开发者ID:QAlarm,项目名称:Server,代码行数:8,代码来源:WebsocketServer.cpp
示例20: Fehler
void WebsocketServer::starten()
{
if (!K_Server->listen(K_IPAdresse,K_Anschluss))
Q_EMIT Fehler(tr("Konnte den Server nicht starten. %1").arg(K_Server->errorString()));
else
qCInfo(qalarm_serverWebsocketServer)<<tr("Der Server lauscht auf der Adresse %1 und dem Anschluss %2").arg(K_Server->serverAddress().toString())
.arg(K_Server->serverPort());
}
开发者ID:QAlarm,项目名称:Server,代码行数:8,代码来源:WebsocketServer.cpp
注:本文中的qCInfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论