Ejemplo n.º 1
0
bool SevenZipArch::processLine( const TQCString& _line )
{
  TQString line;
  TQString columns[ 11 ];
  unsigned int pos = 0;
  int strpos, len;

  TQTextCodec *codec = TQTextCodec::codecForLocale();
  line = codec->toUnicode( _line );

  columns[ 0 ] = line.right( line.length() - m_nameColumnPos);
  line.truncate( m_nameColumnPos );

  // Go through our columns, try to pick out data, return silently on failure
  for ( TQPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col )
  {
    ArchColumns *curCol = *col;

    strpos = curCol->pattern.search( line, pos );
    len = curCol->pattern.matchedLength();

    if ( ( strpos == -1 ) || ( len > curCol->maxLength ) )
    {
      if ( curCol->optional )
        continue; // More?
      else
      {
        kdDebug(1601) << "processLine failed to match critical column" << endl;
        return false;
      }
    }

    pos = strpos + len;

    columns[ curCol->colRef ] = line.mid( strpos, len );
  }

  // Separated directories pass
  if(columns[4].length() && columns[4][0] == 'D') return true;

  if ( m_dateCol >= 0 )
  {
    TQString year = ( m_repairYear >= 0 ) ?
                   ArkUtils::fixYear( columns[ m_repairYear ].ascii())
                   : columns[ m_fixYear ];
    TQString month = ( m_repairMonth >= 0 ) ?
                   TQString( "%1" )
                   .arg( ArkUtils::getMonth( columns[ m_repairMonth ].ascii() ) )
                   : columns[ m_fixMonth ];
    TQString timestamp = TQString::fromLatin1( "%1-%2-%3 %4" )
                        .arg( year )
                        .arg( month )
                        .arg( columns[ m_fixDay ] )
                        .arg( columns[ m_fixTime ] );

    columns[ m_dateCol ] = timestamp;
  }

  TQStringList list;

  for ( int i = 0; i < m_numCols; ++i )
  {
    list.append( columns[ i ] );
  }

  m_gui->fileList()->addItem( list ); // send the entry to the GUI

  return true;
}
Ejemplo n.º 2
0
 virtual void leaveFunctionScope( QMake::ProjectAST* p )
 {
     indent -= 4;
     kdDebug(9024) << getIndent() << "--------- Leaving FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
     QMake::ASTVisitor::leaveFunctionScope(p);
 }
Ejemplo n.º 3
0
void KRecConfigGeneral::framebaseotherchanged( const QString& text ) {
	_framebase = text.toInt();
kdDebug(60005) << k_funcinfo << "Framebase=" << _framebase << endl;
	emit changed( true );
}
Ejemplo n.º 4
0
 virtual void processInclude( QMake::IncludeAST* a)
 {
     kdDebug(9024) << getIndent() << "Include: " << replaceWs(a->projectName) << endl;
     QMake::ASTVisitor::processInclude(a);
 }
Ejemplo n.º 5
0
 virtual void leaveRealProject( QMake::ProjectAST* p )
 {
     indent -= 4;
     kdDebug(9024) << getIndent() << "--------- Leaving Project: " << replaceWs(p->fileName()) << " --------------" << endl;
     QMake::ASTVisitor::leaveRealProject(p);
 }
Ejemplo n.º 6
0
int SyncTaskListItem::createSyncPlugin(bool state)
{
    int ret = 0;

    if (syncPlugin != NULL) {
        syncPlugin->unInit();
        delete syncPlugin;
        syncPlugin = NULL;
    }

    if (state) {
        KTrader::OfferList offers;

        QString library = getPreferedLibrary();
        QString offer = getPreferedOffer();

        if (library.isEmpty()) {
            offers = getOffers();
            if (offers.begin() != offers.end()) {
                KService::Ptr service = *offers.begin();
                library = service->library();
                offer = service->name();
            }
        }

        if (!library.isEmpty()) {
            kdDebug(2120) << i18n("Name:") << " " << offer << "; "
            << i18n("Library:") << " " << library << endl;
            KLibFactory *factory = KLibLoader::self()->factory(library.ascii());
            if (!factory) {
                QString errorMessage = KLibLoader::self()->lastErrorMessage();
                kdDebug(2120) << i18n("There was an error:") << " " << offer << errorMessage <<
                    endl;
                ret = ERROR_NOFACTORY;
            } else {
                if (factory->inherits("RakiSyncFactory")) {
                    RakiSyncFactory *syncFactory =
                        static_cast<RakiSyncFactory*> (factory);
                    syncPlugin = static_cast<RakiSyncPlugin*>
                                 (syncFactory->create());
                    syncPlugin->init(rra, this, pdaName, this->listView(), offer);
                    syncFactory->callme(); // Fake call to link correct.
                } else {
                    kdDebug(2120) << i18n("Library no Raki-Plugin") << endl;
                    ret = ERROR_WRONGLIBRARYTYPE;
                }
            }
        } else {
            ret = ERROR_NOSYNCHRONIZER;
        }
    }

    switch(ret) {
    case ERROR_NOSYNCHRONIZER:
        KMessageBox::information(this->listView(), "<p>" + i18n("No Synchronizer found for") + " <b>" +
                QString(rra->getTypeForId(objectType)->name2) + "</b></p>", QString(rra->getTypeForId(objectType)->name2) + pdaName);
        this->setOn(false);
        this->makePersistent();
        break;
    case ERROR_WRONGLIBRARYTYPE:
        KMessageBox::error(this->listView(), "<p>" + i18n("Wrong library type for") +" <b>" +
                QString(rra->getTypeForId(objectType)->name2) + "</b></p>", QString(rra->getTypeForId(objectType)->name2) + pdaName);
        this->setOn(false);
        this->makePersistent();
        break;
    case ERROR_NOFACTORY:
        KMessageBox::error(this->listView(), "<p>" + i18n("Wrong library type for") + " <b>" +
                QString(rra->getTypeForId(objectType)->name2) + "</b></p>", QString(rra->getTypeForId(objectType)->name2) + pdaName);
        this->setOn(false);
        this->makePersistent();
        break;
    }

    return ret;
}
Ejemplo n.º 7
0
 virtual void processNewLine( QMake::NewLineAST* n)
 {
     kdDebug(9024) << getIndent() << "Newline " << endl;
     QMake::ASTVisitor::processNewLine(n);
 }
