コード例 #1
0
ファイル: codemanager.cpp プロジェクト: BackupTheBerlios/poa
void CodeManager::saveSource()
{
    Q_ASSERT(!model_->source().isNull());

    QFile source(sourceFilePath());
    Util::writeFile(&source, model_->source());
    model_->setSource(QString::null);
}
コード例 #2
0
 void flushFile( const std::string& account, const std::string& tag, const std::string& fileName ){
   boost::filesystem::path accountDir( account );
   if( !boost::filesystem::exists( accountDir ) ) boost::filesystem::create_directory( accountDir );
   boost::filesystem::path tagDir( tag.c_str() );
   tagDir = accountDir / tagDir;
   if( !boost::filesystem::exists( tagDir ) ) boost::filesystem::create_directory( tagDir );
   boost::filesystem::path sourceFilePath( fileName );
   boost::filesystem::path destFilePath = tagDir / sourceFilePath.leaf();
   if( boost::filesystem::exists(destFilePath) ) boost::filesystem::remove(destFilePath);
   boost::filesystem::copy_file( sourceFilePath, destFilePath  );
 }
コード例 #3
0
ファイル: codemanager.cpp プロジェクト: BackupTheBerlios/poa
void CodeManager::copyTemplate()
{
    QFile cpuTemplate(Settings::instance()->templatePath());
    if (cpuTemplate.exists()) {
        QFile source(sourceFilePath());
        Util::copyFile(&cpuTemplate, &source);
    }
    else {
        throw PoaException(QString(qApp->translate("codemanager","Could not copy code template: %1 does not exist.")).arg(Settings::instance()->templatePath()));
    }
}
コード例 #4
0
ファイル: codemanager.cpp プロジェクト: BackupTheBerlios/poa
QString CodeManager::sourceCode()
{
    if (!model_->source().isNull()) {
        return model_->source();
    }

    QFile source(sourceFilePath());
    if (source.exists()) {
        return Util::readFile(&source);
    }

    return QString::null;
}
コード例 #5
0
ファイル: dwarfdie.cpp プロジェクト: KDE/elf-dissector
QString DwarfDie::sourceLocation() const
{
    return  sourceFilePath() + QLatin1Char(':') + QString::number(attribute(DW_AT_decl_line).toInt());
}