Beispiel #1
0
QStringList KstDataSource::matrixListForSource(const QString& filename, const QString& type, QString *outType, bool *complete) {
  if (filename == "stdin" || filename == "-") {
    return QStringList();
  }

  QString fn = obtainFile(filename);
  if (fn.isEmpty()) {
    return QStringList();
  }

  Q3ValueList<PluginSortContainer> bestPlugins = bestPluginsForSource(fn, type);
  QStringList rc;
  
  for (Q3ValueList<PluginSortContainer>::Iterator i = bestPlugins.begin(); i != bestPlugins.end(); ++i) {
    QString typeSuggestion;
    rc = (*i).plugin->matrixList(qSettingsObject, fn, QString::null, &typeSuggestion, complete);
    if (!rc.isEmpty()) {
      if (outType) {
        if (typeSuggestion.isEmpty()) {
          *outType = (*i).plugin->provides()[0];
        } else {
          *outType = typeSuggestion;
        }
      }
      break;
    }
  }

  return rc;
}
Beispiel #2
0
void UmlOperation::write_uml_params(FileOut & out)
{
    const Q3ValueList<UmlParameter> p = params();
    Q3ValueList<UmlParameter>::ConstIterator it;

    for (it = p.begin(); it != p.end(); ++it) {
        out.indent();
        out << "<ownedParameter xmi:type=\"uml:Parameter\" name=\"" << (*it).name
            << "\" xmi:id=\"BOUML_op_param_"
            << ++param_id << "\" direction=\"";

        if (_pk_prefix)
            out << "pk_";

        switch ((*it).dir) {
        case InputOutputDirection:
            out << "inout\">\n";
            break;

        case OutputDirection:
            out << "out\">\n";
            break;

        default:
            out << "in\">\n";
        }

        out.indent(+1);
        UmlItem::write_type(out, (*it).type);
        out.indent(-1);

        out.indent();
        out << "</ownedParameter>\n";
    }
}
Beispiel #3
0
void UmlClass::get_template_prefixes(Q3CString & template1,
				     Q3CString & template2) {
  Q3ValueList<UmlFormalParameter> formals = this->formals();
  
  if (!formals.isEmpty()) {
    Q3ValueList<UmlFormalParameter>::ConstIterator it;
    const char * sep1 = "template<";
    const char * sep2 = "<";
    
    for (it = formals.begin(); it != formals.end(); ++it) {
      const UmlFormalParameter & f = *it;
      
      template1 += sep1;
      template1 += f.type();
      template1 += " ";
      template1 += f.name();
      
      template2 += sep2;
      template2 += f.name();
      
      sep1 = sep2 = ", ";
    }
    
    template1 += ">\n";
    template2 += ">";
  }
}
Beispiel #4
0
void WSWindow::slotUploadButton()
{

  KIPI::ImageCollection ic;

  if (widget->addToAlbum->isChecked())
    {
      ic = interface->currentSelection();
      service->startUpload(ic, widget->album->currentItem());
      }

    if (widget->uploadAlbums->isChecked())
      {
	ic = interface->currentAlbum();

	Q3ValueList<KIPI::ImageCollection> toUpload;
	toUpload.append(ic);
		
	service->startUpload(toUpload);
      }

    if (widget->uploadAllAlbums->isChecked())
      service->startUpload(interface->allAlbums());
      
}
void UserWnd::modeChanged()
{
    if (CorePlugin::m_plugin->getContainerMode()){
        if (m_view == NULL)
            m_view = new MsgView(m_splitter, m_id);
        m_splitter->moveToFirst(m_view);
        m_splitter->setResizeMode(m_edit, QSplitter::KeepSize);
        m_view->show();
        int editHeight = getEditHeight();
        if (editHeight == 0)
            editHeight = CorePlugin::m_plugin->getEditHeight();
        if (editHeight){
            Q3ValueList<int> s;
            s.append(1);
            s.append(editHeight);
            m_bResize = true;
            m_splitter->setSizes(s);
            m_bResize = false;
        }
    }else{
        if (m_view){
            delete m_view;
            m_view = NULL;
        }
    }
}
Beispiel #6
0
void UmlClass::generate_formals(QTextOStream & f) {
  Q3ValueList<UmlFormalParameter> fs = formals();
  
  if (! fs.isEmpty()) {
    Q3ValueList<UmlFormalParameter>::Iterator it;
    const char * sep = "<";
    
    for (it = fs.begin(); it != fs.end(); it++) {
      UmlFormalParameter & p = *it;
      
      f << sep;
      sep = ", ";
      f << p.name();
      
      const UmlTypeSpec & t = p.extend();
      
      if (t.type != 0) {
	f << " extends ";
	t.type->write(f);
      }
      else if (! t.explicit_type.isEmpty())
	f << " extends " << JavaSettings::type(t.explicit_type);
    }
    
    f << ">";
  }
}
/*!
 * Delets current element or group (with subgroups).
 * \param item (in) - deleted element or group item.
 */