Ejemplo n.º 8
0
void TrashImpl::jobFinished(TDEIO::Job* job)
{
    kdDebug() << k_funcinfo << " error=" << job->error() << endl;
    error( job->error(), job->errorText() );
    tqApp->eventLoop()->exitLoop();
}
Ejemplo n.º 9
0
    TestWidget(QWidget* parent, const char* name)
        : QWidget(parent, name)
    {
        kdDebug().form("mytest %s", "hello") << endl;
        QString test = "%20C this is a string";
        kdDebug(150) << test << endl;
        QCString cstr = test.latin1();
        kdDebug(150) << test << endl;
        QChar ch = 'a';
        kdDebug() << "QChar a: " << ch << endl;
        ch = '\r';
        kdDebug() << "QChar \\r: " << ch << endl;
        kdDebug() << k_lineinfo << "error on this line" << endl;
        kdDebug(2 == 2) << "this is right " << perror << endl;
        kdDebug() << "Before instance creation" << endl;
        kdDebug(1202) << "Before instance creation" << endl;
        KInstance i("kdebugtest");
        kdDebug(1) << "kDebugInfo with inexisting area number" << endl;
        kdDebug(1202) << "This number has a value of " << 5 << endl;
        // kdDebug() << "This number should come out as appname " << 5 << " " << "test" << endl;
        kdWarning() << "1+1 = " << 1+1+1 << endl;
        kdError(1+1 != 2) << "there is something really odd!" << endl;
        QString s = "mystring";
        kdDebug() << s << endl;
        kdError(1202) << "Error !!!" << endl;
        kdError() << "Error with no area" << endl;

        kdDebug() << "Printing a null QWidget pointer: " << (QWidget*)0 << endl;

        kdDebug() << "char " << '^' << " " << char(26) << endl;
        QPoint p(0,9);
        kdDebug() << p << endl;

        QRect r(9,12,58,234);
        kdDebug() << r << endl;

        QRegion reg(r);
        reg += QRect(1,60,200,59);
        kdDebug() << reg << endl;

        QStringList sl;
        sl << "hi" << "this" << "list" << "is" << "short";
        kdDebug() << sl << endl;

        QValueList<int> il;
        kdDebug() << "Empty QValueList<int>: " << il << endl;
        il << 1 << 2 << 3 << 4 << 5;
        kdDebug() << "QValueList<int> filled: " << il << endl;

        Q_LLONG big = 65536LL*65536*500;
        kdDebug() << big << endl;

        QVariant v( 0.12345 );
        kdDebug() << "Variant: " << v << endl;
        v = QPen( Qt::red );
        kdDebug() << "Variant: " << v << endl;

        QByteArray data( 6 );
        data[0] = 42;
        data[1] = 'H';
        data[2] = 'e';
        data[3] = 'l';
        data[4] = 'l';
        data[5] = 'o';
        kdDebug() << data << endl;
        data.resize( 80 );
        data.fill( 42 );
        kdDebug() << data << endl;
    }
Ejemplo n.º 10
0
bool KWStatisticsDialog::calcStats( QLabel **resultLabel, bool selection, bool useFootEndNote  )
{
    ulong charsWithSpace = 0L;
    ulong charsWithoutSpace = 0L;
    ulong words = 0L;
    ulong sentences = 0L;
    ulong lines = 0L;
    ulong syllables = 0L;

    // safety check result labels
    for (int i=0; i < 7; ++i) {
        if ( !resultLabel[i] ) {
            kdDebug() << "Warning: KWStatisticsDiaolog::calcStats result table not initialized." << endl;
            return false;
        }
    }

    // count paragraphs for progress dialog:
    ulong paragraphs = 0L;
    QPtrListIterator<KWFrameSet> framesetIt( m_doc->framesetsIterator() );
    for ( framesetIt.toFirst(); framesetIt.current(); ++framesetIt ) {
        KWFrameSet *frameSet = framesetIt.current();
        if ( (frameSet->frameSetInfo() == KWFrameSet::FI_FOOTNOTE || frameSet->frameSetInfo() == KWFrameSet::FI_BODY) && frameSet->isVisible() )
        {
            if ( (useFootEndNote && frameSet->frameSetInfo() == KWFrameSet::FI_FOOTNOTE) ||
                    frameSet->frameSetInfo() == KWFrameSet::FI_BODY ) {
                paragraphs += frameSet->paragraphs();
            }
        }
    }
    QProgressDialog progress( i18n( "Counting..." ), i18n( "Cancel" ), paragraphs, this, "count", true );
    progress.setMinimumDuration( 1000 );
    progress.setProgress( 0 );

    // do the actual counting
    for ( framesetIt.toFirst(); framesetIt.current(); ++framesetIt ) {
        KWFrameSet *frameSet = framesetIt.current();
        // Exclude headers and footers
        if ( (frameSet->frameSetInfo() == KWFrameSet::FI_FOOTNOTE || frameSet->frameSetInfo() == KWFrameSet::FI_BODY) && frameSet->isVisible() ) {
            if ( (useFootEndNote && frameSet->frameSetInfo() == KWFrameSet::FI_FOOTNOTE) || frameSet->frameSetInfo() == KWFrameSet::FI_BODY )
            {

                if( ! frameSet->statistics( &progress, charsWithSpace, charsWithoutSpace,
                                            words, sentences, syllables, lines, selection ) ) {
                    // someone pressed "Cancel"
                    return false;
                }
            }
        }
    }

    // assign results
    KLocale *locale = KGlobal::locale();
    resultLabel[0]->setText( locale->formatNumber( charsWithSpace, 0) );
    resultLabel[1]->setText( locale->formatNumber( charsWithoutSpace, 0 ) );
    resultLabel[2]->setText( locale->formatNumber( syllables, 0 ) );
    resultLabel[3]->setText( locale->formatNumber( words, 0 ) );
    resultLabel[4]->setText( locale->formatNumber( sentences, 0 ) );
    resultLabel[5]->setText( locale->formatNumber( lines, 0 ) );
    // add flesch
    double f = calcFlesch( sentences, words, syllables );
    QString flesch = locale->formatNumber( f , 1 );
    if( words < 200 ) {
        // a kind of warning if too few words:
        flesch = i18n("approximately %1").arg( flesch );
    }
    resultLabel[6]->setText( flesch );
    return true;
}
Ejemplo n.º 11
0
bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fileId )
{
    kdDebug() << k_funcinfo << origPath << endl;
    // Check source
    const TQCString origPath_c( TQFile::encodeName( origPath ) );
    KDE_struct_stat buff_src;
    if ( KDE_lstat( origPath_c.data(), &buff_src ) == -1 ) {
        if ( errno == EACCES )
           error( TDEIO::ERR_ACCESS_DENIED, origPath );
        else
           error( TDEIO::ERR_DOES_NOT_EXIST, origPath );
        return false;
    }

    // Choose destination trash
    trashId = findTrashDirectory( origPath );
    if ( trashId < 0 ) {
        kdWarning() << "OUCH - internal error, TrashImpl::findTrashDirectory returned " << trashId << endl;
        return false; // ### error() needed?
    }
    kdDebug() << k_funcinfo << "trashing to " << trashId << endl;

    // Grab original filename
    KURL url;
    url.setPath( origPath );
    const TQString origFileName = url.fileName();

    // Make destination file in info/
    url.setPath( infoPath( trashId, origFileName ) ); // we first try with origFileName
    KURL baseDirectory;
    baseDirectory.setPath( url.directory() );
    // Here we need to use O_EXCL to avoid race conditions with other tdeioslave processes
    int fd = 0;
    do {
        kdDebug() << k_funcinfo << "trying to create " << url.path()  << endl;
        fd = ::open( TQFile::encodeName( url.path() ), O_WRONLY | O_CREAT | O_EXCL, 0600 );
        if ( fd < 0 ) {
            if ( errno == EEXIST ) {
                url.setFileName( TDEIO::RenameDlg::suggestName( baseDirectory, url.fileName() ) );
                // and try again on the next iteration
            } else {
                error( TDEIO::ERR_COULD_NOT_WRITE, url.path() );
                return false;
            }
        }
    } while ( fd < 0 );
    const TQString infoPath = url.path();
    fileId = url.fileName();
    Q_ASSERT( fileId.endsWith( ".trashinfo" ) );
    fileId.truncate( fileId.length() - 10 ); // remove .trashinfo from fileId

    FILE* file = ::fdopen( fd, "w" );
    if ( !file ) { // can't see how this would happen
        error( TDEIO::ERR_COULD_NOT_WRITE, infoPath );
        return false;
    }

    // Contents of the info file. We could use KSimpleConfig, but that would
    // mean closing and reopening fd, i.e. opening a race condition...
    TQCString info = "[Trash Info]\n";
    info += "Path=";
    // Escape filenames according to the way they are encoded on the filesystem
    // All this to basically get back to the raw 8-bit representation of the filename...
    if ( trashId == 0 ) // home trash: absolute path
        info += KURL::encode_string( origPath, m_mibEnum ).latin1();
    else
        info += KURL::encode_string( makeRelativePath( topDirectoryPath( trashId ), origPath ), m_mibEnum ).latin1();
    info += "\n";
    info += "DeletionDate=";
    info += TQDateTime::currentDateTime().toString( Qt::ISODate ).latin1();
    info += "\n";
    size_t sz = info.size() - 1; // avoid trailing 0 from QCString

    size_t written = ::fwrite(info.data(), 1, sz, file);
    if ( written != sz ) {
        ::fclose( file );
        TQFile::remove( infoPath );
        error( TDEIO::ERR_DISK_FULL, infoPath );
        return false;
    }

    ::fclose( file );

    kdDebug() << k_funcinfo << "info file created in trashId=" << trashId << " : " << fileId << endl;
    return true;
}
Ejemplo n.º 12
0
/**
 * Loads notify events from a file.  Clearing data if clear is True.
 */
