Subversion Repositories tpanel

Rev

Rev 296 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 296 Rev 297
Line 34... Line 34...
34
#include "tobject.h"
34
#include "tobject.h"
35
#include "terror.h"
35
#include "terror.h"
36
#include "tqscrollarea.h"
36
#include "tqscrollarea.h"
37
#include "tlock.h"
37
#include "tlock.h"
38
#include "tqtmain.h"
38
#include "tqtmain.h"
-
 
39
#include "tresources.h"
39
 
40
 
40
using std::string;
41
using std::string;
41
using std::map;
42
using std::map;
42
using std::pair;
43
using std::pair;
43
 
44
 
Line 442... Line 443...
442
    }
443
    }
443
}
444
}
444
 
445
 
445
void TObject::invalidateAllSubObjects(ulong handle)
446
void TObject::invalidateAllSubObjects(ulong handle)
446
{
447
{
447
    DECL_TRACER("::invalidateAllSubObjects(ulong handle)");
448
    DECL_TRACER("TObject::invalidateAllSubObjects(ulong handle)");
448
 
449
 
449
    TLOCKER(mutex_obj);
450
    TLOCKER(mutex_obj);
-
 
451
 
-
 
452
    if (mObjects.empty())
-
 
453
        return;
-
 
454
 
450
    map<ulong, OBJECT_t>::iterator iter;
455
    map<ulong, OBJECT_t>::iterator iter;
-
 
456
    bool first = true;
451
 
457
 
452
    for (iter = mObjects.begin(); iter != mObjects.end(); ++iter)
458
    for (iter = mObjects.find(handle); iter != mObjects.end(); ++iter)
453
    {
459
    {
454
        if (iter->first != handle && (iter->first & 0xffff0000) == handle)
460
        if (first)
455
        {
461
        {
-
 
462
            first = false;
-
 
463
            continue;
-
 
464
        }
-
 
465
 
-
 
466
        if ((iter->first & 0xffff0000) == handle)
-
 
467
        {
-
 
468
            MSG_DEBUG("Invalidating object " << handleToString(iter->first) << " of type " << objectToString(iter->second.type));
456
            iter->second.remove = false;
469
            iter->second.remove = false;
457
            iter->second.invalid = true;
470
            iter->second.invalid = true;
-
 
471
 
-
 
472
            if (iter->second.type == OBJ_SUBVIEW && iter->second.object.area && mMainWindow)
-
 
473
                mMainWindow->disconnectArea(iter->second.object.area);
-
 
474
            else if (iter->second.type == OBJ_LIST && iter->second.object.list && mMainWindow)
-
 
475
                mMainWindow->disconnectList(iter->second.object.list);
458
        }
476
        }
459
    }
477
    }
460
}
478
}
461
 
479
 
462
bool TObject::enableObject(ulong handle)
480
bool TObject::enableObject(ulong handle)
Line 469... Line 487...
469
    if (iter != mObjects.end())
487
    if (iter != mObjects.end())
470
    {
488
    {
471
        if (!iter->second.object.widget)
489
        if (!iter->second.object.widget)
472
        {
490
        {
473
            iter->second.remove = true;
491
            iter->second.remove = true;
-
 
492
            MSG_ERROR("Object " << handleToString(iter->first) << " of type " << objectToString(iter->second.type) << " has no QObject!");
474
            return false;
493
            return false;
475
        }
494
        }
476
 
495
 
477
        iter->second.remove = false;
496
        iter->second.remove = false;
478
        iter->second.invalid = false;
497
        iter->second.invalid = false;
479
 
498
 
-
 
499
        if (iter->second.type == OBJ_SUBVIEW && iter->second.object.area && mMainWindow)
-
 
500
            mMainWindow->reconnectArea(iter->second.object.area);
-
 
501
        else if (iter->second.type == OBJ_LIST && iter->second.object.list && mMainWindow)
-
 
502
            mMainWindow->reconnectList(iter->second.object.list);
-
 
503
 
480
        return true;                         // We can savely return here because a handle is unique
504
        return true;                         // We can savely return here because a handle is unique
481
    }
505
    }
482
 
506
 
483
    return false;
507
    return false;
484
}
508
}
Line 496... Line 520...
496
        if (iter->first != handle && (iter->first & 0xffff0000) == handle)
520
        if (iter->first != handle && (iter->first & 0xffff0000) == handle)
497
        {
521
        {
498
            if (!iter->second.object.widget)
522
            if (!iter->second.object.widget)
499
            {
523
            {
500
                iter->second.remove = true;
524
                iter->second.remove = true;
-
 
525
                MSG_ERROR("Object " << handleToString(iter->first) << " of type " << objectToString(iter->second.type) << " has no QObject!");
501
                ret = false;
526
                ret = false;
502
            }
527
            }
503
            else
528
            else
504
            {
529
            {
505
                iter->second.remove = false;
530
                iter->second.remove = false;
506
                iter->second.invalid = false;
531
                iter->second.invalid = false;
-
 
532
 
-
 
533
                if (iter->second.type == OBJ_SUBVIEW && iter->second.object.area && mMainWindow)
-
 
534
                    mMainWindow->reconnectArea(iter->second.object.area);
-
 
535
                else if (iter->second.type == OBJ_LIST && iter->second.object.list && mMainWindow)
-
 
536
                    mMainWindow->reconnectList(iter->second.object.list);
507
            }
537
            }
508
        }
538
        }
509
    }
539
    }
510
 
540
 
511
    return ret;
541
    return ret;