void CatalogForm::del_item( Q3ListViewItem * item )
{
   // cat->groupSelect(getGroupId(item));
	qulonglong id = getElementId(item);
	if(id)
	{
		cat->select(id);
		if(cat->First())
		{
			cat->delElement();
			map_el.remove(id);
			delete item;
			item = 0;
		}
	}
	else
	{
		id = getGroupId(item);
		if(id)
		{
			Q3ValueList<qulonglong> listDeletedId;
			cat->delGroup(id, listDeletedId);
			Q3ValueList<qulonglong>::iterator it = listDeletedId.begin();
			while(it!= listDeletedId.end())
			{
				if(map_el.contains(*it)) map_el.remove(*it);
				else  if(map_gr.contains(*it)) map_gr.remove(*it);
				++it;
			}
			delete item; // destructor delete all subitems
			item = 0;
		}
	}
}
void tst_Q3ValueList::append()
{
    Q3ValueList<int> list;
    Q3ValueList<int>::Iterator it = list.append(1);
    QVERIFY(*it == 1);
    it = list.append(2);
    QVERIFY(*it == 2);
}
Beispiel #9
0
void UmlRelation::generate_implements(const char *& sep, QTextOStream & f,
                                      const Q3ValueList<UmlActualParameter> & actuals,
                                      const Q3CString & cl_stereotype) {
    switch (relationKind()) {
    default:
        return;
    case aGeneralisation:
    case aRealization:
        if (javaDecl().isEmpty())
            return;

        UmlClass * role_type = roleType();
        const Q3CString & other_stereotype = role_type->java_stereotype();

        if ((other_stereotype == "interface") || (other_stereotype == "@interface")) {
            if ((cl_stereotype == "union") || (cl_stereotype == "enum_pattern")) {
                write_trace_header();
                UmlCom::trace(Q3CString("&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"red\"><b>an <i>")
                              + cl_stereotype + "</i> cannot inherits</b></font><br>");
                incr_warning();
            }
            else {
                f << sep;
                sep = ", ";

                const char * p = javaDecl();

                while (*p) {
                    if (!strncmp(p, "${type}", 7)) {
                        role_type->write(f);
                        p += 7;

                        if (!actuals.isEmpty()) {
                            Q3ValueList<UmlActualParameter>::ConstIterator ita;
                            bool used = FALSE;

                            for (ita = actuals.begin(); ita != actuals.end(); ++ita) {
                                if ((*ita).superClass() == role_type) {
                                    used = TRUE;
                                    (*ita).generate(f);
                                }
                            }

                            if (used) {
                                f << ">";
                            }
                        }
                    }
                    else if (*p == '@')
                        manage_alias(p, f);
                    else
                        f << *p++;
                }
            }
        }
    }
}
void tst_Q3ValueList::clear()
{
    Q3ValueList<int> a;
    a.append( 1 );
    a.append( 2 );
    a.append( 3 );
    a.clear();
    QVERIFY( a.isEmpty() );
}
void tst_Q3ValueList::opStreamOut()
{
    Q3ValueList<int> a;
    a.append( 1 );
    a.append( 10 );
    a.append( 100 );

    a << 1000 << 10000;
    QCOMPARE( a.last(), 10000 );
}
Q3ValueList<KBookmark> K3BookmarkDrag::decode( const QMimeSource * e )
{
    Q3ValueList<KBookmark> bookmarks;
    if ( e->provides("application/x-xbel") )
    {
        QByteArray s( e->encodedData("application/x-xbel") );
        //kDebug(7043) << "K3BookmarkDrag::decode s=" << QCString(s);
        QDomDocument doc;
        doc.setContent( s );
        QDomElement elem = doc.documentElement();
        QDomNodeList children = elem.childNodes();
        for ( int childno = 0; childno < children.count(); childno++) 
        {
           bookmarks.append( KBookmark( children.item(childno).cloneNode(true).toElement() ));
        }
        return bookmarks;
    }
    if ( e->provides("text/uri-list") )
    {
        KUrl::List m_lstDragURLs;
        //kDebug(7043) << "K3BookmarkDrag::decode uri-list";
        if ( K3URLDrag::decode( e, m_lstDragURLs ) )
        {
            KUrl::List::ConstIterator uit = m_lstDragURLs.constBegin();
            KUrl::List::ConstIterator uEnd = m_lstDragURLs.constEnd();
            for ( ; uit != uEnd ; ++uit )
            {
                //kDebug(7043) << "K3BookmarkDrag::decode url=" << (*uit).url();
                bookmarks.append( KBookmark::standaloneBookmark( 
                                        (*uit).prettyUrl(), (*uit) ));
            }
            return bookmarks;
        }
    }
    if( e->provides("text/plain") )
    {        
        //kDebug(7043) << "K3BookmarkDrag::decode text/plain";
        QString s;
        if(Q3TextDrag::decode( e, s ))
        {
            
            QStringList listDragURLs = s.split(QChar('\n'), QString::SkipEmptyParts);
            QStringList::ConstIterator it = listDragURLs.constBegin();
            QStringList::ConstIterator end = listDragURLs.constEnd();
            for( ; it!=end; ++it)
            {
                //kDebug(7043)<<"K3BookmarkDrag::decode string"<<(*it);
                bookmarks.append( KBookmark::standaloneBookmark( KUrl(*it).prettyUrl(), KUrl(*it)));
            }
            return bookmarks;
        }
    }
    bookmarks.append( KBookmark() );
    return bookmarks;
}
Beispiel #13
0
void UmlItem::write_stereotyped(FileOut & out)
{
    QMap<QString, Q3PtrList<UmlItem> >::Iterator it;

    for (it = _stereotypes.begin(); it != _stereotypes.end(); ++it) {
        const char * st = it.key();
        UmlClass * cl = UmlClass::findStereotype(it.key(), TRUE);

        if (cl != 0) {
            Q3ValueList<WrapperStr> extended;

            cl->get_extended(extended);

            Q3PtrList<UmlItem> & l = it.data();
            UmlItem * elt;

            for (elt = l.first(); elt != 0; elt = l.next()) {
                out << "\t<" << st;
                out.id_prefix(elt, "STELT_");

                const Q3Dict<WrapperStr> props = elt->properties();
                Q3DictIterator<WrapperStr> itp(props);

                while (itp.current()) {
                    QString k = itp.currentKey();

                    if (k.contains(':') == 2) {
                        out << " ";
                        out.quote((const char *)k.mid(k.findRev(':') + 1)); //[jasa] ambiguous call
                        out << "=\"";
                        out.quote((const char *)*itp.current());
                        out << '"';
                    }

                    ++itp;
                }

                Q3ValueList<WrapperStr>::Iterator iter_extended;

                for (iter_extended = extended.begin();
                        iter_extended != extended.end();
                        ++iter_extended) {
                    WrapperStr vr = "base_" + *iter_extended;

                    out.ref(elt, vr);
                }

                out << "/>\n";

                elt->unload();
            }
        }
    }

}
Beispiel #14
0
void ParameterSetDialog::init_pins_tab()
{
    bool visit = !hasOkButton();
    Q3HBox * hbox;
    QPushButton * button;
    Q3VBox * vbox = new Q3VBox(this);
    Q3VBox * page = vbox;
    const Q3ValueList<BrowserPin *> & inpins = data->pins;
    Q3ValueList<BrowserPin *>::ConstIterator it;

    if (!visit) {
        hbox = new Q3HBox(vbox);
        vbox = new Q3VBox(hbox);
        vbox->setMargin(5);
        (new QLabel(TR("Parameters out of Parameter Set"), vbox))->setAlignment(Qt::AlignCenter);
        lb_available = new Q3ListBox(vbox);
        lb_available->setSelectionMode(Q3ListBox::Multi);

        BrowserParameterSet * bn =
            (BrowserParameterSet *) data->get_browser_node();
        Q3ValueList<BrowserPin *> allpins =
            ((BrowserActivityAction *) bn->parent())->get_pins();

        for (it = allpins.begin(); it != allpins.end(); it++)
            if (inpins.find(*it) == inpins.end())
                lb_available->insertItem(new ListBoxBrowserNode(*it, (*it)->full_name(TRUE)));

        lb_available->sort();

        vbox = new Q3VBox(hbox);
        vbox->setMargin(5);
        (new QLabel("", vbox))->setScaledContents(TRUE);
        button = new QPushButton(vbox);
        button->setPixmap(*rightPixmap);
        connect(button, SIGNAL(clicked()), this, SLOT(associate_cls()));
        (new QLabel("", vbox))->setScaledContents(TRUE);
        button = new QPushButton(vbox);
        button->setPixmap(*leftPixmap);
        connect(button, SIGNAL(clicked()), this, SLOT(unassociate_cls()));
        (new QLabel("", vbox))->setScaledContents(TRUE);
        vbox = new Q3VBox(hbox);
    }

    vbox->setMargin(5);
    (new QLabel(TR("Parameters in Parameter Set"), vbox))->setAlignment(Qt::AlignCenter);
    lb_member = new Q3ListBox(vbox);
    lb_member->setSelectionMode((visit) ? Q3ListBox::NoSelection
                                : Q3ListBox::Multi);

    for (it = inpins.begin(); it != inpins.end(); ++it)
        lb_member->insertItem(new ListBoxBrowserNode(*it, (*it)->full_name(TRUE)));

    addTab(page, TR("Parameters"));
}
/*!
 * Gets element id.
 * \param item (in) - element item.
 */