void SpeechData::loadNotifyEventsFromFile( const QString& filename, bool clear)
{
    // Open existing event list.
    QFile file( filename );
    if ( !file.open( IO_ReadOnly ) )
    {
        kdDebug() << "SpeechData::loadNotifyEventsFromFile: Unable to open file " << filename << endl;
    }
    // QDomDocument doc( "http://www.kde.org/share/apps/kttsd/stringreplacer/wordlist.dtd []" );
    QDomDocument doc( "" );
    if ( !doc.setContent( &file ) ) {
        file.close();
        kdDebug() << "SpeechData::loadNotifyEventsFromFile: File not in proper XML format. " << filename << endl;
    }
    // kdDebug() << "StringReplacerConf::load: document successfully parsed." << endl;
    file.close();

    if ( clear )
    {
        notifyDefaultPresent = NotifyPresent::Passive;
        notifyDefaultOptions.action = NotifyAction::SpeakMsg;
        notifyDefaultOptions.talker = QString::null;
        notifyDefaultOptions.customMsg = QString::null;
        notifyAppMap.clear();
    }

    // Event list.
    QDomNodeList eventList = doc.elementsByTagName("notifyEvent");
    const int eventListCount = eventList.count();
    for (int eventIndex = 0; eventIndex < eventListCount; ++eventIndex)
    {
        QDomNode eventNode = eventList.item(eventIndex);
        QDomNodeList propList = eventNode.childNodes();
        QString eventSrc;
        QString event;
        QString actionName;
        QString message;
        TalkerCode talkerCode;
        const int propListCount = propList.count();
        for (int propIndex = 0; propIndex < propListCount; ++propIndex)
        {
            QDomNode propNode = propList.item(propIndex);
            QDomElement prop = propNode.toElement();
            if (prop.tagName() == "eventSrc") eventSrc = prop.text();
            if (prop.tagName() == "event") event = prop.text();
            if (prop.tagName() == "action") actionName = prop.text();
            if (prop.tagName() == "message") message = prop.text();
            if (prop.tagName() == "talker") talkerCode = TalkerCode(prop.text(), false);
        }
        NotifyOptions notifyOptions;
        notifyOptions.action = NotifyAction::action( actionName );
        notifyOptions.talker = talkerCode.getTalkerCode();
        notifyOptions.customMsg = message;
        if ( eventSrc != "default" )
        {
            notifyOptions.eventName = NotifyEvent::getEventName( eventSrc, event );
            NotifyEventMap notifyEventMap = notifyAppMap[ eventSrc ];
            notifyEventMap[ event ] = notifyOptions;
            notifyAppMap[ eventSrc ] = notifyEventMap;
        } else {
            notifyOptions.eventName = QString::null;
            notifyDefaultPresent = NotifyPresent::present( event );
            notifyDefaultOptions = notifyOptions;
        }
    }
}
Ejemplo n.º 13
0
bool kpFloodFill::fill ()
{
    if (m_initState < 2 && !prepare ())
    {
        kdError () << "kpFloodFill:fill() could not prepare()!" << endl;
        return false;
    }

    // not trying to do a NOP fill
    if (m_boundingRect.isValid ())
    {
        QApplication::setOverrideCursor (Qt::waitCursor);

        QPainter painter, maskPainter;
        QBitmap maskBitmap;

        if (m_pixmapPtr->mask () || m_color.isTransparent ())
        {
            maskBitmap = kpPixmapFX::getNonNullMask (*m_pixmapPtr);
            maskPainter.begin (&maskBitmap);
            maskPainter.setPen (m_color.maskColor ());
        }

        if (m_color.isOpaque ())
        {
            painter.begin (m_pixmapPtr);
            painter.setPen (m_color.toQColor ());
        }

        const QValueList <FillLine>::ConstIterator fillLinesEnd = m_fillLines.end ();
        for (QValueList <FillLine>::ConstIterator it = m_fillLines.begin ();
             it != fillLinesEnd;
             it++)
        {
            QPoint p1 = QPoint ((*it).m_x1, (*it).m_y);
            QPoint p2 = QPoint ((*it).m_x2, (*it).m_y);

            if (painter.isActive ())
                painter.drawLine (p1, p2);

            if (maskPainter.isActive ())
                maskPainter.drawLine (p1, p2);
        }

        if (painter.isActive ())
            painter.end ();

        if (maskPainter.isActive ())
            maskPainter.end ();

        if (!maskBitmap.isNull ())
            m_pixmapPtr->setMask (maskBitmap);

        QApplication::restoreOverrideCursor ();
    }
    else
    {
    #if DEBUG_KP_FLOOD_FILL && 1
        kdDebug () << "kpFloodFill::fill() performing NOP fill" << endl;
    #endif
    }

    return true;
}
Ejemplo n.º 14
0
bool kpFloodFill::prepare ()
{
#if DEBUG_KP_FLOOD_FILL && 1
    kdDebug () << "kpFloodFill::prepare()" << endl;
#endif
    m_boundingRect = QRect ();

    if (m_initState < 1 && !prepareColorToChange ())
    {
        kdError () << "kpFloodFill:prepare() could not prepareColorToChange()!" << endl;
        return false;
    }

#if DEBUG_KP_FLOOD_FILL && 1
    kdDebug () << "\tperforming NOP check" << endl;
#endif

    // get the color we need to replace
    if (m_processedColorSimilarity == 0 && m_color == m_colorToChange)
    {
        // need to do absolutely nothing (this is a significant optimisation
        // for people who randomly click a lot over already-filled areas)
        m_initState = 2;  // sync with all "return true"'s
        return true;
    }

#if DEBUG_KP_FLOOD_FILL && 1
    kdDebug () << "\tconverting to image" << endl;
#endif

    // is this the only way to read pixels?
    m_image = kpPixmapFX::convertToImage (*m_pixmapPtr);
    if (m_image.isNull ())
    {
        kdError () << "kpFloodFill::prepare() could not convert to QImage" << endl;
        return false;
    }

#if DEBUG_KP_FLOOD_FILL && 1
    kdDebug () << "\tcreating fillLinesCache" << endl;
#endif

    // ready cache
    m_fillLinesCache.resize (m_pixmapPtr->height ());

#if DEBUG_KP_FLOOD_FILL && 1
    kdDebug () << "\tcreating fill lines" << endl;
#endif

    // draw initial line
    addLine (m_y, findMinX (m_y, m_x), findMaxX (m_y, m_x));

    for (QValueList <FillLine>::ConstIterator it = m_fillLines.begin ();
         it != m_fillLines.end ();
         it++)
    {
    #if DEBUG_KP_FLOOD_FILL && 0
        kdDebug () << "Expanding from y=" << (*it).m_y
                   << " x1=" << (*it).m_x1
                   << " x2=" << (*it).m_x2
                   << endl;
    #endif

        // make more lines above and below current line
        findAndAddLines (*it, -1);
        findAndAddLines (*it, +1);
    }

#if DEBUG_KP_FLOOD_FILL && 1
    kdDebug () << "\tfinalising memory usage" << endl;
#endif

    // finalize memory usage
    m_image.reset ();
    m_fillLinesCache.clear ();

    m_initState = 2;  // sync with all "return true"'s
    return true;
}
Ejemplo n.º 15
0
void KompareProcess::writeCommandLine()
{
	// load the executable into the KProcess
	if ( m_diffSettings->m_diffProgram.isEmpty() )
	{
		kdDebug(8101) << "Using the first diff in the path..." << endl;
		*this << "diff";
	}
	else
	{
		kdDebug(8101) << "Using a user specified diff, namely: " << m_diffSettings->m_diffProgram << endl;
		*this << m_diffSettings->m_diffProgram;
	}

	switch( m_diffSettings->m_format ) {
	case Kompare::Unified :
		*this << "-U" << QString::number( m_diffSettings->m_linesOfContext );
		break;
	case Kompare::Context :
		*this << "-C" << QString::number( m_diffSettings->m_linesOfContext );
		break;
	case Kompare::RCS :
		*this << "-n";
		break;
	case Kompare::Ed :
		*this << "-e";
		break;
	case Kompare::SideBySide:
		*this << "-y";
		break;
	case Kompare::Normal :
	case Kompare::UnknownFormat :
	default:
		break;
	}

	if ( m_diffSettings->m_largeFiles )
	{
		*this << "-H";
	}

	if ( m_diffSettings->m_ignoreWhiteSpace )
	{
		*this << "-b";
	}

	if ( m_diffSettings->m_ignoreAllWhiteSpace )
	{
		*this << "-w";
	}

	if ( m_diffSettings->m_ignoreEmptyLines )
	{
		*this << "-B";
	}

	if ( m_diffSettings->m_ignoreChangesDueToTabExpansion )
	{
		*this << "-E";
	}

	if ( m_diffSettings->m_createSmallerDiff )
	{
		*this << "-d";
	}

	if ( m_diffSettings->m_ignoreChangesInCase )
	{
		*this << "-i";
	}

	if ( m_diffSettings->m_ignoreRegExp && !m_diffSettings->m_ignoreRegExpText.isEmpty() )
	{
		*this << "-I " << KProcess::quote( m_diffSettings->m_ignoreRegExpText );
	}

	if ( m_diffSettings->m_showCFunctionChange )
	{
		*this << "-p";
	}

	if ( m_diffSettings->m_convertTabsToSpaces )
	{
		*this << "-t";
	}

	if ( m_diffSettings->m_recursive )
	{
		*this << "-r";
	}

	if ( m_diffSettings->m_newFiles )
	{
		*this << "-N";
	}

// This option is more trouble than it is worth... please do not ever enable it unless you want really weird crashes
//	if ( m_diffSettings->m_allText )
//	{
//		*this << "-a";
//	}

	if ( m_diffSettings->m_excludeFilePattern )
	{
		QStringList::ConstIterator it = m_diffSettings->m_excludeFilePatternList.begin();
		QStringList::ConstIterator end = m_diffSettings->m_excludeFilePatternList.end();
		for ( ; it != end; ++it )
		{
			*this << "-x" << KProcess::quote( *it );
		}
	}

	if ( m_diffSettings->m_excludeFilesFile && !m_diffSettings->m_excludeFilesFileURL.isEmpty() )
	{
		*this << "-X" << KProcess::quote( m_diffSettings->m_excludeFilesFileURL );
	}
}
Ejemplo n.º 16
0
 void resizeEvent(QResizeEvent*)
 {
     kdDebug() << this << endl;
 }
