本文整理汇总了C++中cDebug函数的典型用法代码示例。如果您正苦于以下问题:C++ cDebug函数的具体用法?C++ cDebug怎么用?C++ cDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cDebug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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
}
示例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.";
}
}
示例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;
}
示例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( ';' );
}
示例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;
}
示例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();
}
示例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();
}
}
示例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.";
}
示例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();
}
}
示例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;
}
示例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();
}
示例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 );
}
}
}
示例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");
}
示例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;
}