Back to index

salome-geom  6.5.0
Functions
GEOMToolsGUI_DeleteDlg.cxx File Reference
#include "GEOMToolsGUI_DeleteDlg.h"
#include <QLabel>
#include <QDialogButtonBox>
#include <QTextBrowser>
#include <QStringList>
#include <QGridLayout>
#include <SUIT_MessageBox.h>

Go to the source code of this file.

Functions

static bool isEntryLess (const QString &e1, const QString &e2)
static QStringList objectsToNames (const QMap< QString, QString > &objects)

Function Documentation

static bool isEntryLess ( const QString &  e1,
const QString &  e2 
) [static]

Definition at line 33 of file GEOMToolsGUI_DeleteDlg.cxx.

{
  QStringList el1 = e1.split(":");
  QStringList el2 = e2.split(":");
  int e1c = el1.count(), e2c = el2.count();
  for ( int i = 0; i < e1c && i < e2c; i++ ) {
    int id1 = el1[i].toInt();
    int id2 = el2[i].toInt();
    if ( id1 < id2 ) return true;
    else if ( id2 < id1 ) return false;
  }
  return el1.count() < el2.count();
}

Here is the caller graph for this function:

static QStringList objectsToNames ( const QMap< QString, QString > &  objects) [static]

Definition at line 47 of file GEOMToolsGUI_DeleteDlg.cxx.

{
  QStringList entries;
  for ( QMap<QString, QString>::ConstIterator it = objects.begin(); it != objects.end(); ++it ) {
    QString entry = it.key();
    QStringList::Iterator iter;
    bool added = false;
    for ( iter = entries.begin(); iter != entries.end() && !added; ++iter ) {
      if ( isEntryLess( entry, *iter ) ) {
        entries.insert( iter, entry );
        added = true;
      }
    }
    if ( !added ) 
      entries.append( entry );
  }
  QStringList names;
  for ( int i = 0; i < entries.count(); i++ ) {
    int level = entries[i].count(":")-3;
    names.append( QString( level*2, ' ' ) + objects[ entries[i] ] );
  }
  return names;
}

Here is the call graph for this function: