Changeset 90 for trunk/orca/qt

Show
Ignore:
Timestamp:
03/14/06 20:39:22 (3 years ago)
Author:
krobillard
Message:

Qt - Removed DIR_WATCHER code.

Location:
trunk/orca/qt
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/qt/qorca.cpp

    r86 r90  
    3131#include "cbparse.h" 
    3232 
    33 #ifdef DIR_WATCHER 
    34 #include <DirWatcher.h> 
    35 #endif 
    36  
    3733 
    3834struct LayoutInfo 
     
    107103 
    108104 
    109 int WIDPool::add( QWidget* ptr, int type ) 
     105int WIDPool::add( QObject* ptr, int type ) 
    110106{ 
    111107    int index; 
     
    118114 
    119115        rec.type   = type; 
    120         rec.widget = ptr; 
     116        rec.object = ptr; 
    121117 
    122118        --_freeCount; 
     
    127123        REC rec; 
    128124        rec.type   = type; 
    129         rec.widget = ptr; 
     125        rec.object = ptr; 
    130126        _records.push_back( rec );  
    131127    } 
     
    142138    rec.type = _freeIndex; 
    143139    _freeIndex = id; 
    144     rec.widget = 0; 
     140    rec.object = 0; 
    145141 
    146142    ++_freeCount; 
     
    153149    { 
    154150        REC* rec = &_records[ id ]; 
    155         if( rec->widget ) 
     151        if( rec->object ) 
    156152            return rec; 
    157153    } 
     
    849845    if( rec ) 
    850846    { 
    851         delete rec->widget; 
     847        delete rec->object; 
    852848    } 
    853849    orResultNONE; 
     
    913909    WIDPool::REC* rec = qEnv.pool.record( a1->integer ); 
    914910    if( rec ) 
    915         rec->widget->setEnabled( true ); 
     911    { 
     912        QWidget* widget = qobject_cast<QWidget*>( rec->object ); 
     913        if( widget ) 
     914            widget->setEnabled( true ); 
     915    } 
    916916} 
    917917 
     
    921921    WIDPool::REC* rec = qEnv.pool.record( a1->integer ); 
    922922    if( rec ) 
    923         rec->widget->setEnabled( false ); 
     923    { 
     924        QWidget* widget = qobject_cast<QWidget*>( rec->object ); 
     925        if( widget ) 
     926            widget->setEnabled( false ); 
     927    } 
    924928} 
    925929 
     
    11331137        QMessageBox::information( 0, cp1, cp2 ); 
    11341138} 
    1135  
    1136  
    1137 //---------------------------------------------------------------------------- 
    1138  
    1139  
    1140 #ifndef DIR_WATCHER 
    1141 void QOrcaApp::fileChanged( DirWatcher* ) {} 
    1142 #endif 
    11431139 
    11441140 
     
    11691165  "set-widget-value: native [wid [integer!] val]\n" 
    11701166  "append-text: native [wid [integer!] val]\n" 
    1171   "watch-dir: native [dir [string! file!] handler [block!]]\n" 
    11721167  "message: native [title [string!] msg [string!] /warn]\n" 
    11731168  "layout-rules: [\n" 
     
    12391234    orNative( (void*) appendTextNative,     "append-text" ); 
    12401235    orNative( (void*) messageNative,        "message" ); 
    1241 #ifdef DIR_WATCHER 
    1242     extern void watchDirNative( OValue* ); 
    1243     extern void spawnNative( OValue* ); 
    1244     orNative( (void*) watchDirNative,       "watch-dir" ); 
    1245     orNative( (void*) spawnNative,          "spawn" ); 
    1246 #endif 
    12471236 
    12481237    { 
     
    12891278                delete (*it).widget; 
    12901279            } 
    1291 #ifdef DIR_WATCHER 
    1292             else if( (*it).type == WT_Watcher ) 
    1293             { 
    1294                 delete ((DirWatcher*) (*it).widget); 
    1295             } 
    1296 #endif 
    12971280 
    12981281            // Assuming all other widgets are deleted from WT_Dialog & 
  • trunk/orca/qt/qorca.h

    r42 r90  
    6161    { 
    6262        int type; 
    63         QWidget* widget; 
     63        union 
     64        { 
     65            QObject* object; 
     66            QWidget* widget; 
     67        }; 
    6468    }; 
    6569 
    6670    WIDPool() : _freeCount(0), _freeIndex(-1) {} 
    6771 
    68     int  add( QWidget*, int type ); 
     72    int  add( QObject*, int type ); 
    6973    void remove( int id ); 
    7074    REC* record( int id ); 
     
    106110 
    107111 
    108 class DirWatcher; 
    109  
    110112class QOrcaApp : public QApplication 
    111113{ 
     
    115117 
    116118    QOrcaApp( int argc, char** argv ); 
    117  
    118 protected slots: 
    119  
    120     void fileChanged( DirWatcher* ); 
    121119}; 
    122120