예제 #1
0
void error(std::string message, SourcePosition* sourcePosition, bool fatal)
{
    std::cerr << "  " << (fatal ? "fatal: " : "");
    printErrorSource(sourcePosition);
    std::cerr << ": " << message << std::endl;
    incrementErrorCount(fatal);
}
예제 #2
0
void CxxLexer::error(const char *s)
{
    if (!bang_depth && (tokenMarkDepth == 0))
    {
        std::cout << s << std::endl;
        incrementErrorCount();
    }
    else
    {
        if (show_marked)
            std::cout << "Marked " << s << std::endl;
        marked_error_count++;
    }
}
예제 #3
0
void internalError(std::string message, bool fatal)
{
    std::cerr << "  " << (fatal ? "fatal: " : "") << " internal error: " << message << std::endl;
    incrementErrorCount(fatal);
}
예제 #4
0
void SiteCopyFolder::slotFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
    qDebug() << "    * SiteCopy process finished with status" << exitCode;

    if( exitCode == -1 ) {
        qDebug() << "Configuration Error, stop processing.";
        SyncResult res( SyncResult::Error );
        res.setErrorString( tr("Sitecopy configuration problem, check $HOME/.sitecopyrc"));
        incrementErrorCount();
        emit( syncFinished( res ));
    }

    if( exitCode > 1 ) {
      // error has happened.
      QString out( _lastOutput );
      SyncResult res( SyncResult::Error );
      res.setErrorString( out );
      qDebug() << "An error happened: " << out;
      incrementErrorCount();
      emit syncFinished( res );
      return;
    }

    if( _NextStep == Sync ) {
      startSiteCopy( "--sync", Finish ); // sync local with cloud data.
    } else if( _NextStep == Update ) {
      startSiteCopy( "--update", Finish ); // update from owncloud
    } else if( _NextStep == Finish ) {
      qDebug() << "Finished!";
      emit syncFinished( SyncResult(SyncResult::Success) );
      // mLocalChangesSeen = false;
    } else if( _NextStep == Status ) {
      startSiteCopy( "--fetch", FlatList );
    } else if( _NextStep == FlatList ) {
      startSiteCopy( "--flatlist", ExecuteStatus );
    } else if( _NextStep == ExecuteStatus ) {
      if( exitCode == 1 ) {
            qDebug() << "Exit-Code: Sync Needed!";
            analyzeStatus();
            if( _ChangesHash.contains("deleted") && _pathListEmpty ) {
              // problem: Files were added on the cloud. If we say update,
              // the new files are going to be deleted. Lets warn the user.
              qDebug() << "!!!! Better not call update, changes happened on the cloud!";
              SyncResult res( SyncResult::Disabled );
              res.setErrorString( tr("The ownCloud changed. Disabling syncing for security reasons."));
	      res.setSyncChanges( _ChangesHash );
              setSyncEnabled( false );
              emit syncFinished( res );
            } else {
              startSiteCopy( "--update", Status );
            }
        } else if( exitCode == 0 ) {
            qDebug() << "No update needed, remote is in sync.";
            SyncResult res( SyncResult::Success );
            // store the analyze results into the sync result data structure.
            res.setSyncChanges( _ChangesHash );
            // No update needed
            emit syncFinished( res );
        } else {
            qDebug() << "Got an unknown exit code " << exitCode;
            emit syncFinished( SyncResult( SyncResult::Error ) );
        }
    }

    _lastOutput.clear();
}