qulonglong CatalogForm::getElementId( Q3ListViewItem * item )
{
	Q3ValueList<Q3ListViewItem*> lst = map_el.values();
	int ind = lst.findIndex(item);
	qulonglong key=0;
	if(ind!=-1)
	{
		Q3ValueList<qulonglong> listKey = map_el.keys();
		key = listKey[ind];
	}
return key;
}
Beispiel #16
0
void Tag::saveTagsTo(Q3ValueList<Tag*> &list, const QString &fullPath)
{
    // Create Document:
    QDomDocument document(/*doctype=*/"basketTags");
    QDomElement root = document.createElement("basketTags");
    root.setAttribute("nextStateUid", static_cast<long long int>(nextStateUid) );
    document.appendChild(root);

    // Save all tags:
    for (List::iterator it = list.begin(); it != list.end(); ++it) {
        Tag *tag = *it;
        // Create tag node:
        QDomElement tagNode = document.createElement("tag");
        root.appendChild(tagNode);
        // Save tag properties:
        XMLWork::addElement( document, tagNode, "name",      tag->name()                                      );
        XMLWork::addElement( document, tagNode, "shortcut", tag->shortcut().primary().toString());
        XMLWork::addElement( document, tagNode, "inherited", XMLWork::trueOrFalse(tag->inheritedBySiblings()) );
        // Save all states:
        for (State::List::iterator it2 = (*it)->states().begin(); it2 != (*it)->states().end(); ++it2) {
            State *state = *it2;
            // Create state node:
            QDomElement stateNode = document.createElement("state");
            tagNode.appendChild(stateNode);
            // Save state properties:
            stateNode.setAttribute("id", state->id());
            XMLWork::addElement( document, stateNode, "name",   state->name()   );
            XMLWork::addElement( document, stateNode, "emblem", state->emblem() );
            QDomElement textNode = document.createElement("text");
            stateNode.appendChild(textNode);
            QString textColor = (state->textColor().isValid() ? state->textColor().name() : "");
            textNode.setAttribute( "bold",      XMLWork::trueOrFalse(state->bold())      );
            textNode.setAttribute( "italic",    XMLWork::trueOrFalse(state->italic())    );
            textNode.setAttribute( "underline", XMLWork::trueOrFalse(state->underline()) );
            textNode.setAttribute( "strikeOut", XMLWork::trueOrFalse(state->strikeOut()) );
            textNode.setAttribute( "color",     textColor                                );
            QDomElement fontNode = document.createElement("font");
            stateNode.appendChild(fontNode);
            fontNode.setAttribute( "name", state->fontName() );
            fontNode.setAttribute( "size", state->fontSize() );
            QString backgroundColor = (state->backgroundColor().isValid() ? state->backgroundColor().name() : "");
            XMLWork::addElement( document, stateNode, "backgroundColor", backgroundColor );
            QDomElement textEquivalentNode = document.createElement("textEquivalent");
            stateNode.appendChild(textEquivalentNode);
            textEquivalentNode.setAttribute( "string",         state->textEquivalent()                       );
            textEquivalentNode.setAttribute( "onAllTextLines", XMLWork::trueOrFalse(state->onAllTextLines()) );
        }
    }

    // Write to Disk:
    if (!Basket::safelySaveToFile(fullPath, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + document.toString()))
        DEBUG_WIN << "<font color=red>FAILED to save tags</font>!";
}
Beispiel #17
0
void UmlBaseClassInstance::relationsValue(Q3ValueList<SlotRelation> & result) {
  UmlCom::send_cmd(_identifier, relationsCmd, (void *) 0);

  unsigned n = UmlCom::read_unsigned();

  result.clear();
  while (n--) {
    UmlRelation * r = (UmlRelation *) UmlBaseItem::read_();

    result.append(SlotRelation(r, (UmlClassInstance *) UmlBaseItem::read_()));
  }
}
Beispiel #18
0
void UmlBaseClassInstance::attributesValue(Q3ValueList<SlotAttribute> & result) {
  UmlCom::send_cmd(_identifier, attributesCmd, (char) 0);

  unsigned n = UmlCom::read_unsigned();

  result.clear();
  while (n--) {
    UmlAttribute * at = (UmlAttribute *) UmlBaseItem::read_();

    result.append(SlotAttribute(at, UmlCom::read_string()));
  }
}
void tst_Q3ValueList::prepend()
{
    Q3ValueList<int> a;
    a.append( 1 );
    a.append( 10 );
    a.append( 100 );

    QCOMPARE( (int)a[0], 1 );
    Q3ValueList<int>::Iterator it = a.prepend( 1000 );
    QCOMPARE( (int)a[0], 1000 );
    QVERIFY( *it == 1000 );
}
/*!
 * Loads elemens in group, if then don't loaded.
 * \param item (in) - group for load.
 */