Ejemplo n.º 17
0
TestNSPlugin::~TestNSPlugin()
{
   kdDebug() << "-> TestNSPlugin::~TestNSPlugin" << endl;
   m_loader->release();
   kdDebug() << "<- TestNSPlugin::~TestNSPlugin" << endl;
}
Ejemplo n.º 18
0
KDE_NO_CDTOR_EXPORT KlashPart::~KlashPart () {
    kdDebug() << "KlashPart::~KlashPart" << endl;
    stop ();
    //delete m_config;
    //m_config = 0L;
}
Ejemplo n.º 19
0
 virtual void processAssignment( QMake::AssignmentAST* a)
 {
     kdDebug(9024) << getIndent() << "Assignment(" << replaceWs(a->indent) << "):" << replaceWs(a->scopedID) << " " << replaceWs(a->op) << " " << replaceWs(a->values.join("|")) << endl;
     QMake::ASTVisitor::processAssignment(a);
 }
Ejemplo n.º 20
0
KDE_NO_EXPORT bool KlashPart::openUrl (const KUrl & url) {
    kdDebug () << "KlashPart::openUrl " << url.url() << endl;
    emit started (0);
    return KParts::ReadOnlyPart::openUrl (url);
}
Ejemplo n.º 21
0
 virtual void processComment( QMake::CommentAST* a)
 {
     kdDebug(9024) << getIndent() << "Comment: " << replaceWs(a->comment) << endl;
     QMake::ASTVisitor::processComment(a);
 }
