Changeset 13826


Ignore:
Timestamp:
05/23/12 10:42:46 (13 years ago)
Author:
tbretz
Message:
Fixeda few issues with synchonous and asynchronous treatment of the DimNetwork virtual functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/FactGui.h

    r13825 r13826  
    292292        DimNetwork::AddServer(s);
    293293
     294        const State state = GetState(s, GetCurrentState(s));
     295
    294296        QApplication::postEvent(this,
    295            new FunctionEvent(bind(&FactGui::handleAddServer, this, s)));
     297           new FunctionEvent(bind(&FactGui::handleAddServer, this, s, state)));
    296298    }
    297299
    298300    void AddService(const string &server, const string &service, const string &fmt, bool iscmd)
    299301    {
     302        const vector<Description> v = GetDescription(server, service);
     303
    300304        QApplication::postEvent(this,
    301            new FunctionEvent(bind(&FactGui::handleAddService, this, server, service, fmt, iscmd)));
     305           new FunctionEvent(bind(&FactGui::handleAddService, this, server, service, fmt, iscmd, v)));
    302306    }
    303307
     
    320324    void AddDescription(const string &server, const string &service, const vector<Description> &vec)
    321325    {
     326        const bool iscmd = IsCommand(server, service)==true;
     327
    322328        QApplication::postEvent(this,
    323            new FunctionEvent(bind(&FactGui::handleAddDescription, this, server, service, vec)));
     329           new FunctionEvent(bind(&FactGui::handleAddDescription, this, server, service, vec, iscmd)));
    324330    }
    325331
    326332    // ======================================================================
    327333
    328     void handleAddServer(const string &server)
    329     {
    330         const State s = GetState(server, GetCurrentState(server));
    331         handleStateChanged(Time(), server, s);
    332     }
    333 
    334     void handleAddService(const string &server, const string &service, const string &/*fmt*/, bool iscmd)
     334    void handleAddServer(const string &server, const State &state)
     335    {
     336        handleStateChanged(Time(), server, state);
     337    }
     338
     339    void handleAddService(const string &server, const string &service, const string &/*fmt*/, bool iscmd, const vector<Description> &vec)
    335340    {
    336341        QStandardItem *item = AddServiceItem(server, service, iscmd);
    337         const vector<Description> v = GetDescription(server, service);
    338         AddDescription(item, v);
     342        AddDescription(item, vec);
    339343    }
    340344
     
    382386    }
    383387
    384     void handleAddDescription(const string &server, const string &service, const vector<Description> &vec)
    385     {
    386         const bool iscmd = IsCommand(server, service)==true;
    387 
     388    void handleAddDescription(const string &server, const string &service, const vector<Description> &vec, bool iscmd)
     389    {
    388390        QStandardItem *item = AddServiceItem(server, service, iscmd);
    389391        AddDescription(item, vec);
Note: See TracChangeset for help on using the changeset viewer.