void
CatalogForm::onLoadElements( Q3ListViewItem *item )
{
	Q3ValueList<Q3ListViewItem*> lst = map_gr.values();
	int ind = lst.findIndex(item);
	qulonglong key;
	if(ind!=-1)
	{
		Q3ValueList<qulonglong> listKey = map_gr.keys();
		key = listKey[ind];
		loadElements(key);
	}
}
Beispiel #21
0
Q3ValueList<UmlActualParameter> UmlBaseClass::actuals() {
  UmlCom::send_cmd(_identifier, actualsCmd);
  
  Q3ValueList<UmlActualParameter> actuals;
  
  for (unsigned n = UmlCom::read_unsigned(); n; n -= 1) {
    UmlActualParameter a;
    
    a.read_();
    actuals.append(a);
  }
  
  return actuals;
}
Beispiel #22
0
Q3DragObject* NoteDrag::dragObject(NoteSelection *noteList, bool cutting, QWidget *source)
{
	if (noteList->count() <= 0)
		return 0;

	// The MimeSource:
	K3MultipleDrag *multipleDrag = new K3MultipleDrag(source);

	// Make sure the temporary folder exists and is empty (we delete previously moved file(s) (if exists)
	// since we override the content of the clipboard and previous file willn't be accessable anymore):
	createAndEmptyCuttingTmpFolder();

	// The "Native Format" Serialization:
	QBuffer buffer;
	if (buffer.open(QIODevice::WriteOnly)) {
		QDataStream stream(&buffer);
		// First append a pointer to the basket:
		stream << (quint64)(noteList->firstStacked()->note->basket());
		// Then a list of pointers to all notes, and parent groups:
		for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked())
			stream << (quint64)(node->note);
		Q3ValueList<Note*> groups = noteList->parentGroups();
		for (Q3ValueList<Note*>::iterator it = groups.begin(); it != groups.end(); ++it)
			stream << (quint64)(*it);
		stream << (quint64)0;
		// And finally the notes themselves:
		serializeNotes(noteList, stream, cutting);
		// Append the object:
		buffer.close();
		Q3StoredDrag *dragObject = new Q3StoredDrag(NOTE_MIME_STRING, source);
		dragObject->setEncodedData(buffer.buffer());
		multipleDrag->addDragObject(dragObject);
	}

	// The "Other Flavours" Serialization:
	serializeText(  noteList, multipleDrag          );
	serializeHtml(  noteList, multipleDrag          );
	serializeImage( noteList, multipleDrag          );
	serializeLinks( noteList, multipleDrag, cutting );

	// The Alternate Flavours:
	if (noteList->count() == 1)
		noteList->firstStacked()->note->content()->addAlternateDragObjects(multipleDrag);

	// If it is a drag, and not a copy/cut, add the feedback pixmap:
	if (source)
		setFeedbackPixmap(noteList, multipleDrag);

	return multipleDrag;
}
Beispiel #23
0
Q3ValueList<UmlFormalParameter> UmlBaseClass::formals() {
  UmlCom::send_cmd(_identifier, formalsCmd);
  
  Q3ValueList<UmlFormalParameter> formals;
  
  for (unsigned n = UmlCom::read_unsigned(); n; n -= 1) {
    UmlFormalParameter f;
    
    f.read_();
    formals.append(f);
  }
  
  return formals;
}
Beispiel #24
0
bool UmlClass::isAppliedStereotype(Token & tk, WrapperStr & prof_st, Q3ValueList<WrapperStr> & base_v)
{
    static Q3Dict<WrapperStr> stereotypes;
    static Q3Dict<Q3ValueList<WrapperStr> > bases;

    WrapperStr s = tk.what();
    WrapperStr * st = stereotypes[s];

    if (st != 0) {
        prof_st = *st;
        base_v = *bases[s];
        return TRUE;
    }

    base_v.clear();

    if (tk.xmiType().isEmpty() && (getFct(tk) == 0))  {
        int index = s.find(':');

        if ((index != -1) &&
            ((index != 3) || ((s.left(3) != "uml") && (s.left(3) != "xmi")))) {
            UmlClass * cl = findStereotype(s, FALSE);

            if (cl != 0) {
                const Q3PtrVector<UmlItem> ch = cl->children();
                unsigned n = ch.size();

                for (unsigned i = 0; i != n; i += 1) {
                    UmlItem * x = ch[i];

                    if ((x->kind() == aRelation) &&
                        (((UmlRelation *) x)->relationKind() == aDirectionalAssociation) &&
                        (((UmlRelation *) x)->roleType()->stereotype() == "metaclass"))
                        base_v.append("base_" + ((UmlRelation *) x)->roleType()->name().lower());
                }

                if (base_v.isEmpty())
                    base_v.append("base_element");

                prof_st = cl->parent()->parent()->name() + ":" + cl->name();
                stereotypes.insert(s, new WrapperStr(prof_st));
                bases.insert(s, new Q3ValueList<WrapperStr>(base_v));
                return TRUE;
            }
        }
    }

    return FALSE;
}
K3BookmarkDrag::K3BookmarkDrag( const Q3ValueList<KBookmark> & bookmarks, const Q3StrList & urls,
                  QWidget * dragSource, const char * name )
    : Q3UriDrag( urls, dragSource, name ), m_bookmarks( bookmarks ), m_doc("xbel")
{
    // We need to create the XML for this drag right now and not
    // in encodedData because when cutting a folder, the children
    // wouldn't be part of the bookmarks anymore, when encodedData
    // is requested.
    QDomElement elem = m_doc.createElement("xbel");
    m_doc.appendChild( elem );
    for ( Q3ValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it ) {
       elem.appendChild( (*it).internalElement().cloneNode( true /* deep */ ) );
    }
    //kDebug(7043) << "K3BookmarkDrag::K3BookmarkDrag " << m_doc.toString();
}
Beispiel #26
0
/*!
 * \en	Sets available tables, using object tables. \_en
 * \ru 	Заполняет внутренний список доступных таблиц, используя в качестве
 * 	источника информации объект tables.
 * 	Добавляет к имени уже забинденой таблицы звездочку(*). \_ru
 */