Ejemplo n.º 22
0
KDE_NO_EXPORT bool KlashLiveConnectExtension::call
  (const unsigned long id, const QString & name,
   const QStringList & args, KParts::LiveConnectExtension::Type & type,
   unsigned long & rid, QString & rval) {
    const JSCommandEntry * entry = lastJSCommandEntry;
    const char * str = name.toAscii ();
    if (!entry || strcmp (entry->name, str))
        entry = getJSCommandEntry (str);
    if (!entry)
        return false;
    kdDebug () << "entry " << entry->name << endl;
    for (unsigned int i = 0; i < args.size (); ++i) {
        kdDebug () << "      " << args[i] << endl;
    }
    //Klash::View * view = static_cast <Klash::View*> (player->widget ());
    //if (!view)
    //    return false;
    rid = id;
    type = entry->rettype;
    switch (entry->command) {
        case notsupported:
            if (entry->rettype != KParts::LiveConnectExtension::TypeVoid)
                rval = entry->defaultvalue;
            break;
        case play:
            if (args.size ()) {
                KUrl url (args.first ());
                if (player->allowRedir (url)) {
                    ;//player->openNewUrl (url);
                }
            } else
                player->play ();
            rval = "true";
            break;
        case start:
            player->play ();
            rval = "true";
            break;
        case stop:
            player->stop ();
            rval = "true";
            break;
        case jsc_pause:
            player->pause ();
            rval = "true";
            break;
        case length:
            rval.setNum (0 /*player->source ()->length ()*/);
            break;
        case width:
            rval.setNum (player->width ());
            break;
        case height:
            rval.setNum (player->height ());
            break;
        case setsource:
            rval ="false";
            if (args.size ()) {
                KUrl url (args.first ());
                if (player->allowRedir (url) && player->openUrl (url))
                    rval = "true";
            }
            break;
        case setvolume:
            if (!args.size ())
                return false;
            //?? (args.first ().toInt ());
            rval = "true";
            break;
        case source:
            rval = player->url ().url ();
            break;
        case volume:
            if (player->widget ())
                rval = QString::number (0);
            break;
        default:
            return false;
    }
    return true;
}
Ejemplo n.º 23
0
 virtual void enterRealProject( QMake::ProjectAST* p )
 {
     kdDebug(9024) << getIndent() << "--------- Entering Project: " << replaceWs(p->fileName()) << "| LineEnding:" << p->lineEnding() << " --------------" << endl;
     indent += 4;
     QMake::ASTVisitor::enterRealProject(p);
 }
Ejemplo n.º 24
0
/**************************************************************************
  * pops up and asks for mount/umount right-clicked device
**/
void KDFWidget::popupMenu( TQListViewItem *item, const TQPoint &p )
{
  if (mPopup) //The user may even be able to popup another menu while this open is active...
       return;

  //
  // The list update will be disabled as long as this menu is
  // visible. Reason: The 'disk' may no longer be valid.
  //

  mDiskList.setUpdatesDisabled(true);  
  DiskEntry *disk = selectedDisk( item );
  if( disk == 0 )
  {
    return;
  }

  mPopup = new TDEPopupMenu( 0 );
  mPopup->insertTitle( disk->mountPoint() );
  mPopup->insertItem( i18n("Mount Device"), 0 );
  mPopup->insertItem( i18n("Unmount Device"), 1 );
  mPopup->insertSeparator();
  mPopup->insertItem( i18n("Open in File Manager"), 2 );
  mPopup->setItemEnabled( 0, disk->mounted() ? false : true );
  mPopup->setItemEnabled( 1, disk->mounted() );
  mPopup->setItemEnabled( 2, disk->mounted() );  
  int position = mPopup->exec( p );  
  


  bool openFileManager = false;
  if( position == -1 )
  {
    mDiskList.setUpdatesDisabled(false);
    delete mPopup; mPopup = 0;
    return;
  }
  else if( position == 0 || position == 1 )
  {
      item->setText( sizeCol, i18n("MOUNTING") );
      item->setText( freeCol, i18n("MOUNTING") );
      item->setPixmap( 0, mList->icon( "mini-clock", false ) );

      int val = disk->toggleMount();
      if( val != 0 /*== false*/ )
	{
	  KMessageBox::error( this, disk->lastSysError() );
	}
      else if ( ( mStd.openFileManager() == true)
		&& (position == 0) ) //only on mount
	{
	  openFileManager = true;
	}

      delete item;
      mDiskList.deleteAllMountedAt(disk->mountPoint());
  }
  else if( position == 2 )
  {
    openFileManager = true;
  }

  if( openFileManager == true )
  {
    kdDebug() << "opening filemanager" << endl;
    if(  mStd.fileManager().isEmpty() == false )
    {
      TQString cmd = mStd.fileManager();
      int pos = cmd.find("%m");
      if( pos > 0 )
      {
	cmd = cmd.replace( pos, 2, TDEProcess::quote(disk->mountPoint()) ) + " &";
      }
      else
      {
	cmd += " " + TDEProcess::quote(disk->mountPoint()) +" &";
      }
      system( TQFile::encodeName(cmd) );
    }
  }
  
  //Update only here as showing of error message triggers event loop.
  mDiskList.setUpdatesDisabled(false);
  delete mPopup; mPopup = 0;

  if( position != 2 ) // No need to update when just opening the fm.
  {
    updateDF();
  }
  
}
Ejemplo n.º 25
0
 virtual void enterFunctionScope( QMake::ProjectAST* p )
 {
     kdDebug(9024) << getIndent() << "--------- Entering FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
     indent += 4;
     QMake::ASTVisitor::enterFunctionScope(p);
 }
