Skip to content

Commit

Permalink
#782, supplemental
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenHilferink committed Oct 2, 2024
1 parent ea9caeb commit 83b985c
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 68 deletions.
8 changes: 3 additions & 5 deletions clc/dll/src/SubItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ struct CheckOperator : public BinaryOperator
if (nrFailures)
{
auto ultimate_item = resultHolder.GetUlt();
auto integrity_checked_item = ultimate_item ? resultHolder.GetUlt()->GetBackRef() : nullptr;
// throwError(ICHECK_NAME, "%s", iChecker->GetExpr().c_str()); // will be caught by SuspendibleUpdate who will Fail this.
resultHolder.Fail(mySSPrintF( "[[%s]] %s : %d element(s) failed", integrity_checked_item ? integrity_checked_item->GetFullName() : SharedStr(""), ICHECK_NAME, nrFailures), FR_Validate); // will be caught by SuspendibleUpdate who will Fail this.
dms_assert(resultHolder.WasFailed(FR_Validate));
// return AVS_SuspendedOrFailed;
// will be caught by SuspendibleUpdate who will Fail this.
resultHolder.Fail(mySSPrintF( "[[%s]] %s : %d element(s) failed", ultimate_item ? ultimate_item->GetFullCfgName().c_str() : "", ICHECK_NAME, nrFailures), FR_Validate); // will be caught by SuspendibleUpdate who will Fail this.
assert(resultHolder.WasFailed(FR_Validate));
}
}
return true;
Expand Down
30 changes: 17 additions & 13 deletions qtgui/exe/src/DmsEventLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ void EventLogModel::addText(MsgData&& msgData, bool moreToCome)
MG_CHECK(not(msgData.m_IsFollowup && md_AddTextCompleted)); // previous msg must have had the cha
#endif

auto mainWindow = MainWindow::TheOne();
if (!mainWindow)
return;
auto mainWindow = MainWindow::TheOne();
if (!mainWindow)
return;

auto eventlog = mainWindow->m_eventlog.get();

auto eventlog = mainWindow->m_eventlog.get();

eventlog->m_clear->setEnabled(true);
m_MsgLines.emplace_back(std::move(msgData));

Expand Down Expand Up @@ -449,6 +449,10 @@ DmsEventLog::DmsEventLog(QWidget* parent)
m_log->setSelectionRectVisible(true);
m_log->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_log->setUniformItemSizes(true);
// m_log->horizontalScrollBar()->setEnabled(true);
m_log->setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded);
m_log->setHorizontalScrollMode(QListView::ScrollPerPixel);

connect(m_log->verticalScrollBar(), &QScrollBar::valueChanged, this, &DmsEventLog::onVerticalScrollbarValueChanged);

auto vertical_layout = new QVBoxLayout(this);
Expand Down Expand Up @@ -659,14 +663,14 @@ void geoDMSMessage(ClientHandle /*clientHandle*/, const MsgData* msgData, bool m
return;

assert(IsMainThread());
if (g_IsTerminating)
return;

auto mainWindow = MainWindow::TheOne();
if (!mainWindow)
return;

auto* eventlog_model = mainWindow->m_eventlog_model.get(); assert(eventlog_model);
if (g_IsTerminating)
return;

auto mainWindow = MainWindow::TheOne();
if (!mainWindow)
return;

auto* eventlog_model = mainWindow->m_eventlog_model.get(); assert(eventlog_model);
eventlog_model->addText(MsgData(*msgData), moreToCome);
}

Expand Down
2 changes: 1 addition & 1 deletion qtgui/exe/src/DmsTreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ DmsTreeView::DmsTreeView(QWidget* parent)
connect(this, &DmsTreeView::doubleClicked, this, &DmsTreeView::onDoubleClick);
connect(this, &DmsTreeView::customContextMenuRequested, this, &DmsTreeView::showTreeviewContextMenu);

horizontalScrollBar()->setEnabled(true);
// horizontalScrollBar()->setEnabled(true); REMOVE, not required with the following policy
setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded);
header()->setStretchLastSection(false);
connect(header(), &QHeaderView::sectionClicked, this, &DmsTreeView::onHeaderSectionClicked);
Expand Down
5 changes: 3 additions & 2 deletions rtc/dll/src/mci/persistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,10 @@ void Object::WriteObj(PolymorphOutStream&) const