void
wDBTable::setAvailableTables()
{
aCfgItem o_table, o = tables;
QString str;
QStringList listIdTable;
int res;
Q3ValueList<int> vList = getBindList();

	if(o.isNull()) return;
	QString objClass = md->objClass(o);
	//printf("obj class `%s'\n",objClass.ascii());
	list_available_tables.clear();
	if(objClass==md_tables)
	{
		res = md->countChild(o,md_table); // ind kol_vo tables in obj tables
		for(int i=0; i<res; i++)
		{
			o_table = md->findChild(o,md_table,i);
			listIdTable << QString("%1").arg(md->id(o_table));
			//printf("id = %li\n", md->id(o_table));
		}
	}
	if(objClass==md_columns)
	{
	//	listIdTable << QString("%1").arg(md->id(o));
		list_available_tables << tr("Available columns");
	}
	if(objClass==md_element)
	{
		list_available_tables << md_element;

	//	listIdTable << QString("%1").arg(md->id(o));
	}

	//res = md->countChild(o,md_table); // ind kol_vo tables in obj tables
	res = listIdTable.count();
	for(int i=0; i<res; i++)
	{
		//o_table = md->findChild(o,md_table,i);

		if(vList.find(listIdTable[i].toInt())!=vList.end())
			str ="* ";
		else
			str ="";
		list_available_tables << str + md->attr(md->find(listIdTable[i].toInt()),mda_name); // add tables name in  combo box
	}
}
Beispiel #27
0
void
dSelectRole::setData( aUser *user )
{
 usr = user;
 listBox1->clear();
 listId.clear();
 Q3ValueList<aRole*> list = user->getRoles(false);
 Q3ValueList<aRole*>::iterator it;
 for ( it = list.begin(); it != list.end(); ++it )
 {
  listBox1->insertItem( (*it)->sysValue("name").toString() );
  listId.append((*it)->sysValue("id").toString());
  delete (*it);
 }
// delete list;
}
Beispiel #28
0
bool KstDataSource::supportsTime(const QString& filename, const QString& type) {
  if (filename.isEmpty() || filename == "stdin" || filename == "-") {
    return false;
  }

  QString fn = obtainFile(filename);
  if (fn.isEmpty()) {
    return false;
  }

  Q3ValueList<PluginSortContainer> bestPlugins = bestPluginsForSource(fn, type);
  if (bestPlugins.isEmpty()) {
    return false;
  }
  return (*bestPlugins.begin()).plugin->supportsTime(qSettingsObject, fn);
}
Beispiel #29
0
void StoneHandler::checkNeighbourLibertyOnMatrix(int x, int y, Q3ValueList<int> &libCounted, int &liberties, Matrix *m)
{
	if (!x || !y)
		return;
	
//	Stone *s;
	
	if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
	    !libCounted.contains(100*x + y) &&
	    (m->at(x - 1, y - 1) == MARK_TERRITORY_DONE_BLACK ||
	     m->at(x - 1, y - 1) == MARK_TERRITORY_DONE_WHITE))
	{
		libCounted.append(100*x + y);
		liberties ++;
	}
}
Beispiel #30
-46
void StoneHandler::checkNeighbourLiberty(int x, int y, Q3ValueList<int> &libCounted, int &liberties, Matrix *m)    //SL added eb 8
{
	if (!x || !y)
		return;
	
	Stone *s;
//  CHECK_PTR(m); // SL added eb 8

  if (m==NULL) //added eb 8 -> we don't have a matrix passed here, so we check on the board
  {
	  if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
		  !libCounted.contains(100*x + y) &&
  		((s = stones->find(Matrix::coordsToKey(x, y))) == NULL ||
	  	!s->isVisible()))
	  {
		  libCounted.append(100*x + y);
		  liberties ++;
	  }
  }  
  else                                      
  {
    if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
	    !libCounted.contains(100*x + y) &&
	    (m->at(x - 1, y - 1) == stoneNone ))         // ?? check stoneErase ?
	  {
		  libCounted.append(100*x + y);
		  liberties ++;
	  }            // end add eb 8
  }
}