Ejemplo n.º 26
0
//--------------------------------------------------------------------------
// Parse the marker stream until SOS or EOI is seen;
//--------------------------------------------------------------------------
int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
{
    int a;

    a = infile.getch();

    if (a != 0xff || infile.getch() != M_SOI) {
        SectionsRead = 0;
        return false;
    }
    for(SectionsRead = 0; SectionsRead < MAX_SECTIONS-1; ) {
        int marker = 0;
        int got;
        unsigned int ll,lh;
        unsigned int itemlen;
        uchar * Data;

        for (a=0; a<7; a++) {
            marker = infile.getch();
            if (marker != 0xff) break;

            if (a >= 6) {

                kdDebug(7034) << "too many padding bytes\n";
                return false;

            }
        }

        if (marker == 0xff) {
            // 0xff is legal padding, but if we get that many, something's wrong.
            throw FatalError("too many padding bytes!");
        }

        Sections[SectionsRead].Type = marker;

        // Read the length of the section.
        lh = (uchar) infile.getch();
        ll = (uchar) infile.getch();

        itemlen = (lh << 8) | ll;

        if (itemlen < 2) {
            throw FatalError("invalid marker");
        }

        Sections[SectionsRead].Size = itemlen;

        Data = (uchar *)malloc(itemlen+1); // Add 1 to allow sticking a 0 at the end.
        Sections[SectionsRead].Data = Data;

        // Store first two pre-read bytes.
        Data[0] = (uchar)lh;
        Data[1] = (uchar)ll;

        got = infile.readBlock((char*)Data+2, itemlen-2); // Read the whole section.
        if (( unsigned ) got != itemlen-2) {
            throw FatalError("reading from file");
        }
        SectionsRead++;

        switch(marker) {

        case M_SOS:   // stop before hitting compressed data
            // If reading entire image is requested, read the rest of the data.
            if (ReadMode & READ_IMAGE) {
                unsigned long size;

                size = kMax( 0ul, infile.size()-infile.at() );
                Data = (uchar *)malloc(size);
                if (Data == NULL) {
                    throw FatalError("could not allocate data for entire image");
                }

                got = infile.readBlock((char*)Data,  size);
                if (( unsigned ) got != size) {
                    throw FatalError("could not read the rest of the image");
                }

                Sections[SectionsRead].Data = Data;
                Sections[SectionsRead].Size = size;
                Sections[SectionsRead].Type = PSEUDO_IMAGE_MARKER;
                SectionsRead ++;
                //HaveAll = 1;
            }
            return true;

        case M_EOI:   // in case it's a tables-only JPEG stream
            kdDebug(7034) << "No image in jpeg!\n";
            return false;

        case M_COM: // Comment section
            // pieczy 2002-02-12
            // now the User comment goes to UserComment
            // so we can store a Comment section also in READ_EXIF mode
            process_COM(Data, itemlen);
            break;

        case M_JFIF:
            // Regular jpegs always have this tag, exif images have the exif
            // marker instead, althogh ACDsee will write images with both markers.
            // this program will re-create this marker on absence of exif marker.
            // hence no need to keep the copy from the file.
            free(Sections[--SectionsRead].Data);
            break;

        case M_EXIF:
            // Seen files from some 'U-lead' software with Vivitar scanner
            // that uses marker 31 for non exif stuff.  Thus make sure
            // it says 'Exif' in the section before treating it as exif.
            if ((ReadMode & READ_EXIF) && memcmp(Data+2, "Exif", 4) == 0) {
                process_EXIF((uchar *)Data, itemlen); // FIXME: This call
                // requires Data to be array of at least 8 bytes. Code
                // above only checks for itemlen < 2.
            } else {
                // Discard this section.
                free(Sections[--SectionsRead].Data);
            }
            break;

        case M_SOF0:
        case M_SOF1:
        case M_SOF2:
        case M_SOF3:
        case M_SOF5:
        case M_SOF6:
        case M_SOF7:
        case M_SOF9:
        case M_SOF10:
        case M_SOF11:
        case M_SOF13:
        case M_SOF14:
        case M_SOF15:
            process_SOFn(Data, marker); //FIXME: This call requires Data to
            // be array of at least 8 bytes. Code above only checks for
            // itemlen < 2.
            break;
        default:
            break;
        }
    }
    return true;
}
Ejemplo n.º 27
0
void FX_SetupImpl::slotReload()
{
    kdDebug() << "FX_SetupImpl::slotReload()" << endl;
    
    Init(pluginlist);
}
Ejemplo n.º 28
0
//--------------------------------------------------------------------------
// Process one of the nested EXIF directories.
//--------------------------------------------------------------------------
void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength, unsigned NestingLevel)
{
    int de;
    int a;
    int NumDirEntries;
    unsigned ThumbnailOffset = 0;
    unsigned ThumbnailSize = 0;

    if ( NestingLevel > 4)
        throw FatalError("Maximum directory nesting exceeded (corrupt exif header)");

    NumDirEntries = Get16u(DirStart);
#define DIR_ENTRY_ADDR(Start, Entry) (Start+2+12*(Entry))

    {
        unsigned char * DirEnd;
        DirEnd = DIR_ENTRY_ADDR(DirStart, NumDirEntries);
        if (DirEnd+4 > (OffsetBase+ExifLength)) {
            if (DirEnd+2 == OffsetBase+ExifLength || DirEnd == OffsetBase+ExifLength) {
                // Version 1.3 of jhead would truncate a bit too much.
                // This also caught later on as well.
            } else {
                // Note: Files that had thumbnails trimmed with jhead 1.3 or earlier
                // might trigger this.
                throw FatalError("Illegally sized directory");
            }
        }
        if (DirEnd < LastExifRefd) LastExifRefd = DirEnd;
    }

    for (de=0; de<NumDirEntries; de++) {
        int Tag, Format, Components;
        unsigned char * ValuePtr;
        unsigned ByteCount;
        char * DirEntry;
        DirEntry = (char *)DIR_ENTRY_ADDR(DirStart, de);

        Tag = Get16u(DirEntry);
        Format = Get16u(DirEntry+2);
        Components = Get32u(DirEntry+4);

        if ((Format-1) >= NUM_FORMATS) {
            // (-1) catches illegal zero case as unsigned underflows to positive large.
            throw FatalError("Illegal format code in EXIF dir");
        }

        if ((unsigned)Components > 0x10000) {
            throw FatalError("Illegal number of components for tag");
            continue;
        }

        ByteCount = Components * BytesPerFormat[Format];

        if (ByteCount > 4) {
            unsigned OffsetVal;
            OffsetVal = Get32u(DirEntry+8);
            // If its bigger than 4 bytes, the dir entry contains an offset.
            if (OffsetVal+ByteCount > ExifLength) {
                // Bogus pointer offset and / or bytecount value
                //printf("Offset %d bytes %d ExifLen %d\n",OffsetVal, ByteCount, ExifLength);

                throw FatalError("Illegal pointer offset value in EXIF");
            }
            ValuePtr = OffsetBase+OffsetVal;
        } else {
            // 4 bytes or less and value is in the dir entry itself
            ValuePtr = (unsigned char *)DirEntry+8;
        }

        if (LastExifRefd < ValuePtr+ByteCount) {
            // Keep track of last byte in the exif header that was actually referenced.
            // That way, we know where the discardable thumbnail data begins.
            LastExifRefd = ValuePtr+ByteCount;
        }

        // Extract useful components of tag
        switch(Tag) {

        case TAG_MAKE:
            ExifData::CameraMake = QString::fromLatin1((const char*)ValuePtr, 31);
            break;

        case TAG_MODEL:
            ExifData::CameraModel = QString::fromLatin1((const char*)ValuePtr, 39);
            break;

        case TAG_ORIENTATION:
            Orientation = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_DATETIME_ORIGINAL:
            DateTime = QString::fromLatin1((const char*)ValuePtr, 19);
            break;

        case TAG_USERCOMMENT:
            // Olympus has this padded with trailing spaces.  Remove these first.
            for (a=ByteCount;;) {
                a--;
                if ((ValuePtr)[a] == ' ') {
                    (ValuePtr)[a] = '\0';
                } else {
                    break;
                }
                if (a == 0) break;
            }

            // Copy the comment
            if (memcmp(ValuePtr, "ASCII",5) == 0) {
                for (a=5; a<10; a++) {
                    int c;
                    c = (ValuePtr)[a];
                    if (c != '\0' && c != ' ') {
                        UserComment = QString::fromLatin1((const char*)(a+ValuePtr), 199);
                        break;
                    }
                }
            } else {
                UserComment = QString::fromLatin1((const char*)ValuePtr, 199);
            }
            break;

        case TAG_FNUMBER:
            // Simplest way of expressing aperture, so I trust it the most.
            // (overwrite previously computd value if there is one)
            ExifData::ApertureFNumber = (float)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_APERTURE:
        case TAG_MAXAPERTURE:
            // More relevant info always comes earlier, so only use this field if we don't
            // have appropriate aperture information yet.
            if (ExifData::ApertureFNumber == 0) {
                ExifData::ApertureFNumber
                    = (float)exp(ConvertAnyFormat(ValuePtr, Format)*log(2.0)*0.5);
            }
            break;

        case TAG_FOCALLENGTH:
            // Nice digital cameras actually save the focal length as a function
            // of how far they are zoomed in.
            ExifData::FocalLength = (float)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_SUBJECT_DISTANCE:
            // Inidcates the distacne the autofocus camera is focused to.
            // Tends to be less accurate as distance increases.
            ExifData::Distance = (float)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_EXPOSURETIME:
            // Simplest way of expressing exposure time, so I trust it most.
            // (overwrite previously computd value if there is one)
            ExifData::ExposureTime = (float)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_SHUTTERSPEED:
            // More complicated way of expressing exposure time, so only use
            // this value if we don't already have it from somewhere else.
            if (ExifData::ExposureTime == 0) {
                ExifData::ExposureTime
                    = (float)(1/exp(ConvertAnyFormat(ValuePtr, Format)*log(2.0)));
            }
            break;

        case TAG_FLASH:
            ExifData::FlashUsed = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_EXIF_IMAGELENGTH:
            ExifImageLength = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_EXIF_IMAGEWIDTH:
            ExifImageWidth = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_FOCALPLANEXRES:
            FocalplaneXRes = ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_FOCALPLANEUNITS:
            switch((int)ConvertAnyFormat(ValuePtr, Format)) {
            case 1:
                FocalplaneUnits = 25.4;
                break; // inch
            case 2:
                // According to the information I was using, 2 means meters.
                // But looking at the Cannon powershot's files, inches is the only
                // sensible value.
                FocalplaneUnits = 25.4;
                break;

            case 3:
                FocalplaneUnits = 10;
                break;  // centimeter
            case 4:
                FocalplaneUnits = 1;
                break;  // milimeter
            case 5:
                FocalplaneUnits = .001;
                break;  // micrometer
            }
            break;

        // Remaining cases contributed by: Volker C. Schoech ([email protected])

        case TAG_EXPOSURE_BIAS:
            ExifData::ExposureBias = (float)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_WHITEBALANCE:
            ExifData::Whitebalance = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_METERING_MODE:
            ExifData::MeteringMode = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_EXPOSURE_PROGRAM:
            ExifData::ExposureProgram = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_ISO_EQUIVALENT:
            ExifData::ISOequivalent = (int)ConvertAnyFormat(ValuePtr, Format);
            if ( ExifData::ISOequivalent < 50 ) ExifData::ISOequivalent *= 200;
            break;

        case TAG_COMPRESSION_LEVEL:
            ExifData::CompressionLevel = (int)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_THUMBNAIL_OFFSET:
            ThumbnailOffset = (unsigned)ConvertAnyFormat(ValuePtr, Format);
            break;

        case TAG_THUMBNAIL_LENGTH:
            ThumbnailSize = (unsigned)ConvertAnyFormat(ValuePtr, Format);
            break;

        }

        if (Tag == TAG_EXIF_OFFSET || Tag == TAG_INTEROP_OFFSET) {
            unsigned char * SubdirStart;
            SubdirStart = OffsetBase + Get32u(ValuePtr);
            if (SubdirStart <= OffsetBase || SubdirStart >= OffsetBase+ExifLength) {
                throw FatalError("Illegal subdirectory link");
            }
            ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
            continue;
        }
    }

    {
        // In addition to linking to subdirectories via exif tags,
        // there's also a potential link to another directory at the end of each
        // directory.  this has got to be the result of a comitee!
        unsigned char * SubdirStart;
        unsigned Offset;

        if (DIR_ENTRY_ADDR(DirStart, NumDirEntries) + 4 <= OffsetBase+ExifLength) {
            Offset = Get32u(DIR_ENTRY_ADDR(DirStart, NumDirEntries));
            // There is at least one jpeg from an HP camera having an Offset of almost MAXUINT.
            // Adding OffsetBase to it produces an overflow, so compare with ExifLength here.
            // See http://bugs.kde.org/show_bug.cgi?id=54542
            if (Offset && Offset < ExifLength) {
                SubdirStart = OffsetBase + Offset;
                if (SubdirStart > OffsetBase+ExifLength) {
                    if (SubdirStart < OffsetBase+ExifLength+20) {
                        // Jhead 1.3 or earlier would crop the whole directory!
                        // As Jhead produces this form of format incorrectness,
                        // I'll just let it pass silently
                        kdDebug(7034) << "Thumbnail removed with Jhead 1.3 or earlier\n";
                    } else {
                        throw FatalError("Illegal subdirectory link 2");
                    }
                } else {
                    if (SubdirStart <= OffsetBase+ExifLength) {
                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
                    }
                }
            }
        } else {
            // The exif header ends before the last next directory pointer.
        }
    }

    if (ThumbnailSize && ThumbnailOffset) {
        if (ThumbnailSize + ThumbnailOffset < ExifLength) {
            // The thumbnail pointer appears to be valid.  Store it.
            Thumbnail.loadFromData(OffsetBase + ThumbnailOffset, ThumbnailSize, "JPEG");
        }
    }
}
Ejemplo n.º 29
0
void KRecConfigGeneral::enableallmessagesclicked() {
kdDebug(60005) << k_funcinfo << endl;
	KMessageBox::enableAllMessages();
}
Ejemplo n.º 30
0
KJavaAppletViewer::KJavaAppletViewer(QWidget *wparent, const char *, QObject *parent, const char *name, const QStringList &args)
    : KParts::ReadOnlyPart(parent, name)
    , m_browserextension(new KJavaAppletViewerBrowserExtension(this))
    , m_liveconnect(new KJavaAppletViewerLiveConnectExtension(this))
    , m_statusbar(new KParts::StatusBarExtension(this))
    , m_statusbar_icon(0L)
    , m_closed(true)
{
    if(!serverMaintainer)
    {
        serverMaintainerDeleter.setObject(serverMaintainer, new KJavaServerMaintainer);
    }
    m_view = new CoverWidget(wparent);
    QString classname, classid, codebase, khtml_codebase, src_param;
    int width = -1;
    int height = -1;
    KJavaApplet *const applet = m_view->appletWidget()->applet();
    QStringList::const_iterator it = args.begin();
    const QStringList::const_iterator itEnd = args.end();
    for(; it != itEnd; ++it)
    {
        const int equalPos = (*it).find("=");
        if(equalPos > 0)
        {
            const QString name = (*it).left(equalPos).upper();
            QString value = (*it).right((*it).length() - equalPos - 1);
            if(value.at(0) == '\"')
                value = value.right(value.length() - 1);
            if(value.at(value.length() - 1) == '\"')
                value.truncate(value.length() - 1);
            kdDebug(6100) << "name=" << name << " value=" << value << endl;
            if(!name.isEmpty())
            {
                const QString name_lower = name.lower();
                if(name == "__KHTML__PLUGINBASEURL")
                {
                    baseurl = KURL(KURL(value), QString(".")).url();
                }
                else if(name == "__KHTML__CODEBASE")
                    khtml_codebase = value;
                else if(name_lower == QString::fromLatin1("codebase") || name_lower == QString::fromLatin1("java_codebase"))
                {
                    if(!value.isEmpty())
                        codebase = value;
                }
                else if(name == "__KHTML__CLASSID")
                    // else if (name.lower()==QString::fromLatin1("classid"))
                    classid = value;
                else if(name_lower == QString::fromLatin1("code") || name_lower == QString::fromLatin1("java_code"))
                    classname = value;
                else if(name_lower == QString::fromLatin1("src"))
                    src_param = value;
                else if(name_lower == QString::fromLatin1("archive") || name_lower == QString::fromLatin1("java_archive")
                        || name_lower.startsWith("cache_archive"))
                    applet->setArchives(value);
                else if(name_lower == QString::fromLatin1("name"))
                    applet->setAppletName(value);
                else if(name_lower == QString::fromLatin1("width"))
                    width = value.toInt();
                else if(name_lower == QString::fromLatin1("height"))
                    height = value.toInt();
                if(!name.startsWith("__KHTML__"))
                {
                    applet->setParameter(name, value);
                }
            }
        }
    }
    if(!classid.isEmpty())
    {
        applet->setParameter("CLSID", classid);
        kdDebug(6100) << "classid=" << classid << classid.startsWith("clsid:") << endl;
        if(classid.startsWith("clsid:"))
            // codeBase contains the URL to the plugin page
            khtml_codebase = baseurl;
        else if(classname.isEmpty() && classid.startsWith("java:"))
            classname = classid.mid(5);
    }
    if(classname.isEmpty())
        classname = src_param;
    else if(!src_param.isEmpty())
        applet->setParameter(QString("SRC"), src_param);
    if(codebase.isEmpty())
        codebase = khtml_codebase;
    if(baseurl.isEmpty())
    {
        // not embeded in khtml
        QString pwd = QDir().absPath();
        if(!pwd.endsWith(QChar(QDir::separator())))
            pwd += QDir::separator();
        baseurl = KURL(KURL(pwd), codebase).url();
    }
    if(width > 0 && height > 0)
    {
        m_view->resize(width, height);
        applet->setSize(QSize(width, height));
    }
    applet->setBaseURL(baseurl);
    // check codebase first
    const KURL kbaseURL(baseurl);
    const KURL newURL(kbaseURL, codebase);
    if(kapp->authorizeURLAction("redirect", KURL(baseurl), newURL))
        applet->setCodeBase(newURL.url());
    applet->setAppletClass(classname);
    KJavaAppletContext *const cxt = serverMaintainer->getContext(parent, baseurl);
    applet->setAppletContext(cxt);

    KJavaAppletServer *const server = cxt->getServer();

    serverMaintainer->setServer(server);

    if(!server->usingKIO())
    {
        /* if this page needs authentication */
        KIO::AuthInfo info;
        QString errorMsg;
        QCString replyType;
        QByteArray params;
        QByteArray reply;
        KIO::AuthInfo authResult;

        //(void) dcopClient(); // Make sure to have a dcop client.
        info.url = baseurl;
        info.verifyPath = true;

        QDataStream stream(params, IO_WriteOnly);
        stream << info << m_view->topLevelWidget()->winId();

        if(!kapp->dcopClient()->call("kded", "kpasswdserver", "checkAuthInfo(KIO::AuthInfo, long int)", params, replyType, reply))
        {
            kdWarning() << "Can't communicate with kded_kpasswdserver!" << endl;
        }
        else if(replyType == "KIO::AuthInfo")
        {
            QDataStream stream2(reply, IO_ReadOnly);
            stream2 >> authResult;
            applet->setUser(authResult.username);
            applet->setPassword(authResult.password);
            applet->setAuthName(authResult.realmValue);
        }