SharedStr PersistentSharedObj::GetSourceName() const
{
if (GetParent())
auto fullCfgName = GetFullCfgName();
if (!fullCfgName.empty())
return
mySSPrintF("[[%s]]", GetFullName().c_str());
mySSPrintF("[[%s]]", fullCfgName.c_str());
TokenStr nameID = GetName();
return
mySSPrintF("%s: %s"
Expand Down
6 changes: 3 additions & 3 deletions rtc/dll/src/ptr/PersistentSharedObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class PersistentSharedObj : public SharedObj
RTC_CALL SharedStr GetSourceName() const override;

// NON VIRTUAL ROUTINES BASED ON THE ABOVE INTERFACE
RTC_CALL SharedStr GetFullName() const;
RTC_CALL SharedStr GetPrefixedFullName() const;

RTC_CALL auto GetFullName() const -> SharedStr;
RTC_CALL auto GetPrefixedFullName() const->SharedStr;
virtual auto GetFullCfgName() const -> SharedStr { return GetFullName(); }
RTC_CALL const PersistentSharedObj* GetRoot() const;
RTC_CALL bool DoesContain(const PersistentSharedObj* subItemCandidate) const;

Expand Down
7 changes: 4 additions & 3 deletions rtc/dll/src/xct/DmsException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ void ErrMsg::TellWhere(const PersistentSharedObj* ptr)

if (m_FullName.empty())
{
m_FullName = ptr->GetFullName();
m_HasBeenReported = false;
m_FullName = ptr->GetFullCfgName();
if (!m_FullName.empty())
m_HasBeenReported = false; // we like to see this reported again with m_FullName
}
}

Expand Down Expand Up @@ -282,7 +283,7 @@ void reportD_without_cancellation_check_impl(MsgCategory msgCat, SeverityTypeID

if (contextStr.empty())
return;
*g_DebugStream << "\n" << contextStr;
*g_DebugStream << " " << contextStr;
}

RTC_CALL void reportD_without_cancellation_check(MsgCategory msgCat, SeverityTypeID st, CharPtr msg)
Expand Down
35 changes: 7 additions & 28 deletions rtc/dll/src/xct/ErrMsg.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
//<HEADER>
/*
Data & Model Server (DMS) is a server written in C++ for DSS applications.
Version: see srv/dms/rtc/dll/src/RtcVersion.h for version info.
Copyright (C) 1998-2004 YUSE GSO Object Vision BV.
Documentation on using the Data & Model Server software can be found at:
http://www.ObjectVision.nl/DMS/
See additional guidelines and notes in srv/dms/Readme-srv.txt
This library is free software; you can use, redistribute, and/or
modify it under the terms of the GNU General Public License version 2
(the License) as published by the Free Software Foundation,
provided that this entire header notice and readme-srv.txt is preserved.
See LICENSE.TXT for terms of distribution or look at our web site:
http://www.objectvision.nl/DMS/License.txt
or alternatively at: http://www.gnu.org/copyleft/gpl.html
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. However, specific warranties might be
granted by an additional written contract for support, assistance and/or development
*/
//</HEADER>
// Copyright (C) 1998-2024 Object Vision b.v.
// License: GNU GPL 3
/////////////////////////////////////////////////////////////////////////////

#if defined(_MSC_VER)
#pragma once
#endif


#if !defined(__RTC_XCT_ERRMSG_H)
#define __RTC_XCT_ERRMSG_H
Expand Down
13 changes: 13 additions & 0 deletions tic/dll/src/TreeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2447,6 +2447,19 @@ const TreeItem* TreeItem::GetBackRef() const
return m_BackRef;
}

auto TreeItem::GetFullCfgName() const -> SharedStr
{
auto cfgItem = this;
while (cfgItem->IsCacheRoot())
{
auto backItem = cfgItem->GetBackRef();
if (!backItem)
break;
cfgItem = backItem;
}
return cfgItem->GetFullName();
}

void TreeItem::UpdateMetaInfoImpl2() const
{
dbg_assert(IsMetaThread());
Expand Down
15 changes: 2 additions & 13 deletions tic/dll/src/TreeItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,19 +433,8 @@ struct TreeItem : Actor, ItemTree
#endif // MG_DEBUG_DATA


TIC_CALL const TreeItem* GetBackRef() const;
SharedStr GetFullCfgName() const
{
auto cfgItem = this;
while (cfgItem->IsCacheRoot())
{
auto backItem = cfgItem->GetBackRef();
if (!backItem)
break;
cfgItem = backItem;
}
return cfgItem->GetFullName();
}
TIC_CALL auto GetBackRef() const -> const TreeItem*;
TIC_CALL auto GetFullCfgName() const -> SharedStr override;
//private: // TODO G8: encapsulate

TokenID m_ID;
Expand Down

0 comments on commit 83b985c

Please sign in to comment.