
 New Files: qdir_vms.cpp
 qfile_vms.cpp  qfilesinfo_vms.cpp   Modified Files:  ******************************  QT:[QT-2_1_0.INCLUDE]QGLOBAL.H;4  ) #elif defined(sco) || defined(_UNIXWARE7)  #define _OS_UNIXWARE7_H #elif !defined(_SCO_DS) && defined(__USLC__) && defined(__SCO_VERSION__) #define _OS_UNIXWARE7_ #elif defined(__VMS) #define _OS_VMS_ #else J #error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com" #endif   ******************************+ QT:[QT-2_1_0.SRC.DIALOGS]QCOLORDIALOG.CPP;2  #ifdef _OS_VMS_  #include "qwellarray_p.h"  #else $ #include "../widgets/qwellarray_p.h" #endif   ******************************+ QT:[QT-2_1_0.SRC.DIALOGS]QFILEDIALOG.CPP;26   B void QFileDialog::selectDirectoryOrFile( QListViewItem * newItem ) {  #ifdef _OS_VMS_ "     QString buf(newItem->text(0));,     if(strcmp((const char *) buf,"..") == 0)     {        cdUpClicked();
       return;      }  #endif       *workingDirectory = d->url; (     detailViewMode = files->isVisible();     *lastSize = size();        if ( !newItem )          return;   G     QFileDialogPrivate::File * i = (QFileDialogPrivate::File *)newItem;  ...   ) QString QFileDialog::selectedFile() const  {  #ifdef _OS_VMS_ F     if(d->currentFileName[0] == '/') return d->currentFileName.mid(1);?     else                             return d->currentFileName;  #else      return d->currentFileName; #endif }   @ QString QFileDialog::getOpenFileName( const QString & startWith,  				      const QString& filter,, 				      QWidget *parent, const char* name," 				      const QString& caption ) {      QStringList filters;     if ( !filter.isEmpty() )% 	filters = makeFiltersList( filter );        makeVariables();     QString initialSelection; J     //### Problem with the logic here: If a startWith is given, and a fileS     // with that name exists in D->URL, the box will be opened at D->URL instead of 4     // the last directory used ('workingDirectory').!     if ( !startWith.isEmpty() ) {  	QUrlOperator u( startWith ); : 	if ( u.isLocalFile() && QFileInfo( u.path() ).isDir() ) {# 	    *workingDirectory = startWith; 	 	} else { & 	    *workingDirectory = u.toString();5 	    initialSelection = QString::null;//u.fileName();  	}     }   %     if ( workingDirectory->isNull() ) , 	*workingDirectory = QDir::currentDirPath();   #if defined(_WS_WIN_) (     if ( qApp->style() == WindowsStyle )G 	return winGetOpenFileName( initialSelection, filter, workingDirectory,  				   parent, name ); #endif  I     QFileDialog *dlg = new QFileDialog( *workingDirectory, QString::null,  					parent, name, TRUE );     CHECK_PTR( dlg );      if ( !caption.isNull() ) 	dlg->setCaption( caption );     else. 	dlg->setCaption( QFileDialog::tr( "Open" ) );       dlg->setFilters( filters ); .     dlg->setMode( QFileDialog::ExistingFile );     QString result; &     if ( !initialSelection.isEmpty() )' 	dlg->setSelection( initialSelection ); -     if ( dlg->exec() == QDialog::Accepted ) {  	result = dlg->selectedFile();! 	*workingDirectory = dlg->d->url;      }      delete dlg;  #ifdef _OS_VMS_ ,     QString ret(*workingDirectory + result);!     ret = QFile::encodeName(ret);      return ret;  #else      return result; #endif }    void QFileDialog::cdUpClicked()  { '     QString oldName = nameEdit->text();  #ifdef _OS_VMS_      QString s = d->url;      char buf[1024]; !     strcpy(buf,(const char *) s);      int i = strlen(buf) - 2;     for(; i>0; i--)      {        if(buf[i] == '/')        {          buf[i+1] = '\0';         break;       }      }      d->url = buf; "     char *cptr = strstr(buf,":/");'     if(cptr != NULL && cptr[2] != '\0') '       setUrl( QUrlOperator( d->url ) );  #else +     setUrl( QUrlOperator( d->url, ".." ) );  #endif     if ( !oldName.isEmpty() )  	nameEdit->setText( oldName ); }   $ void QFileDialog::newFolderClicked() { ,     QString dirname( tr( "New Folder 1" ) );     int i = 0;     QStringList lst;&     QListViewItemIterator it( files );      for ( ; it.current(); ++it )> 	if ( it.current()->text( 0 ).contains( tr( "New Folder" ) ) )+ 	    lst.append( it.current()->text( 0 ) );        if ( !lst.count() == 0 )" 	while ( lst.contains( dirname ) )0 	    dirname = tr( "New Folder %1" ).arg( ++i );   #ifdef _OS_VMS_ %     for(i=0; i<dirname.length(); i++)      { -       if(dirname[i] == ' ') dirname[i] = '_';      }  #endif     d->url.mkdir( dirname ); }    ******************************+ QT:[QT-2_1_0.SRC.DIALOGS]QPRINTDIALOG.CPP;3   , QGroupBox * QPrintDialog::setupDestination() { <     QGroupBox * g = new QGroupBox( tr( "Print destination"),' 				   this, "destination group box" );   D     QBoxLayout * tll = new QBoxLayout( g, QBoxLayout::Down, 12, 0 );     tll->addSpacing( 8 );   0     d->printerOrFile = new QButtonGroup( this );     d->printerOrFile->hide(); 4     connect( d->printerOrFile, SIGNAL(clicked(int)),/ 	     this, SLOT(printerOrFileSelected(int)) );   !     // printer radio button, list G     QRadioButton * rb = new QRadioButton( tr( "Print to printer:" ), g,  					  "printer" );      tll->addWidget( rb ); &     d->printerOrFile->insert( rb, 0 );     rb->setChecked( TRUE );      d->outputToFile = FALSE;  C     QBoxLayout * horiz = new QBoxLayout( QBoxLayout::LeftToRight );      tll->addLayout( horiz, 3 );      horiz->addSpacing( 19 );  9     d->printers = new QListView( g, "list of printers" ); 0     d->printers->setAllColumnsShowFocus( TRUE );1     d->printers->addColumn( tr("Printer"), 125 ); .     d->printers->addColumn( tr("Host"), 125 );1     d->printers->addColumn( tr("Comment"), 150 ); D     d->printers->setFrameStyle( QFrame::WinPanel + QFrame::Sunken );   #ifdef _OS_VMS_      char * etcLpDefault = 0;  @     // all printers hopefully known.  try to find a good default     QString dollarPrinter;     { 
 	char * t; 	t = getenv( "PRINTER" );  	if ( !t || !*t )  	    t = getenv( "LPDEST" );( 	dollarPrinter = QString::fromLatin1(t);     }   :     perhapsAddPrinter(d->printers, dollarPrinter, "", "");     char *t;     t = getenv("PRINTER2"); I     if(t) perhapsAddPrinter(d->printers, QString::fromLatin1(t), "", "");      t = getenv("PRINTER3"); I     if(t) perhapsAddPrinter(d->printers, QString::fromLatin1(t), "", "");      t = getenv("PRINTER4"); I     if(t) perhapsAddPrinter(d->printers, QString::fromLatin1(t), "", "");        int quality = 0;  .     // bang the best default into the listview:     const QListViewItem * lvi = d->printers->firstChild();8     d->printers->setCurrentItem( (QListViewItem *)lvi );     while( lvi ) {6 	QRegExp ps1( QString::fromLatin1("[^a-z]ps[^a-z]") );1 	QRegExp ps2( QString::fromLatin1("[^a-z]ps$") ); 6 	QRegExp lp1( QString::fromLatin1("[^a-z]lp[^a-z]") );1 	QRegExp lp2( QString::fromLatin1("[^a-z]lp$") );  	if ( quality < 4 &&) 	     lvi->text( 0 ) == dollarPrinter ) { 9 	    d->printers->setCurrentItem( (QListViewItem *)lvi );  	    quality = 4; + 	} else if ( quality < 3 && etcLpDefault && = 		    lvi->text( 0 ) == QString::fromLatin1(etcLpDefault) ) { 9 	    d->printers->setCurrentItem( (QListViewItem *)lvi );  	    quality = 3;  	} else if ( quality < 2 && 6 		    ( lvi->text( 0 ) == QString::fromLatin1("ps") ||+ 		      ps1.match( lvi->text( 2 ) ) > -1 || . 		      ps2.match( lvi->text( 2 ) ) > -1 ) ) {9 	    d->printers->setCurrentItem( (QListViewItem *)lvi );  	    quality = 2;  	} else if ( quality < 1 && 6 		    ( lvi->text( 0 ) == QString::fromLatin1("lp") ||+ 		      lp1.match( lvi->text( 2 ) ) > -1 || . 		      lp2.match( lvi->text( 2 ) ) > -1 ) ) {9 	    d->printers->setCurrentItem( (QListViewItem *)lvi );  	    quality = 1;  	} 	lvi = lvi->nextSibling();     } %     if ( d->printers->currentItem() ) > 	d->printers->setSelected( d->printers->currentItem(), TRUE );  3     if ( etcLpDefault )			// Avoid purify complaint  	delete[] etcLpDefault;    #elif defined(UNIX)  ...    ******************************* QT:[QT-2_1_0.SRC.KERNEL]QPRINTER_X11.CPP;2  > bool QPrinter::cmd( int c, QPainter *paint, QPDevCmdParam *p ) {  #ifdef _OS_VMS_      if ( c ==  PdcBegin ) {          //printf("\nPdcBegin");  	if ( state == PST_IDLE ) {  	    if ( output_file ) { / 		int fd = ::open( output_filename.local8Bit(), - 				 O_CREAT | O_NOCTTY | O_TRUNC | O_WRONLY,  				 0666 ); 		if ( fd >= 0 ) {( 		    pdrv = new QPSPrinter( this, fd ); 		    state = PST_ACTIVE;  		} #                 //printf("\nfile");  	    }             else  
             { 0 		int fd = ::open( "PRINT010203040506070809.PS",- 				 O_CREAT | O_NOCTTY | O_TRUNC | O_WRONLY,  				 0666 ); 		if ( fd >= 0 ) {( 		    pdrv = new QPSPrinter( this, fd ); 		    state = PST_ACTIVE;  		}  	    }' 	    if ( state == PST_ACTIVE && pdrv ) 1 		return ((QPSPrinter*)pdrv)->cmd( c, paint, p ); "             //printf("\nprinter"); 	}  
         else  	         {   	    // ignore it?  I don't know 	}     } 	     else       {  	bool r = FALSE;% 	if ( state == PST_ACTIVE && pdrv ) { 1 	    r = ((QPSPrinter*)pdrv)->cmd( c, paint, p );  	    if ( c == PdcEnd ) {                  char buf[500]; 		state = PST_IDLE;  		delete pdrv; 		pdrv = 0;                   if(!output_file)                 { \                   sprintf(buf,"print/queue=%s/delete/noidentify PRINT010203040506070809.PS",/                   (const char *) printer_name); '                   //printf("\n%s",buf);                    system(buf);                 }  	    } 	}
 	return r;     }      return TRUE;  Y #else // not _OS_VMS_ ///////////////////////////////////////////////////////////////////  ...  #endif  // _OS_VMS_  }    ******************************" QT:[QT-2_1_0.SRC.KERNEL]QURL.CPP;6  = static void slashify( QString& s, bool allowMultiple = TRUE )  {      bool justHadSlash = FALSE;1     for ( int i = 0; i < (int)s.length(); i++ ) { ' 	if ( !allowMultiple && justHadSlash && - 	     ( s[ i ] == '/' || s[ i ] == '\\' ) ) {  	    s.remove( i, 1 );	 	    --i;  	    continue; 	} 	if ( s[ i ] == '\\' ) 	    s[ i ] = '/'; 	if ( s[ i ] == '/' )  	    justHadSlash = TRUE;  	else  	    justHadSlash = FALSE;     }  #ifdef _OS_VMS_      char *cptr; +     cptr = strstr((const char *) s, "/..");      if(cptr != NULL)     { 
       cptr--;        while(*cptr != '/')        {                  cptr--;        }        *cptr = '\0';      }  #endif }    bool QUrl::cdUp()  {  #ifdef _OS_VMS_      char buf[1024];      int  i; (     strcpy(buf, (const char *) d->path);     i = strlen(buf) - 1;     for(; i>0; i--)      {        if(buf[i] == '/')        {          buf[i+1] = '\0';         break;       }      }      d->path = buf;     d->cleanPathDirty = TRUE;      return TRUE; #else      d->path += "/..";      d->cleanPathDirty = TRUE;      return TRUE; #endif }    ******************************! QT:[QT-2_1_0.SRC.MOC]MOCGEN.CPP;3    #ifdef _OS_VMS_  #include "lex.yy_c"  #else  #include "lex.yy.c"  #endif   ******************************# QT:[QT-2_1_0.SRC.TOOLS]QFILE.CPP;16    #ifdef _OS_VMS_ / static int test_middle(int i, const QString& n)  {    int ret = 0;  
   while(1)   {      if(n[i++] == '/') ret++;      if(n[i] == '\0') return ret;   }  }    static2 QCString locale_encoder( const QString &fileName ) {      char buf[PATH_MAX];      int idest,pathend,middle;        pathend = 0;     idest   = 0;2     for ( int i=0; i<(int)fileName.length(); i++ )     {        if(i==0)       {          if(fileName[i] == '/')	         { 	         }          else	         { .           buf[idest++] = fileName[i].latin1();	         }        } #       else if( fileName[i] == '/' )        { +         middle = test_middle( i, fileName); 1         if(pathend == 0)      buf[idest++] = '['; 1         else if(middle > 1)   buf[idest++] = '.'; 1         else                  buf[idest++] = ']';          pathend = 1;       } 
       else       { ,         buf[idest++] = fileName[i].latin1();       }      }        buf[idest] = '\0';       if(strchr(buf,']') == NULL)      {        int i,i2;        char buf2[PATH_MAX];       strcpy(buf2,buf); #       for(i=0; buf[i] != '\0'; i++)        {           if(buf[i] == '[') break;       }        buf[i+1] = '\0';       strcat(buf,"000000]");       i2 = i+1; 
       i += 8; #       for(; buf2[i2] != '\0'; i2++)        {          buf[i++] = buf2[i2];       }        buf[i] = '\0';           }        QString ret(buf);      return ret.local8Bit();  }  #else  static2 QCString locale_encoder( const QString &fileName ) {       return fileName.local8Bit(); }  #endif   ******************************( QT:[QT-2_1_0.SRC.WIDGETS]QSPLITTER.CPP;2   #ifdef _OS_VMS_  #include "qlayoutengine_p.h" #else & #include "../kernel/qlayoutengine_p.h" #endif   ******************************+ QT:[QT-2_1_0.SRC.WIDGETS]QTEXTBROWSER.CPP;2    #ifdef _OS_VMS_  #include "qrichtext_p.h" #else " #include "../kernel/qrichtext_p.h" #endif   ******************************( QT:[QT-2_1_0.SRC.WIDGETS]QTEXTVIEW.CPP;2   #ifdef _OS_VMS_  #include "qrichtext_p.h" #else " #include "../kernel/qrichtext_p.h" #endif