本文整理汇总了C++中cDebug函数的典型用法代码示例。如果您正苦于以下问题:C++ cDebug函数的具体用法?C++ cDebug怎么用?C++ cDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cDebug函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: foreach
void
Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Exception
{
foreach ( const QString& path, moduleConfigurationCandidates( Settings::instance()->debugMode(), m_name, configFileName ) )
{
QFile configFile( path );
if ( configFile.exists() && configFile.open( QFile::ReadOnly | QFile::Text ) )
{
QByteArray ba = configFile.readAll();
YAML::Node doc = YAML::Load( ba.constData() );
if ( doc.IsNull() )
{
cDebug() << "Found empty module configuration" << path;
// Special case: empty config files are valid,
// but aren't a map.
return;
}
if ( !doc.IsMap() )
{
cWarning() << "Bad module configuration format" << path;
return;
}
cDebug() << "Loaded module configuration" << path;
m_configurationMap = CalamaresUtils::yamlMapToVariant( doc ).toMap();
m_emergency = m_maybe_emergency
&& m_configurationMap.contains( EMERGENCY )
&& m_configurationMap[ EMERGENCY ].toBool();
return;
}
}
开发者ID:tsimonq2,项目名称:calamares,代码行数:32,代码来源:Module.cpp
示例2: gettext_path
bp::object
gettext_path()
{
// TODO: distinguish between -d runs and normal runs
// TODO: can we detect DESTDIR-installs?
QStringList candidatePaths = QStandardPaths::locateAll( QStandardPaths::GenericDataLocation, "locale", QStandardPaths::LocateDirectory );
QString extra = QCoreApplication::applicationDirPath();
_add_localedirs( candidatePaths, extra ); // Often /usr/local/bin
if ( !extra.isEmpty() )
{
QDir d( extra );
if ( d.cd( "../share/locale" ) ) // Often /usr/local/bin/../share/locale -> /usr/local/share/locale
_add_localedirs( candidatePaths, d.canonicalPath() );
}
_add_localedirs( candidatePaths, QDir().canonicalPath() ); // .
cDebug() << "Standard paths" << candidatePaths;
for ( auto lang : _gettext_languages() )
for ( auto localedir : candidatePaths )
{
QDir ldir( localedir );
cDebug() << "Checking" << lang << "in" <<ldir.canonicalPath();
if ( ldir.cd( lang ) )
return bp::object( localedir.toStdString() );
}
return bp::object(); // None
}
开发者ID:ximion,项目名称:calamares,代码行数:28,代码来源:PythonJobApi.cpp
示例3: cDebug
void
ViewModule::loadSelf()
{
if ( m_loader )
{
PluginFactory* pf = qobject_cast< PluginFactory* >( m_loader->instance() );
if ( !pf )
{
cDebug() << Q_FUNC_INFO << "No factory:" << m_loader->errorString();
return;
}
m_viewStep = pf->create< Calamares::ViewStep >();
if ( !m_viewStep )
{
cDebug() << Q_FUNC_INFO << "create() failed" << m_loader->errorString();
return;
}
// cDebug() << "ViewModule loading self for instance" << instanceKey()
// << "\nViewModule at address" << this
// << "\nCalamares::PluginFactory at address" << pf
// << "\nViewStep at address" << m_viewStep;
m_viewStep->setModuleInstanceKey( instanceKey() );
m_viewStep->setConfigurationMap( m_configurationMap );
ViewManager::instance()->addViewStep( m_viewStep );
m_loaded = true;
cDebug() << "ViewModule" << instanceKey() << "loading complete.";
}
}
开发者ID:shainer,项目名称:calamares,代码行数:30,代码来源:ViewModule.cpp
示例4: canBeResized
bool
canBeResized( PartitionCoreModule* core, const QString& partitionPath )
{
//FIXME: check for max partitions count on DOS MBR
cDebug() << "checking if" << partitionPath << "can be resized.";
QString partitionWithOs = partitionPath;
if ( partitionWithOs.startsWith( "/dev/" ) )
{
cDebug() << partitionWithOs << "seems like a good path";
bool canResize = false;
DeviceModel* dm = core->deviceModel();
for ( int i = 0; i < dm->rowCount(); ++i )
{
Device* dev = dm->deviceForIndex( dm->index( i ) );
Partition* candidate = KPMHelpers::findPartitionByPath( { dev }, partitionWithOs );
if ( candidate )
{
cDebug() << "found Partition* for" << partitionWithOs;
return canBeResized( candidate );
}
}
}
cDebug() << "Partition" << partitionWithOs << "CANNOT BE RESIZED FOR AUTOINSTALL.";
return false;
}
开发者ID:AlpyDemirok,项目名称:calamares,代码行数:26,代码来源:PartUtils.cpp
示例5: QApplication
CalamaresApplication::CalamaresApplication( int& argc, char *argv[] )
: QApplication( argc, argv )
, m_mainwindow( 0 )
{
setOrganizationName( QLatin1String( CALAMARES_ORGANIZATION_NAME ) );
setOrganizationDomain( QLatin1String( CALAMARES_ORGANIZATION_DOMAIN ) );
setApplicationName( QLatin1String( CALAMARES_APPLICATION_NAME ) );
setApplicationVersion( QLatin1String( CALAMARES_VERSION ) );
QString startupLocale = QLocale::system().uiLanguages().first();
CalamaresUtils::installTranslator( startupLocale, this );
QFont f = font();
cDebug() << "Default font ====="
<< "\nPixel size: " << f.pixelSize()
<< "\nPoint size: " << f.pointSize()
<< "\nPoint sizeF: " << f.pointSizeF()
<< "\nFont family: " << f.family()
<< "\nMetric height:" << QFontMetrics( f ).height();
// The following line blocks for 15s on Qt 5.1.0
cDebug() << "Font height:" << QFontMetrics( f ).height();
CalamaresUtils::setDefaultFontSize( f.pointSize() );
cDebug() << "Available languages:" << QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' );
}
开发者ID:toudi,项目名称:calamares,代码行数:26,代码来源:CalamaresApplication.cpp
示例6: canBeReplaced
bool
canBeReplaced( Partition* candidate )
{
if ( !candidate )
return false;
bool ok = false;
double requiredStorageGB = Calamares::JobQueue::instance()
->globalStorage()
->value( "requiredStorageGB" )
.toDouble( &ok );
qint64 availableStorageB = candidate->capacity();
qint64 requiredStorageB = ( requiredStorageGB + 0.5 ) * 1024 * 1024 * 1024;
cDebug() << "Required storage B:" << requiredStorageB
<< QString( "(%1GB)" ).arg( requiredStorageB / 1024 / 1024 / 1024 );
cDebug() << "Storage capacity B:" << availableStorageB
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 )
<< "for" << candidate->partitionPath() << " length:" << candidate->length();
if ( ok &&
availableStorageB > requiredStorageB )
{
cDebug() << "Partition" << candidate->partitionPath() << "authorized for replace install.";
return true;
}
return false;
}
开发者ID:dgikiller,项目名称:calamares,代码行数:29,代码来源:PartUtils.cpp
示例7: currentDir
void
ModuleManager::doInit()
{
// We start from a list of paths in m_paths. Each of those is a directory that
// might (should) contain Calamares modules of any type/interface.
// For each modules search path (directory), it is expected that each module
// lives in its own subdirectory. This subdirectory must have the same name as
// the module name, and must contain a settings file named module.desc.
// If at any time the module loading procedure finds something unexpected, it
// silently skips to the next module or search path. --Teo 6/2014
for ( const QString& path : m_paths )
{
QDir currentDir( path );
if ( currentDir.exists() && currentDir.isReadable() )
{
const QStringList subdirs = currentDir.entryList( QDir::AllDirs | QDir::NoDotAndDotDot );
for ( const QString& subdir : subdirs )
{
currentDir.setPath( path );
bool success = currentDir.cd( subdir );
if ( success )
{
QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc") ) );
if ( ! ( descriptorFileInfo.exists() && descriptorFileInfo.isReadable() ) )
{
cDebug() << Q_FUNC_INFO << "unreadable file: "
<< descriptorFileInfo.absoluteFilePath();
continue;
}
bool ok = false;
QVariantMap moduleDescriptorMap = CalamaresUtils::loadYaml( descriptorFileInfo, &ok );
QString moduleName = ok ? moduleDescriptorMap.value( "name" ).toString() : QString();
if ( ok && ( moduleName == currentDir.dirName() ) &&
!m_availableDescriptorsByModuleName.contains( moduleName ) )
{
m_availableDescriptorsByModuleName.insert( moduleName, moduleDescriptorMap );
m_moduleDirectoriesByModuleName.insert( moduleName,
descriptorFileInfo.absoluteDir().absolutePath() );
}
}
else
{
cWarning() << "Cannot cd into module directory "
<< path << "/" << subdir;
}
}
}
else
cDebug() << "ModuleManager bad search path" << path;
}
// At this point m_availableModules is filled with whatever was found in the
// search paths.
emit initDone();
}
开发者ID:tsimonq2,项目名称:calamares,代码行数:56,代码来源:ModuleManager.cpp
示例8: cDebug
void AudioModel::load_audio_done(AudioPlayer *audio)
{
load_count--;
cDebug() << "[AUDIO load done]";
if (load_count <= 0)
{
cDebug() << "[AUDIO LOAD DONE sending signal]";
load_done.emit();
}
}
开发者ID:JulienMasson,项目名称:calaos_base,代码行数:12,代码来源:AudioModel.cpp
示例9: cDebug
CalamaresApplication::~CalamaresApplication()
{
cDebug( LOGVERBOSE ) << "Shutting down Calamares...";
// if ( JobQueue::instance() )
// JobQueue::instance()->stop();
// delete m_mainwindow;
// delete JobQueue::instance();
cDebug( LOGVERBOSE ) << "Finished shutdown.";
}
开发者ID:prodigeni,项目名称:calamares,代码行数:13,代码来源:CalamaresApplication.cpp
示例10: cDebug
void CameraModel::load_camera_done(Camera *camera)
{
load_count--;
cDebug() << "[CAMERA load done]";
if (load_count <= 0)
{
cDebug() << "[CAMERA LOAD DONE sending signal]";
load_done.emit();
}
}
开发者ID:DjMomo,项目名称:calaos_base,代码行数:13,代码来源:CameraModel.cpp
示例11: canBeResized
bool
canBeResized( Partition* candidate )
{
if ( !candidate )
return false;
if ( !candidate->fileSystem().supportGrow() ||
!candidate->fileSystem().supportShrink() )
return false;
if ( KPMHelpers::isPartitionFreeSpace( candidate ) )
return false;
if ( candidate->roles().has( PartitionRole::Primary ) )
{
PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() );
if ( !table )
return false;
if ( table->numPrimaries() >= table->maxPrimaries() )
return false;
}
bool ok = false;
double requiredStorageGB = Calamares::JobQueue::instance()
->globalStorage()
->value( "requiredStorageGB" )
.toDouble( &ok );
qint64 availableStorageB = candidate->available();
// We require a little more for partitioning overhead and swap file
// TODO: maybe make this configurable?
qint64 requiredStorageB = ( requiredStorageGB + 0.5 + 2.0 ) * 1024 * 1024 * 1024;
cDebug() << "Required storage B:" << requiredStorageB
<< QString( "(%1GB)" ).arg( requiredStorageB / 1024 / 1024 / 1024 );
cDebug() << "Available storage B:" << availableStorageB
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 )
<< "for" << candidate->partitionPath() << " length:" << candidate->length()
<< " sectorsUsed:" << candidate->sectorsUsed() << " fsType:" << candidate->fileSystem().name();
if ( ok &&
availableStorageB > requiredStorageB )
{
cDebug() << "Partition" << candidate->partitionPath() << "authorized for resize + autopartition install.";
return true;
}
return false;
}
开发者ID:dgikiller,项目名称:calamares,代码行数:50,代码来源:PartUtils.cpp
示例12: report
Calamares::JobResult
CreatePartitionTableJob::exec()
{
Report report( 0 );
QString message = tr( "The installer failed to create a partition table on %1." ).arg( m_device->name() );
CoreBackend* backend = CoreBackendManager::self()->backend();
QScopedPointer< CoreBackendDevice > backendDevice( backend->openDevice( m_device->deviceNode() ) );
if ( !backendDevice.data() )
{
return Calamares::JobResult::error(
message,
tr( "Could not open device %1." ).arg( m_device->deviceNode() )
);
}
QScopedPointer< PartitionTable > table( createTable() );
cDebug() << "Creating new partition table of type" << table->typeName()
<< ", uncommitted yet:\n" << table;
QProcess lsblk;
lsblk.setProgram( "lsblk" );
lsblk.setProcessChannelMode( QProcess::MergedChannels );
lsblk.start();
lsblk.waitForFinished();
cDebug() << "lsblk:\n" << lsblk.readAllStandardOutput();
QProcess mount;
mount.setProgram( "mount" );
mount.setProcessChannelMode( QProcess::MergedChannels );
mount.start();
mount.waitForFinished();
cDebug() << "mount:\n" << mount.readAllStandardOutput();
bool ok = backendDevice->createPartitionTable( report, *table );
if ( !ok )
{
return Calamares::JobResult::error(
message,
QString( "Text: %1\nCommand: %2\nOutput: %3\nStatus: %4" )
.arg( report.toText() )
.arg( report.command() )
.arg( report.output() )
.arg( report.status() )
);
}
return Calamares::JobResult::ok();
}
开发者ID:Rezesius,项目名称:calamares,代码行数:49,代码来源:CreatePartitionTableJob.cpp
示例13: plasma_themes
void PlasmaLnfPage::winnowThemes()
{
auto plasmaThemes = plasma_themes();
bool winnowed = true;
int winnow_index = 0;
while ( winnowed )
{
winnowed = false;
winnow_index = 0;
for ( auto& enabled_theme : m_enabledThemes )
{
ThemeInfo* t = plasmaThemes.findById( enabled_theme.id );
if ( t == nullptr )
{
cDebug() << "Removing" << enabled_theme.id;
winnowed = true;
break;
}
++winnow_index;
}
if ( winnowed )
{
m_enabledThemes.removeAt( winnow_index );
}
}
}
开发者ID:calamares,项目名称:calamares,代码行数:28,代码来源:PlasmaLnfPage.cpp
示例14: EmitSignal
void ActivityAudioListView::browserShowPlaylistTracks(Params &infos, Params pl_infos)
{
if (!infos.Exists("count")) return;
EmitSignal("browser,loading,stop", "calaos");
cDebug() << "RESULT infos: " << pl_infos.toString();
pl_infos.Add("count", infos["count"]);
int count;
from_string(infos["count"], count);
int pl_id;
from_string(pl_infos["id"], pl_id);
CREATE_GENLIST_HELPER(glist);
GenlistItemPlaylistHeader *header = new GenlistItemPlaylistHeader(evas, parent, player_current->getPlayer(), pl_infos, pl_id);
header->Append(glist);
for (int i = 0;i < count;i++)
{
GenlistItemTrack *item = new GenlistItemTrack(evas, parent, player_current->getPlayer(), i, GenlistItemTrack::TRACK_PLAYLIST, pl_id);
item->Append(glist);
}
elm_naviframe_item_push(pager_browser, NULL, NULL, NULL, glist, "calaos");
}
开发者ID:lovo63,项目名称:calaos_base,代码行数:28,代码来源:ActivityAudioListView.cpp
示例15: stopCheck
bool IntroCode::codeSubmitFail(const RPCError &error) {
stopCheck();
code.setDisabled(false);
const QString &err = error.type();
if (err == "PHONE_NUMBER_INVALID" || err == "PHONE_CODE_EXPIRED") { // show error
onBack();
return true;
} else if (err == "PHONE_CODE_EMPTY" || err == "PHONE_CODE_INVALID") {
showError(lang(lng_bad_code));
code.setFocus();
return true;
} else if (err == "PHONE_NUMBER_UNOCCUPIED") { // success, need to signUp
intro()->setCode(sentCode);
intro()->onIntroNext();
return true;
}
if (QRegularExpression("^FLOOD_WAIT_(\\d+)$").match(err).hasMatch()) {
showError(lang(lng_flood_error));
code.setFocus();
return true;
}
if (cDebug()) { // internal server error
showError(err + ": " + error.description());
} else {
showError(lang(lng_server_error));
}
code.setFocus();
return false;
}
开发者ID:HoTaeWang,项目名称:tdesktop,代码行数:29,代码来源:introcode.cpp
示例16: cDebug
void GenlistItemArtist::artistItemGet_cb(Params &infos)
{
cDebug() << "Got infos..." << infos.toString();
item_infos = infos;
elm_genlist_item_fields_update(item, "text", ELM_GENLIST_ITEM_FIELD_TEXT);
}
开发者ID:JulienMasson,项目名称:calaos_base,代码行数:7,代码来源:GenlistItemArtist.cpp
示例17: ClearTempMountsJob
QList< Calamares::job_ptr >
PartitionCoreModule::jobs() const
{
QList< Calamares::job_ptr > lst;
QList< Device* > devices;
lst << Calamares::job_ptr( new ClearTempMountsJob() );
for ( auto info : m_deviceInfos )
{
if ( info->isDirty() )
lst << Calamares::job_ptr( new ClearMountsJob( info->device.data() ) );
}
for ( auto info : m_deviceInfos )
{
lst << info->jobs;
devices << info->device.data();
}
cDebug() << "Creating FillGlobalStorageJob with bootLoader path" << m_bootLoaderInstallPath;
lst << Calamares::job_ptr( new FillGlobalStorageJob( devices, m_bootLoaderInstallPath ) );
QStringList jobsDebug;
foreach ( auto job, lst )
{
jobsDebug.append( job->prettyName() );
}
开发者ID:shainer,项目名称:calamares,代码行数:28,代码来源:PartitionCoreModule.cpp
示例18: swapSuggestion
qint64
swapSuggestion( const qint64 availableSpaceB )
{
#define MiB * static_cast< qint64 >( 1024 ) * 1024
#define GiB * static_cast< qint64 >( 1024 ) * 1024 * 1024
// swap(mem) = max(2, 2 * mem), if mem < 2 GiB
// = mem, if 2 GiB <= mem < 8 GiB
// = mem / 2, if 8 GIB <= mem < 64 GiB
// = 4 GiB, if mem >= 64 GiB
qint64 suggestedSwapSizeB = 0;
qint64 availableRamB = CalamaresUtils::System::instance()->getPhysicalMemoryB();
qreal overestimationFactor = 1.01;
if ( !availableRamB )
{
availableRamB = CalamaresUtils::System::instance()->getTotalMemoryB();
overestimationFactor = 1.10;
}
bool ensureSuspendToDisk =
Calamares::JobQueue::instance()->globalStorage()->
value( "ensureSuspendToDisk" ).toBool();
if ( ensureSuspendToDisk )
{
if ( availableRamB < 4 GiB )
suggestedSwapSizeB = qMax( 2 GiB, availableRamB * 2 );
else if ( availableRamB >= 4 GiB && availableRamB < 8 GiB )
suggestedSwapSizeB = 8 GiB;
else
suggestedSwapSizeB = availableRamB;
suggestedSwapSizeB *= overestimationFactor;
}
else //if we don't care about suspend to disk
{
if ( availableRamB < 2 GiB )
suggestedSwapSizeB = qMax( 2 GiB, availableRamB * 2 );
else if ( availableRamB >= 2 GiB && availableRamB < 8 GiB )
suggestedSwapSizeB = availableRamB;
else if ( availableRamB >= 8 GiB && availableRamB < 64 GiB )
suggestedSwapSizeB = availableRamB / 2;
else
suggestedSwapSizeB = 4 GiB;
suggestedSwapSizeB *= overestimationFactor;
// don't use more than 10% of available space
qreal maxSwapDiskRatio = 1.10;
qint64 maxSwapSizeB = availableSpaceB * maxSwapDiskRatio;
if ( suggestedSwapSizeB > maxSwapSizeB )
suggestedSwapSizeB = maxSwapSizeB;
}
cDebug() << "Suggested swap size:" << suggestedSwapSizeB / 1024. / 1024. /1024. << "GiB";
return suggestedSwapSizeB;
}
开发者ID:AlpyDemirok,项目名称:calamares,代码行数:60,代码来源:PartitionActions.cpp
示例19: cWarning
void
ViewModule::loadSelf()
{
if ( m_loader )
{
PluginFactory* pf = qobject_cast< PluginFactory* >( m_loader->instance() );
if ( !pf )
{
cWarning() << Q_FUNC_INFO << "No factory:" << m_loader->errorString();
return;
}
m_viewStep = pf->create< Calamares::ViewStep >();
if ( !m_viewStep )
{
cWarning() << Q_FUNC_INFO << "create() failed" << m_loader->errorString();
return;
}
}
// TODO: allow internal view steps to be created here; they would
// have to be linked into the main application somehow.
// If any method created the view step, use it now.
if ( m_viewStep )
{
m_viewStep->setModuleInstanceKey( instanceKey() );
m_viewStep->setConfigurationMap( m_configurationMap );
ViewManager::instance()->addViewStep( m_viewStep );
m_loaded = true;
cDebug() << "ViewModule" << instanceKey() << "loading complete.";
}
else
cWarning() << Q_FUNC_INFO << "No view step was created";
}
开发者ID:KaOSx,项目名称:calamares,代码行数:35,代码来源:ViewModule.cpp
示例20: debugLogWrite
void debugLogWrite(const char *file, int32 line, const QString &v) {
if (!cDebug() || !debugLogStream) return;
const char *last = strstr(file, "/"), *found = 0;
while (last) {
found = last;
last = strstr(last + 1, "/");
}
last = strstr(file, "\\");
while (last) {
found = last;
last = strstr(last + 1, "\\");
}
if (found) {
file = found + 1;
}
{
QMutexLocker lock(&debugLogMutex);
logsInitDebug(); // maybe need to reopen new file
QString msg(QString("%1 %2 (%3 : %4)\n").arg(debugLogEntryStart()).arg(v).arg(file).arg(line));
(*debugLogStream) << msg;
debugLogStream->flush();
#ifdef Q_OS_WIN
// OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
#elif defined Q_OS_MAC
objc_outputDebugString(msg);
#elif defined Q_OS_LINUX && defined _DEBUG
// std::cout << msg.toUtf8().constData();
#endif
}
}
开发者ID:naz95naz,项目名称:tdesktop,代码行数:34,代码来源:logs.cpp
注:本文中的cDebug函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论